Skip to content

Commit

Permalink
Merge pull request #16 from hyonholee/dev
Browse files Browse the repository at this point in the history
Fix AzureDiskTest
  • Loading branch information
AzureRT committed Mar 4, 2015
2 parents 870a8a4 + f00adbd commit b95afbb
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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];
Expand All @@ -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];
Expand All @@ -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;
}
Expand All @@ -151,7 +153,7 @@ public void AzureDiskTest()

try
{
vmPowershellCmdlets.RemoveAzureDisk(vhdName, false);
vmPowershellCmdlets.RemoveAzureDisk(vhdName, true);
}
catch (Exception cleanupError)
{
Expand Down

0 comments on commit b95afbb

Please sign in to comment.