Skip to content

Commit 103f62f

Browse files
committed
Merge pull request Azure#242 from AzureRT/dev
Hot fix for New-AzureVM and Export-AzureVM
2 parents e2024b9 + d1f3853 commit 103f62f

File tree

9 files changed

+166
-86
lines changed

9 files changed

+166
-86
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ConfigDataInfo/SetAzureDataDiskConfig.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,20 @@ public SetAzureDataDiskConfig(HostCaching hostCaching, int lun)
3030

3131
public PersistentVM Vm { get; set; }
3232
}
33+
34+
public class SetAzureDataDiskResizeConfig
35+
{
36+
public string DiskName;
37+
38+
public int ResizedSizeInGB;
39+
public PersistentVM Vm { get; set; }
40+
41+
public SetAzureDataDiskResizeConfig(string diskName, int resize, PersistentVM vm)
42+
{
43+
this.DiskName = diskName;
44+
this.ResizedSizeInGB = resize;
45+
this.Vm = vm;
46+
}
47+
48+
}
3349
}

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
{

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,19 +285,22 @@ public void ValidateAvailableExtesnion(VirtualMachineExtensionImageContext exten
285285
Assert.IsFalse(string.IsNullOrEmpty(extension.Publisher));
286286
Assert.IsFalse(string.IsNullOrEmpty(extension.Version));
287287

288-
switch (extension.ExtensionName)
288+
if (! extension.IsJsonExtension)
289289
{
290-
case "DiagnosticsAgent":
291-
{
292-
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
293-
break;
294-
}
295-
case "VMAccessAgent":
296-
{
297-
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
298-
Assert.IsFalse(string.IsNullOrEmpty(extension.PrivateConfigurationSchema));
299-
break;
300-
}
290+
switch (extension.ExtensionName)
291+
{
292+
case "DiagnosticsAgent":
293+
{
294+
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
295+
break;
296+
}
297+
case "VMAccessAgent":
298+
{
299+
Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema));
300+
Assert.IsFalse(string.IsNullOrEmpty(extension.PrivateConfigurationSchema));
301+
break;
302+
}
303+
}
301304
}
302305
}
303306

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/SetAzureDataDiskCmdletInfo.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ public SetAzureDataDiskCmdletInfo(SetAzureDataDiskConfig discCfg)
2626
this.cmdletParams.Add(new CmdletParam("HostCaching", discCfg.hostCaching));
2727
this.cmdletParams.Add(new CmdletParam("LUN", discCfg.lun));
2828
this.cmdletParams.Add(new CmdletParam("VM", discCfg.Vm));
29+
}
2930

31+
public SetAzureDataDiskCmdletInfo(SetAzureDataDiskResizeConfig discCfg)
32+
{
33+
cmdletName = Utilities.SetAzureDataDiskCmdletName;
34+
35+
this.cmdletParams.Add(new CmdletParam("DiskName", discCfg.DiskName));
36+
this.cmdletParams.Add(new CmdletParam("ResizedSizeInGB", discCfg.ResizedSizeInGB));
37+
this.cmdletParams.Add(new CmdletParam("VM", discCfg.Vm));
3038
}
3139
}
3240
}

0 commit comments

Comments
 (0)