Skip to content

Commit b95afbb

Browse files
committed
Merge pull request #16 from hyonholee/dev
Fix AzureDiskTest
2 parents 870a8a4 + f00adbd commit b95afbb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ public void Initialize()
8383
public void AzureDiskTest()
8484
{
8585
StartTest(MethodBase.GetCurrentMethod().Name, testStartTime);
86-
string blobName = "os0.vhd";
86+
8787
vhdName = Utilities.GetUniqueShortName("os0vhd");
88-
string mediaLocation = String.Format("{0}{1}/{2}", blobUrlRoot, vhdContainerName, blobName);
88+
CopyCommonVhd(vhdContainerName, "os0.vhd", vhdName);
89+
90+
string mediaLocation = String.Format("{0}{1}/{2}", blobUrlRoot, vhdContainerName, vhdName);
8991

9092
try
9193
{
@@ -114,7 +116,7 @@ public void AzureDiskTest()
114116
Console.WriteLine("Disk Label is successfully updated");
115117

116118
// Update only size
117-
int newSize = 250;
119+
int newSize = 50;
118120
vmPowershellCmdlets.UpdateAzureDisk(vhdName, null, newSize);
119121

120122
virtualDisk = vmPowershellCmdlets.GetAzureDisk(vhdName)[0];
@@ -126,7 +128,7 @@ public void AzureDiskTest()
126128

127129
// Update both label and size
128130
newLabel = "NewLabel2";
129-
newSize = 300;
131+
newSize = 100;
130132
vmPowershellCmdlets.UpdateAzureDisk(vhdName, newLabel, newSize);
131133

132134
virtualDisk = vmPowershellCmdlets.GetAzureDisk(vhdName)[0];
@@ -136,7 +138,7 @@ public void AzureDiskTest()
136138
Assert.AreEqual(newSize, virtualDisk.DiskSizeInGB);
137139
Console.WriteLine("Both disk label and size are successfully updated");
138140

139-
vmPowershellCmdlets.RemoveAzureDisk(vhdName, false);
141+
vmPowershellCmdlets.RemoveAzureDisk(vhdName, true);
140142
Assert.IsTrue(Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDisk, vhdName), "The disk was not removed");
141143
pass = true;
142144
}
@@ -151,7 +153,7 @@ public void AzureDiskTest()
151153

152154
try
153155
{
154-
vmPowershellCmdlets.RemoveAzureDisk(vhdName, false);
156+
vmPowershellCmdlets.RemoveAzureDisk(vhdName, true);
155157
}
156158
catch (Exception cleanupError)
157159
{

0 commit comments

Comments
 (0)