@@ -539,6 +539,7 @@ public void AzureDeploymentTest()
539
539
Assert . IsTrue ( File . Exists ( configPath3 . FullName ) , "file not exist={0}" , configPath3 ) ;
540
540
541
541
string deploymentName = "deployment1" ;
542
+ string deploymentName2 = "deployment2" ;
542
543
string deploymentLabel = "label1" ;
543
544
DeploymentInfoContext result ;
544
545
@@ -595,12 +596,12 @@ public void AzureDeploymentTest()
595
596
// Re-create the Staging depoyment with the extension
596
597
Utilities . RetryActionUntilSuccess ( ( ) =>
597
598
{
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 ) ;
600
601
601
602
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 ) ) ;
604
605
605
606
ExtensionContext extResult2 = vmPowershellCmdlets . GetAzureServiceExtension ( serviceName , DeploymentSlotType . Staging ) [ 0 ] ;
606
607
Utilities . PrintContext ( extResult2 ) ;
@@ -611,15 +612,18 @@ public void AzureDeploymentTest()
611
612
vmPowershellCmdlets . SetAzureDeploymentConfig ( serviceName , DeploymentSlotType . Staging , configPath2 . FullName , rdpExtCfg ) ;
612
613
} , "The server encountered an internal error. Please retry the request." , 10 , 30 ) ;
613
614
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 " ) ;
616
617
617
618
ExtensionContext extResult3 = vmPowershellCmdlets . GetAzureServiceExtension ( serviceName , DeploymentSlotType . Staging ) [ 0 ] ;
618
619
Utilities . PrintContext ( extResult3 ) ;
619
620
620
621
Assert . IsTrue ( ! string . Equals ( extResult2 . Id , extResult3 . Id ) ) ;
621
622
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'
623
627
Utilities . RetryActionUntilSuccess ( ( ) =>
624
628
{
625
629
vmPowershellCmdlets . SetAzureDeploymentStatus ( serviceName , DeploymentSlotType . Production , DeploymentStatus . Suspended ) ;
@@ -628,7 +632,7 @@ public void AzureDeploymentTest()
628
632
pass &= Utilities . PrintAndCompareDeployment ( result , serviceName , deploymentName , deploymentLabel , DeploymentSlotType . Production , DeploymentStatus . Suspended , 1 ) ;
629
633
Console . WriteLine ( "successfully changed the status" ) ;
630
634
631
- // Update the deployment
635
+ // Update the deployment #1
632
636
Utilities . RetryActionUntilSuccess ( ( ) =>
633
637
{
634
638
vmPowershellCmdlets . SetAzureDeploymentConfig ( serviceName , DeploymentSlotType . Production , configPath2 . FullName ) ;
@@ -637,7 +641,7 @@ public void AzureDeploymentTest()
637
641
pass &= Utilities . PrintAndCompareDeployment ( result , serviceName , deploymentName , deploymentLabel , DeploymentSlotType . Production , null , 2 ) ;
638
642
Console . WriteLine ( "successfully updated the deployment" ) ;
639
643
640
- // Upgrade the deployment
644
+ // Upgrade the deployment #1
641
645
DateTime start = DateTime . Now ;
642
646
Utilities . RetryActionUntilSuccess ( ( ) =>
643
647
{
0 commit comments