public void EmptyExcludeFromLimitGroupsReturnsNull() { var poolConfig = new PoolConfigurationModel { ExcludeFromLimitGroups = "" }; var deadlineConfig = new DeadlineConfig(); Assert.Null(poolConfig.GetDeadlineExcludeFromLimitGroupsString(deadlineConfig)); }
public void LimitGroupsAreTrimmed() { var poolConfig = new PoolConfigurationModel { ExcludeFromLimitGroups = "limitgroup, limitgroup2" }; var deadlineConfig = new DeadlineConfig(); Assert.Equal("limitgroup;limitgroup2", poolConfig.GetDeadlineExcludeFromLimitGroupsString(deadlineConfig)); }
public void EnvironmentLimitGroupsIsUsedWhenNoPoolLimitGroup() { var poolConfig = new PoolConfigurationModel { ExcludeFromLimitGroups = null }; var envDeadlineConfig = new DeadlineConfig { ExcludeFromLimitGroups = "environmentLimitGroup" }; Assert.Equal("environmentLimitGroup", poolConfig.GetDeadlineExcludeFromLimitGroupsString(envDeadlineConfig)); }
public void PoolLimitGroupsOverrideEnvironment() { var poolConfig = new PoolConfigurationModel { ExcludeFromLimitGroups = "limitgroup" }; var envDeadlineConfig = new DeadlineConfig { ExcludeFromLimitGroups = "environmentLimitGroup" }; Assert.Equal("limitgroup", poolConfig.GetDeadlineExcludeFromLimitGroupsString(envDeadlineConfig)); }
private void AppendDeadlineParamsToStartTask( PoolConfigurationModel poolConfiguration, RenderingEnvironment environment, StartTask startTask, DeadlineConfig deadlineConfig, InstallationPackage deadlinePackage, bool isWindows) { var commandLine = startTask.CommandLine; var resourceFiles = new List <ResourceFile>(startTask.ResourceFiles); if (deadlinePackage != null && !string.IsNullOrEmpty(deadlinePackage.Container)) { resourceFiles.Add(GetContainerResourceFile(deadlinePackage.Container, deadlinePackage.PackageName)); commandLine += GetParameterSet(isWindows, "installerPath", deadlinePackage.PackageName); } if (isWindows & environment.Domain != null && environment.Domain.JoinDomain) { commandLine += GetParameterSet(isWindows, "domainJoin"); commandLine += GetParameterSet(isWindows, "domainName", environment.Domain.DomainName); commandLine += GetParameterSet(isWindows, "domainJoinUserName", environment.Domain.DomainJoinUsername); if (!string.IsNullOrWhiteSpace(environment.Domain.DomainWorkerOuPath)) { commandLine += GetParameterSet(isWindows, "domainOuPath", environment.Domain.DomainWorkerOuPath); } } if (environment.KeyVaultServicePrincipal != null) { commandLine += GetParameterSet(isWindows, "tenantId", environment.KeyVaultServicePrincipal.TenantId.ToString()); commandLine += GetParameterSet(isWindows, "applicationId", environment.KeyVaultServicePrincipal.ApplicationId.ToString()); commandLine += GetParameterSet(isWindows, "keyVaultCertificateThumbprint", environment.KeyVaultServicePrincipal.Thumbprint); commandLine += GetParameterSet(isWindows, "keyVaultName", environment.KeyVault.Name); } var repoPath = isWindows ? deadlineConfig.WindowsRepositoryPath : deadlineConfig.LinuxRepositoryPath; if (!string.IsNullOrWhiteSpace(repoPath)) { commandLine += GetParameterSet(isWindows, "deadlineRepositoryPath", deadlineConfig.WindowsRepositoryPath); } if (!string.IsNullOrEmpty(deadlineConfig.RepositoryUser)) { commandLine += GetParameterSet(isWindows, "deadlineRepositoryUserName", deadlineConfig.RepositoryUser); } if (!string.IsNullOrEmpty(deadlineConfig.ServiceUser)) { commandLine += GetParameterSet(isWindows, "deadlineServiceUserName", deadlineConfig.ServiceUser); } else { // If the Deadline slave is running under the start task context (not a service) // then we don't want to wait for success as it will block after launching the // Deadline launcher to prevent it being killed. startTask.WaitForSuccess = false; } if (deadlineConfig.LicenseMode != null) { commandLine += GetParameterSet(isWindows, "deadlineLicenseMode", deadlineConfig.LicenseMode.ToString()); } if (!string.IsNullOrEmpty(deadlineConfig.DeadlineRegion)) { commandLine += GetParameterSet(isWindows, "deadlineRegion", deadlineConfig.DeadlineRegion); } if (!string.IsNullOrEmpty(deadlineConfig.LicenseServer)) { commandLine += GetParameterSet(isWindows, "deadlineLicenseServer", deadlineConfig.LicenseServer); } var pools = poolConfiguration.GetDeadlinePoolsString(); if (!string.IsNullOrEmpty(pools)) { commandLine += GetParameterSet(isWindows, "deadlinePools", pools); } var groups = poolConfiguration.GetDeadlineGroupsString(); if (!string.IsNullOrEmpty(groups)) { commandLine += GetParameterSet(isWindows, "deadlineGroups", groups); } var limitGroups = poolConfiguration.GetDeadlineExcludeFromLimitGroupsString(deadlineConfig); if (!string.IsNullOrWhiteSpace(limitGroups)) { commandLine += GetParameterSet(isWindows, "excludeFromLimitGroups", limitGroups); } commandLine += "; "; if (!isWindows) { commandLine += "wait"; } startTask.CommandLine = commandLine; startTask.ResourceFiles = resourceFiles; }