From f00adbdb0ef5134bf4eeae645075e4c9caa185c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Mar 2015 20:27:37 -0800 Subject: [PATCH] Fix AzureDiskTest --- .../FunctionalTests/FunctionalTestCommonVhd.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTestCommonVhd.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTestCommonVhd.cs index 787149dd2393..2bcb31739f28 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTestCommonVhd.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTestCommonVhd.cs @@ -83,9 +83,11 @@ public void Initialize() public void AzureDiskTest() { StartTest(MethodBase.GetCurrentMethod().Name, testStartTime); - string blobName = "os0.vhd"; + vhdName = Utilities.GetUniqueShortName("os0vhd"); - string mediaLocation = String.Format("{0}{1}/{2}", blobUrlRoot, vhdContainerName, blobName); + CopyCommonVhd(vhdContainerName, "os0.vhd", vhdName); + + string mediaLocation = String.Format("{0}{1}/{2}", blobUrlRoot, vhdContainerName, vhdName); try { @@ -114,7 +116,7 @@ public void AzureDiskTest() Console.WriteLine("Disk Label is successfully updated"); // Update only size - int newSize = 250; + int newSize = 50; vmPowershellCmdlets.UpdateAzureDisk(vhdName, null, newSize); virtualDisk = vmPowershellCmdlets.GetAzureDisk(vhdName)[0]; @@ -126,7 +128,7 @@ public void AzureDiskTest() // Update both label and size newLabel = "NewLabel2"; - newSize = 300; + newSize = 100; vmPowershellCmdlets.UpdateAzureDisk(vhdName, newLabel, newSize); virtualDisk = vmPowershellCmdlets.GetAzureDisk(vhdName)[0]; @@ -136,7 +138,7 @@ public void AzureDiskTest() Assert.AreEqual(newSize, virtualDisk.DiskSizeInGB); Console.WriteLine("Both disk label and size are successfully updated"); - vmPowershellCmdlets.RemoveAzureDisk(vhdName, false); + vmPowershellCmdlets.RemoveAzureDisk(vhdName, true); Assert.IsTrue(Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDisk, vhdName), "The disk was not removed"); pass = true; } @@ -151,7 +153,7 @@ public void AzureDiskTest() try { - vmPowershellCmdlets.RemoveAzureDisk(vhdName, false); + vmPowershellCmdlets.RemoveAzureDisk(vhdName, true); } catch (Exception cleanupError) {