From cb1d10c62d67743d3e63c676e6d658cdb3174123 Mon Sep 17 00:00:00 2001 From: huangpf Date: Sat, 4 Apr 2015 04:42:43 -0700 Subject: [PATCH 1/4] update --- .../Commands.Compute.Test.csproj | 12 ++++++------ .../Commands.Compute.Test/packages.config | 10 +++++----- .../Commands.Compute/Commands.Compute.csproj | 19 +++++++------------ .../Compute/Commands.Compute/packages.config | 10 +++++----- 4 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj b/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj index 20e4b5a352c0..71ce20558d4c 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj +++ b/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj @@ -46,27 +46,27 @@ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll False - ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.17-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.18-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll ..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll False - ..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.6.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll + ..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.7.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll - ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.17.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll + ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.18.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.14.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5562.19686-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/packages.config b/src/ResourceManager/Compute/Commands.Compute.Test/packages.config index 3a12479f4fa4..f29c8cb02bca 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/packages.config +++ b/src/ResourceManager/Compute/Commands.Compute.Test/packages.config @@ -1,13 +1,13 @@  - - + + - - - + + + diff --git a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj index ade2c0701815..1de432194c33 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj +++ b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj @@ -52,33 +52,28 @@ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll False - ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.17-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.18-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll ..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll False - ..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.6.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll + ..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.7.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll - ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.17.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll + ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.18.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll True - - False - ..\..\..\lib\Microsoft.Azure.Management.Compute.dll - - - False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.14.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll False diff --git a/src/ResourceManager/Compute/Commands.Compute/packages.config b/src/ResourceManager/Compute/Commands.Compute/packages.config index fc8bde9bfcdc..ee5929793c10 100644 --- a/src/ResourceManager/Compute/Commands.Compute/packages.config +++ b/src/ResourceManager/Compute/Commands.Compute/packages.config @@ -1,13 +1,13 @@  - - + + - - - + + + From a99171cad88f92b4929a86b13222d849df7ba048 Mon Sep 17 00:00:00 2001 From: huangpf Date: Sat, 4 Apr 2015 04:52:31 -0700 Subject: [PATCH 2/4] update --- .../Compute/Commands.Compute/Commands.Compute.csproj | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj index 1de432194c33..4f5d84b5292b 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj +++ b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj @@ -119,11 +119,9 @@ - - ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.dll - - - ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll + + + ..\..\..\lib\Microsoft.Azure.Management.Compute.dll ..\..\..\lib\Microsoft.Azure.Management.Storage.dll From a8205c0f33c0cb56477552189d308773c62c0601 Mon Sep 17 00:00:00 2001 From: huangpf Date: Sat, 4 Apr 2015 05:00:51 -0700 Subject: [PATCH 3/4] update --- setup/azurecmdfiles.wxi | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index c1225cc3346a..09b4ca5c2c1d 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -91,12 +91,6 @@ - - - - - - @@ -483,9 +477,6 @@ - - - @@ -2610,9 +2601,6 @@ - - - @@ -2767,8 +2755,6 @@ - - @@ -2895,7 +2881,6 @@ - @@ -3580,7 +3565,6 @@ - From cafb979611568b64e9c58fd52947379d1dba6cc5 Mon Sep 17 00:00:00 2001 From: huangpf Date: Sat, 4 Apr 2015 06:05:42 -0700 Subject: [PATCH 4/4] update test --- src/AzurePowershell.sln | 1 + .../VirtualMachineExtensionTests.ps1 | 16 ++++++++-------- .../ScenarioTests/VirtualMachineTests.ps1 | 14 +++++++------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/AzurePowershell.sln b/src/AzurePowershell.sln index 594ce11b34b5..f0b010114125 100644 --- a/src/AzurePowershell.sln +++ b/src/AzurePowershell.sln @@ -183,6 +183,7 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Compute", "ResourceManager\Compute\Commands.Compute\Commands.Compute.csproj", "{52643BD5-6378-49BD-9F6E-DAC9DD8A867B}" ProjectSection(ProjectDependencies) = postProject {98CFD96B-A6BC-4F15-AE2C-603FC2B58981} = {98CFD96B-A6BC-4F15-AE2C-603FC2B58981} + {E1CA72BA-8374-45F6-904D-FD34ECDF5B6F} = {E1CA72BA-8374-45F6-904D-FD34ECDF5B6F} EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Compute.Test", "ResourceManager\Compute\Commands.Compute.Test\Commands.Compute.Test.csproj", "{37C44181-3F1B-4ABD-8089-26DFAB4B6BA8}" diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1 b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1 index 91481bc81b28..34dc5f71647a 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1 +++ b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1 @@ -34,14 +34,14 @@ function Test-VirtualMachineExtension Assert-AreEqual $p.HardwareProfile.VirtualMachineSize $vmsize; # NRP - $subnet = New-AzureVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24" -DnsServer "10.1.1.1"; + $subnet = New-AzureVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24"; $vnet = New-AzureVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $subnet; $vnet = Get-AzureVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname; - $subnetId = $vnet.Properties.Subnets[0].Id; + $subnetId = $vnet.Subnets[0].Id; $pubip = New-AzurePublicIpAddress -Force -Name ('pubip' + $rgname) -ResourceGroupName $rgname -Location $loc -AllocationMethod Dynamic -DomainNameLabel ('pubip' + $rgname); $pubip = Get-AzurePublicIpAddress -Name ('pubip' + $rgname) -ResourceGroupName $rgname; $pubipId = $pubip.Id; - $nic = New-AzureNetworkInterface -Force -Name ('nic' + $rgname) -ResourceGroupName $rgname -Location $loc -AllocationMethod Dynamic -SubnetId $subnetId -PublicIpAddressId $pubip.Id; + $nic = New-AzureNetworkInterface -Force -Name ('nic' + $rgname) -ResourceGroupName $rgname -Location $loc -SubnetId $subnetId -PublicIpAddressId $pubip.Id; $nic = Get-AzureNetworkInterface -Name ('nic' + $rgname) -ResourceGroupName $rgname; $nicId = $nic.Id; @@ -83,7 +83,7 @@ function Test-VirtualMachineExtension Assert-AreEqual $p.StorageProfile.DataDisks[1].Lun 1; Assert-AreEqual $p.StorageProfile.DataDisks[1].VirtualHardDisk.Uri $dataDiskVhdUri2; - # OS + # OS & Image $user = "Foo12"; $password = 'BaR@123' + $rgname; $securePassword = ConvertTo-SecureString $password -AsPlainText -Force; @@ -117,7 +117,7 @@ function Test-VirtualMachineExtension $settingstr = '{"fileUris":[],"commandToExecute":""}'; $protectedsettingstr = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}'; Set-AzureVMExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname -Name $extname -Publisher $publisher -Type $exttype -TypeHandlerVersion $extver -SettingString $settingstr -ProtectedSettingString $protectedsettingstr; - + # Get VM Extension $ext = Get-AzureVMExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname; Assert-AreEqual $ext.ResourceGroupName $rgname; @@ -127,7 +127,7 @@ function Test-VirtualMachineExtension Assert-AreEqual $ext.TypeHandlerVersion $extver; Assert-AreEqual $ext.ResourceGroupName $rgname; Assert-NotNull $ext.ProvisioningState; - + $ext = Get-AzureVMExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname -Status; Assert-AreEqual $ext.ResourceGroupName $rgname; Assert-AreEqual $ext.Name $extname; @@ -137,7 +137,7 @@ function Test-VirtualMachineExtension Assert-AreEqual $ext.ResourceGroupName $rgname; Assert-NotNull $ext.ProvisioningState; Assert-NotNull $ext.Statuses; - + # Set extension settings by hash table $settings = @{"fileUris" = "[]"; "commandToExecute" = ""}; $protectedsettings = @{"storageAccountName" = $stoname; "storageAccountKey" = $stokey}; @@ -152,7 +152,7 @@ function Test-VirtualMachineExtension Assert-AreEqual $ext.TypeHandlerVersion $extver; Assert-AreEqual $ext.ResourceGroupName $rgname; Assert-NotNull $ext.ProvisioningState; - + $ext = Get-AzureVMExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname -Status; Assert-AreEqual $ext.ResourceGroupName $rgname; Assert-AreEqual $ext.Name $extname; diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 index 1a7593b090b2..83fc3809803d 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 +++ b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 @@ -34,14 +34,14 @@ function Test-VirtualMachine Assert-AreEqual $p.HardwareProfile.VirtualMachineSize $vmsize; # NRP - $subnet = New-AzureVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24" -DnsServer "10.1.1.1"; + $subnet = New-AzureVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24"; $vnet = New-AzureVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $subnet; $vnet = Get-AzureVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname; - $subnetId = $vnet.Properties.Subnets[0].Id; + $subnetId = $vnet.Subnets[0].Id; $pubip = New-AzurePublicIpAddress -Force -Name ('pubip' + $rgname) -ResourceGroupName $rgname -Location $loc -AllocationMethod Dynamic -DomainNameLabel ('pubip' + $rgname); $pubip = Get-AzurePublicIpAddress -Name ('pubip' + $rgname) -ResourceGroupName $rgname; $pubipId = $pubip.Id; - $nic = New-AzureNetworkInterface -Force -Name ('nic' + $rgname) -ResourceGroupName $rgname -Location $loc -AllocationMethod Dynamic -SubnetId $subnetId -PublicIpAddressId $pubip.Id; + $nic = New-AzureNetworkInterface -Force -Name ('nic' + $rgname) -ResourceGroupName $rgname -Location $loc -SubnetId $subnetId -PublicIpAddressId $pubip.Id; $nic = Get-AzureNetworkInterface -Name ('nic' + $rgname) -ResourceGroupName $rgname; $nicId = $nic.Id; @@ -49,7 +49,7 @@ function Test-VirtualMachine Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 1; Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].ReferenceUri $nicId; - # Storage + # Storage Account (SA) $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; New-AzureStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype; @@ -90,11 +90,11 @@ function Test-VirtualMachine $computerName = 'test'; $vhdContainer = "https://$stoname.blob.core.windows.net/test"; $img = 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201410.01-en.us-127GB.vhd'; - + $p.StorageProfile.OSDisk = $null; $p = Set-AzureVMOperatingSystem -VM $p -Windows -ComputerName $computerName -Credential $cred; $p = Set-AzureVMSourceImage -VM $p -Name $img -DestinationVhdsContainer $vhdContainer; - + Assert-AreEqual $p.OSProfile.AdminUsername $user; Assert-AreEqual $p.OSProfile.ComputerName $computerName; Assert-AreEqual $p.OSProfile.AdminPassword $password; @@ -105,6 +105,7 @@ function Test-VirtualMachine # TODO: Still need to do retry for New-AzureVM for SA, even it's returned in Get-. New-AzureVM -ResourceGroupName $rgname -Location $loc -Name $vmname -VM $p; + # Get VM $vm1 = Get-AzureVM -Name $vmname -ResourceGroupName $rgname; Assert-AreEqual $vm1.Name $vmname; Assert-AreEqual $vm1.NetworkProfile.NetworkInterfaces.Count 1; @@ -168,7 +169,6 @@ function Test-VirtualMachine # Remove Remove-AzureVM -Name $vmname2 -ResourceGroupName $rgname -Force; - } finally {