From 9726a22e5b869443e17b42055ee9b76ddd75d3ba Mon Sep 17 00:00:00 2001 From: huangpf Date: Tue, 10 Feb 2015 15:26:24 -0800 Subject: [PATCH 1/3] fix addomain extension cmdlets --- .../FunctionalTests/ScenarioTest.cs | 93 ++ .../BaseAzureServiceADDomainExtension.cs | 4 +- .../NewAzureServiceADDomainExtensionConfig.cs | 2 + .../SetAzureServiceADDomainExtension.cs | 2 + ...re.Commands.ServiceManagement.dll-Help.xml | 817 ++++++++++++------ 5 files changed, 637 insertions(+), 281 deletions(-) diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs index 970c46469ae6..7acfced194a3 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs @@ -22,6 +22,7 @@ using System.Net; using System.Net.Cache; using System.Reflection; +using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading; using System.Xml; @@ -1059,6 +1060,98 @@ public void AzureServiceDiagnosticsExtensionTest() #endregion + + [TestMethod(), TestCategory(Category.Scenario), TestProperty("Feature", "PAAS"), Priority(1), Owner("huangpf"), Description("Test the ADDomain cmdlets.")] + [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\Resources\\package.csv", "package#csv", DataAccessMethod.Sequential)] + public void AzureServiceADDomainExtensionTest() + { + StartTest(MethodBase.GetCurrentMethod().Name, testStartTime); + + // Choose the package and config files from local machine + string packageName = Convert.ToString(TestContext.DataRow["upgradePackage"]); + string configName = Convert.ToString(TestContext.DataRow["upgradeConfig"]); + var packagePath1 = new FileInfo(Directory.GetCurrentDirectory() + "\\" + packageName); + var configPath1 = new FileInfo(Directory.GetCurrentDirectory() + "\\" + configName); + + Assert.IsTrue(File.Exists(packagePath1.FullName), "VHD file not exist={0}", packagePath1); + Assert.IsTrue(File.Exists(configPath1.FullName), "VHD file not exist={0}", configPath1); + + string deploymentName = "deployment1"; + string deploymentLabel = "label1"; + DeploymentInfoContext result; + + PSCredential cred = new PSCredential(username, Utilities.convertToSecureString(password)); + + try + { + serviceName = Utilities.GetUniqueShortName(serviceNamePrefix); + vmPowershellCmdlets.NewAzureService(serviceName, serviceName, locationName); + Console.WriteLine("service, {0}, is created.", serviceName); + + // Workgroup Config + var workGroupName = "test"; + ExtensionConfigurationInput config = vmPowershellCmdlets.NewAzureServiceDomainJoinExtensionConfig( + workGroupName, null, null, false, null, null, null); + + vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath1.FullName, configPath1.FullName, DeploymentSlotType.Production, deploymentLabel, deploymentName, false, false, config); + + result = vmPowershellCmdlets.GetAzureDeployment(serviceName, DeploymentSlotType.Production); + pass = Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName, deploymentLabel, DeploymentSlotType.Production, null, 2); + Console.WriteLine("successfully deployed the package"); + + var resultContext = vmPowershellCmdlets.GetAzureServiceDomainJoinExtension(serviceName); + Assert.IsTrue(string.IsNullOrEmpty(resultContext.User)); + Assert.IsTrue(resultContext.Name == workGroupName); + Assert.IsTrue(resultContext.Restart == false); + + vmPowershellCmdlets.RemoveAzureServiceDomainJoinExtension(serviceName, DeploymentSlotType.Production); + + // Join a Workgroup + vmPowershellCmdlets.SetAzureServiceDomainJoinExtension( + workGroupName, serviceName, DeploymentSlotType.Production, null, null, false, null, null, "1.*"); + resultContext = vmPowershellCmdlets.GetAzureServiceDomainJoinExtension(serviceName); + Assert.IsTrue(string.IsNullOrEmpty(resultContext.User)); + Assert.IsTrue(resultContext.Name == workGroupName); + Assert.IsTrue(resultContext.Restart == false); + Assert.IsTrue(resultContext.Version == "1.*"); + + // Domain Config + var domainName = "test.bing.com"; + config = vmPowershellCmdlets.NewAzureServiceDomainJoinExtensionConfig( + domainName, null, null, null, null, null, 35, true, cred, "1.*"); + Assert.IsTrue(config.Roles.Any(r => r.Default)); + Assert.IsTrue(config.PublicConfiguration.Contains(cred.UserName)); + Assert.IsTrue(config.PublicConfiguration.Contains(domainName)); + Assert.IsTrue(config.PublicConfiguration.Contains("35")); + + vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath1.FullName, configPath1.FullName, DeploymentSlotType.Staging, deploymentLabel, deploymentName, false, false, config); + + vmPowershellCmdlets.RemoveAzureServiceDomainJoinExtension(serviceName, DeploymentSlotType.Staging); + + // Join a Domain + vmPowershellCmdlets.SetAzureServiceDomainJoinExtension( + domainName, cred, 35, false, serviceName, DeploymentSlotType.Staging, null, (X509Certificate2)null, null, (PSCredential)null, null, "1.*"); + + resultContext = vmPowershellCmdlets.GetAzureServiceDomainJoinExtension(serviceName); + Assert.IsTrue(resultContext.User == cred.UserName); + Assert.IsTrue(resultContext.Name == domainName); + Assert.IsTrue(resultContext.JoinOption == 35); + Assert.IsTrue(resultContext.Restart == false); + Assert.IsTrue(resultContext.Version == "1.*"); + + vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Production, true); + vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Staging, true); + + pass &= Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDeployment, serviceName, DeploymentSlotType.Production); + pass &= Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDeployment, serviceName, DeploymentSlotType.Staging); + } + catch (Exception e) + { + pass = false; + Assert.Fail("Exception occurred: {0}", e.ToString()); + } + } + #region AzureServiceRemoteDesktopExtension Tests [TestMethod(), TestCategory(Category.Scenario), TestProperty("Feature", "PAAS"), Priority(1), Owner("hylee"), Description("Test the cmdlet (New-AzureServiceRemoteDesktopConfig)")] diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/BaseAzureServiceADDomainExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/BaseAzureServiceADDomainExtension.cs index a61d658be8ab..9c96884777b5 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/BaseAzureServiceADDomainExtension.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/BaseAzureServiceADDomainExtension.cs @@ -181,6 +181,8 @@ public virtual PSCredential UnjoinDomainCredential public BaseAzureServiceADDomainExtensionCmdlet() : base() { + PrivateConfig.Password = string.Empty; + PrivateConfig.UnjoinDomainPassword = string.Empty; } protected override void ValidateParameters() @@ -188,8 +190,6 @@ protected override void ValidateParameters() base.ValidateParameters(); ProviderNamespace = DomainExtensionNamespace; ExtensionName = DomainExtensionType; - PrivateConfig.Password = string.Empty; - PrivateConfig.UnjoinDomainPassword = string.Empty; } protected override void ValidateConfiguration() diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/NewAzureServiceADDomainExtensionConfig.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/NewAzureServiceADDomainExtensionConfig.cs index 7fa8112302d8..a3ce321e5eea 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/NewAzureServiceADDomainExtensionConfig.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/NewAzureServiceADDomainExtensionConfig.cs @@ -187,6 +187,8 @@ public override string OUPath [Parameter(Position = 9, ValueFromPipelineByPropertyName = true, ParameterSetName = DomainThumbprintParameterSet)] [Parameter(Position = 9, ValueFromPipelineByPropertyName = true, ParameterSetName = DomainJoinOptionParameterSet)] [Parameter(Position = 9, ValueFromPipelineByPropertyName = true, ParameterSetName = DomainJoinOptionThumbprintParameterSet)] + [Parameter(Position = 6, ValueFromPipelineByPropertyName = true, ParameterSetName = WorkgroupParameterSet)] + [Parameter(Position = 6, ValueFromPipelineByPropertyName = true, ParameterSetName = WorkgroupThumbprintParameterSet)] [ValidateNotNullOrEmpty] public override string Version { diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/SetAzureServiceADDomainExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/SetAzureServiceADDomainExtension.cs index 9308b75c07fb..84e31ad1140b 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/SetAzureServiceADDomainExtension.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/ADDomain/SetAzureServiceADDomainExtension.cs @@ -204,6 +204,8 @@ public override string OUPath [Parameter(Position = 12, ValueFromPipelineByPropertyName = true, ParameterSetName = DomainThumbprintParameterSet)] [Parameter(Position = 12, ValueFromPipelineByPropertyName = true, ParameterSetName = DomainJoinOptionParameterSet)] [Parameter(Position = 12, ValueFromPipelineByPropertyName = true, ParameterSetName = DomainJoinOptionThumbprintParameterSet)] + [Parameter(Position = 8, ValueFromPipelineByPropertyName = true, ParameterSetName = WorkgroupParameterSet)] + [Parameter(Position = 8, ValueFromPipelineByPropertyName = true, ParameterSetName = WorkgroupThumbprintParameterSet)] [ValidateNotNullOrEmpty] public override string Version { diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml index 409f7107d0b0..9222bf65ffeb 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml @@ -2875,285 +2875,544 @@ New-AzureVMConfig -Name "MyNonDomainVM" -InstanceSize Small -ImageName - - - - Add-AzureVMImage - - The Add-AzureVMImage cmdlet adds a new operating system (OS) image to the image repository. The image should be a sysprep'd or generalized OS image. - - - - - Add - AzureVMImage - - - - - - - - - Add-AzureVMImage - - ImageName - - Specifies the name of the image being added to the image repository. - - String - - - MediaLocation - - Specifies the location of the physical blob page where the image resides. This is a link to a blob page in the current subscription's storage. - - String - - - OS - - Specifies the operating system version of the image. - - String - - - Label - - Specifies a label to give the image. - - String - - - Eula - - Specifies the End User License Aggreement, recommended value is a URL. - - String - - - Description - - Specifies the description of the OS image. - - String - - - ImageFamily - - Specifies a value that can be used to group OS images. - - String - - - PublishedDate - - Specifies the date when the OS image was added to the image repository. - - Nullable`1[DateTime] - - - PrivacyUri - - Specifies the URI that points to a document that contains the privacy policy related to the OS image. - - Uri - - - RecommendedVMSize - - Specifies the size to use for the virtual machine that is created from the OS image. Values are: "Medium", "Large", and "ExtraLarge", "A5", "A6",, "A7". - - String - - - - - - ImageName - - Specifies the name of the image being added to the image repository. - - String - - String - - - - - - MediaLocation - - Specifies the location of the physical blob page where the image resides. This is a link to a blob page in the current subscription's storage. - - String - - String - - - - - - OS - - Specifies the operating system version of the image. - - String - - String - - - - - - Label - - Specifies a label to give the image. - - String - - String - - - - - - Eula - - Specifies the End User License Aggreement, recommended value is a URL. - - String - - String - - - - - - Description - - Specifies the description of the OS image. - - String - - String - - - - - - ImageFamily - - Specifies a value that can be used to group OS images. - - String - - String - - - - - - PublishedDate - - Specifies the date when the OS image was added to the image repository. - - Nullable`1[DateTime] - - Nullable`1[DateTime] - - - - - - PrivacyUri - - Specifies the URI that points to a document that contains the privacy policy related to the OS image. - - Uri - - Uri - - - - - - RecommendedVMSize - - Specifies the size to use for the virtual machine that is created from the OS image. Values are: "Medium", "Large", and "ExtraLarge", "A5", "A6",, "A7". - - String - - String - - - - - - - - - - - - - - - - - - - - - OSImageContext - - - - - - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - - - - PS C:\> Add-AzureVMImage -ImageName imageName -MediaLocation http://yourstorageaccount.blob.core.azure.com/container/sampleImage.vhd -Label imageLabel - - Description - - - - -----------This example adds a new operating system image in the repository - - - - - - - Get-AzureVMImage - - - - Remove-AzureVMImage - - - - Update-AzureVMImage - - - - + + + + + Add-AzureVMImage + + + The Add-AzureVMImage cmdlet adds a new operating system (OS) image or a new VM Image to the image repository. The image should be a sysprep'd or generalized image. + + + + + Add + AzureVMImage + + + + + + + + + Add-AzureVMImage + + ImageName + + Specifies the name of the image being added to the image repository. + + string + + + MediaLocation + + Specifies the location of the physical blob page where the image resides. This is a link to a blob page in the current subscription's storage. + + string + + + Label + + Specifies a label to give the image. + + string + + + Eula + + Specifies the End User License Aggreement, recommended value is a URL. + + string + + + Description + + Specifies the description of the OS image. + + string + + + ImageFamily + + Specifies a value that can be used to group OS images. + + string + + + PublishedDate + + + + System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] + + + PrivacyUri + + Specifies the URI that points to a document that contains the privacy policy related to the OS image. + + Uri + + + RecommendedVMSize + + Specifies the size to use for the virtual machine that is created from the OS image. Values are: "Medium", "Large", and "ExtraLarge", "A5", "A6",, "A7". + + string + + + IconName + + Not Specified + + string + + + SmallIconName + + Not Specified + + string + + + ShowInGui + + Not Specified + + + + PipelineVariable + + Not Specified + + string + + + + Add-AzureVMImage + + ImageName + + Specifies the name of the image being added to the image repository. + + string + + + DiskConfig + + Not Specified + + VirtualMachineImageDiskConfigSet + + + OS + + Specifies the operating system version of the image. + + string + + + Label + + Specifies a label to give the image. + + string + + + Eula + + Specifies the End User License Aggreement, recommended value is a URL. + + string + + + Description + + Specifies the description of the OS image. + + string + + + ImageFamily + + Specifies a value that can be used to group OS images. + + string + + + PublishedDate + + + + System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] + + + PrivacyUri + + Specifies the URI that points to a document that contains the privacy policy related to the OS image. + + Uri + + + RecommendedVMSize + + Specifies the size to use for the virtual machine that is created from the OS image. Values are: "Medium", "Large", and "ExtraLarge", "A5", "A6",, "A7". + + string + + + IconName + + Not Specified + + string + + + SmallIconName + + Not Specified + + string + + + ShowInGui + + Not Specified + + + + PipelineVariable + + Not Specified + + string + + + + + + + Description + + Specifies the description of the OS image. + + + string + + string + + + + + + DiskConfig + + Not Specified + + + VirtualMachineImageDiskConfigSet + + VirtualMachineImageDiskConfigSet + + + + + + Eula + + Specifies the End User License Aggreement, recommended value is a URL. + + + string + + string + + + + + + IconName + + Not Specified + + + string + + string + + + + + + ImageFamily + + Specifies a value that can be used to group OS images. + + + string + + string + + + + + + ImageName + + Specifies the name of the image being added to the image repository. + + + string + + string + + + + + + Label + + Specifies a label to give the image. + + + string + + string + + + + + + MediaLocation + + Specifies the location of the physical blob page where the image resides. This is a link to a blob page in the current subscription's storage. + + + string + + string + + + + + + OS + + Specifies the operating system version of the image. + + + string + + string + + + + + + PipelineVariable + + Not Specified + + + string + + string + + + + + + PrivacyUri + + Specifies the URI that points to a document that contains the privacy policy related to the OS image. + + + Uri + + Uri + + + + + + PublishedDate + + + + + System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] + + System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] + + + + + + RecommendedVMSize + + Specifies the size to use for the virtual machine that is created from the OS image. Values are: "Medium", "Large", and "ExtraLarge", "A5", "A6",, "A7". + + + string + + string + + + + + + ShowInGui + + Not Specified + + + SwitchParameter + + SwitchParameter + + + + + + SmallIconName + + Not Specified + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + OSImageContext + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + + + C:\PS> + + + $s = New-AzureVMImageDiskConfigSet + + Set-AzureVMImageOSDiskConfig -DiskConfig $s -HostCaching ReadWrite -OSState 'Generalized' -OS 'Windows' -MediaLink $link + # A Uri link to the vhd in your storage account + + Set-AzureVMImageDataDiskConfig -DiskConfig $s -DataDiskName test1 -HostCaching ReadWrite -Lun 0 -MediaLink $link1 + + Set-AzureVMImageDataDiskConfig -DiskConfig $s -DataDiskName test4 -HostCaching ReadWrite -Lun 0 -MediaLink $link + + Remove-AzureVMImageDataDiskConfig -DiskConfig $s -DataDiskName test4 + + $imgname = 'testCREATEvmimage2'; + + Add-AzureVMImage -ImageName $imgname -Label test1 -Description test1 -DiskConfig $s -Eula 'http://www.test.com' -ImageFamily Windows -PublishedDate (Get-Date) -PrivacyUri 'http://www.test.com' -RecommendedVMSize Small -IconName test1 -SmallIconName test2 -ShowInGui + + + Description + ----------- + + Adds a VM Image to image repository + + + + + + + + + + + + + + + + -------------------------- EXAMPLE 2 -------------------------- + + + C:\PS> + + + + + Description + ----------- + + + + + + + + + + + + + + + + + + + + + + + From 836e3c59df78f63701ae7ebf6d4d12e47abc6309 Mon Sep 17 00:00:00 2001 From: huangpf Date: Tue, 10 Feb 2015 16:17:49 -0800 Subject: [PATCH 2/3] fix test --- .../FunctionalTests/ScenarioTest.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs index 7acfced194a3..8e969c32092e 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs @@ -1115,6 +1115,8 @@ public void AzureServiceADDomainExtensionTest() Assert.IsTrue(resultContext.Restart == false); Assert.IsTrue(resultContext.Version == "1.*"); + vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Production, true); + // Domain Config var domainName = "test.bing.com"; config = vmPowershellCmdlets.NewAzureServiceDomainJoinExtensionConfig( @@ -1124,9 +1126,9 @@ public void AzureServiceADDomainExtensionTest() Assert.IsTrue(config.PublicConfiguration.Contains(domainName)); Assert.IsTrue(config.PublicConfiguration.Contains("35")); - vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath1.FullName, configPath1.FullName, DeploymentSlotType.Staging, deploymentLabel, deploymentName, false, false, config); + vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath1.FullName, configPath1.FullName, DeploymentSlotType.Production, deploymentLabel, deploymentName, false, false, config); - vmPowershellCmdlets.RemoveAzureServiceDomainJoinExtension(serviceName, DeploymentSlotType.Staging); + vmPowershellCmdlets.RemoveAzureServiceDomainJoinExtension(serviceName, DeploymentSlotType.Production); // Join a Domain vmPowershellCmdlets.SetAzureServiceDomainJoinExtension( @@ -1140,10 +1142,8 @@ public void AzureServiceADDomainExtensionTest() Assert.IsTrue(resultContext.Version == "1.*"); vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Production, true); - vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Staging, true); pass &= Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDeployment, serviceName, DeploymentSlotType.Production); - pass &= Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDeployment, serviceName, DeploymentSlotType.Staging); } catch (Exception e) { From d15673b51100c48b40916a024f450322b79eae3f Mon Sep 17 00:00:00 2001 From: huangpf Date: Tue, 10 Feb 2015 16:17:49 -0800 Subject: [PATCH 3/3] fix test --- .../FunctionalTests/ScenarioTest.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs index 7acfced194a3..78114f61c852 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs @@ -1115,6 +1115,8 @@ public void AzureServiceADDomainExtensionTest() Assert.IsTrue(resultContext.Restart == false); Assert.IsTrue(resultContext.Version == "1.*"); + vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Production, true); + // Domain Config var domainName = "test.bing.com"; config = vmPowershellCmdlets.NewAzureServiceDomainJoinExtensionConfig( @@ -1124,13 +1126,13 @@ public void AzureServiceADDomainExtensionTest() Assert.IsTrue(config.PublicConfiguration.Contains(domainName)); Assert.IsTrue(config.PublicConfiguration.Contains("35")); - vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath1.FullName, configPath1.FullName, DeploymentSlotType.Staging, deploymentLabel, deploymentName, false, false, config); + vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath1.FullName, configPath1.FullName, DeploymentSlotType.Production, deploymentLabel, deploymentName, false, false, config); - vmPowershellCmdlets.RemoveAzureServiceDomainJoinExtension(serviceName, DeploymentSlotType.Staging); + vmPowershellCmdlets.RemoveAzureServiceDomainJoinExtension(serviceName, DeploymentSlotType.Production); // Join a Domain vmPowershellCmdlets.SetAzureServiceDomainJoinExtension( - domainName, cred, 35, false, serviceName, DeploymentSlotType.Staging, null, (X509Certificate2)null, null, (PSCredential)null, null, "1.*"); + domainName, cred, 35, false, serviceName, DeploymentSlotType.Production, null, (X509Certificate2)null, null, (PSCredential)null, null, "1.*"); resultContext = vmPowershellCmdlets.GetAzureServiceDomainJoinExtension(serviceName); Assert.IsTrue(resultContext.User == cred.UserName); @@ -1140,10 +1142,8 @@ public void AzureServiceADDomainExtensionTest() Assert.IsTrue(resultContext.Version == "1.*"); vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Production, true); - vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Staging, true); pass &= Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDeployment, serviceName, DeploymentSlotType.Production); - pass &= Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDeployment, serviceName, DeploymentSlotType.Staging); } catch (Exception e) {