Skip to content

Commit 11a93ef

Browse files
committed
fix test by using diff. dep. name
1 parent 1b3a72a commit 11a93ef

File tree

1 file changed

+13
-9
lines changed
  • src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests

1 file changed

+13
-9
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ public void AzureDeploymentTest()
539539
Assert.IsTrue(File.Exists(configPath3.FullName), "file not exist={0}", configPath3);
540540

541541
string deploymentName = "deployment1";
542+
string deploymentName2 = "deployment2";
542543
string deploymentLabel = "label1";
543544
DeploymentInfoContext result;
544545

@@ -595,12 +596,12 @@ public void AzureDeploymentTest()
595596
// Re-create the Staging depoyment with the extension
596597
Utilities.RetryActionUntilSuccess(() =>
597598
{
598-
vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath1.FullName, configPath1.FullName, DeploymentSlotType.Staging, deploymentLabel, deploymentName, false, false, rdpExtCfg);
599-
}, "already exists under service", 10, 60);
599+
vmPowershellCmdlets.NewAzureDeployment(serviceName, packagePath2.FullName, configPath2.FullName, DeploymentSlotType.Staging, deploymentLabel, deploymentName2, false, false, rdpExtCfg);
600+
}, "Windows Azure is currently performing an operation on this hosted service that requires exclusive access.", 10, 60);
600601

601602
result = vmPowershellCmdlets.GetAzureDeployment(serviceName, DeploymentSlotType.Staging);
602-
pass = Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName, deploymentLabel, DeploymentSlotType.Staging, null, 1);
603-
Console.WriteLine(string.Format("Successfully re-deployed the package to the {0} slot.", DeploymentSlotType.Staging));
603+
pass = Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName2, deploymentLabel, DeploymentSlotType.Staging, null, 2);
604+
Console.WriteLine(string.Format("Successfully re-deployed the package #2 to the {0} slot.", DeploymentSlotType.Staging));
604605

605606
ExtensionContext extResult2 = vmPowershellCmdlets.GetAzureServiceExtension(serviceName, DeploymentSlotType.Staging)[0];
606607
Utilities.PrintContext(extResult2);
@@ -611,15 +612,18 @@ public void AzureDeploymentTest()
611612
vmPowershellCmdlets.SetAzureDeploymentConfig(serviceName, DeploymentSlotType.Staging, configPath2.FullName, rdpExtCfg);
612613
}, "The server encountered an internal error. Please retry the request.", 10, 30);
613614
result = vmPowershellCmdlets.GetAzureDeployment(serviceName, DeploymentSlotType.Staging);
614-
pass &= Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName, deploymentLabel, DeploymentSlotType.Staging, null, 2);
615-
Console.WriteLine("successfully updated the deployment");
615+
pass &= Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName2, deploymentLabel, DeploymentSlotType.Staging, null, 2);
616+
Console.WriteLine("successfully updated the deployment #2");
616617

617618
ExtensionContext extResult3 = vmPowershellCmdlets.GetAzureServiceExtension(serviceName, DeploymentSlotType.Staging)[0];
618619
Utilities.PrintContext(extResult3);
619620

620621
Assert.IsTrue(!string.Equals(extResult2.Id, extResult3.Id));
621622

622-
// Set the deployment status to 'Suspended'
623+
// Remove the deployment #2
624+
vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Staging, true);
625+
626+
// Set the deployment #1 status to 'Suspended'
623627
Utilities.RetryActionUntilSuccess(() =>
624628
{
625629
vmPowershellCmdlets.SetAzureDeploymentStatus(serviceName, DeploymentSlotType.Production, DeploymentStatus.Suspended);
@@ -628,7 +632,7 @@ public void AzureDeploymentTest()
628632
pass &= Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName, deploymentLabel, DeploymentSlotType.Production, DeploymentStatus.Suspended, 1);
629633
Console.WriteLine("successfully changed the status");
630634

631-
// Update the deployment
635+
// Update the deployment #1
632636
Utilities.RetryActionUntilSuccess(() =>
633637
{
634638
vmPowershellCmdlets.SetAzureDeploymentConfig(serviceName, DeploymentSlotType.Production, configPath2.FullName);
@@ -637,7 +641,7 @@ public void AzureDeploymentTest()
637641
pass &= Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName, deploymentLabel, DeploymentSlotType.Production, null, 2);
638642
Console.WriteLine("successfully updated the deployment");
639643

640-
// Upgrade the deployment
644+
// Upgrade the deployment #1
641645
DateTime start = DateTime.Now;
642646
Utilities.RetryActionUntilSuccess(() =>
643647
{

0 commit comments

Comments
 (0)