Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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