Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
safeermohammed committed May 21, 2015
2 parents d46e6e2 + 621ea0b commit 053621e
Show file tree
Hide file tree
Showing 357 changed files with 21,761 additions and 5,989 deletions.
154 changes: 146 additions & 8 deletions setup/azurecmdfiles.wxi

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions src/AzurePowershell.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -210,6 +210,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ApiManagement", "R
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ApiManagement.Test", "ResourceManager\ApiManagement\Commands.ApiManagement.Test\Commands.ApiManagement.Test.csproj", "{BEC9ECE9-A3D6-4B24-A682-1FA890647D9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Management.Storage", "ResourceManager\Storage\Commands.Management.Storage\Commands.Management.Storage.csproj", "{A50AB133-5C04-4A17-9054-F8343683EC23}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Management.Storage.Test", "ResourceManager\Storage\Commands.Management.Storage.Test\Commands.Management.Storage.Test.csproj", "{7D1D3B56-4EB4-4819-86FD-43330DED8EE7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -512,12 +516,19 @@ Global
{BEC9ECE9-A3D6-4B24-A682-1FA890647D9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEC9ECE9-A3D6-4B24-A682-1FA890647D9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEC9ECE9-A3D6-4B24-A682-1FA890647D9D}.Release|Any CPU.Build.0 = Release|Any CPU
{A50AB133-5C04-4A17-9054-F8343683EC23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A50AB133-5C04-4A17-9054-F8343683EC23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A50AB133-5C04-4A17-9054-F8343683EC23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A50AB133-5C04-4A17-9054-F8343683EC23}.Release|Any CPU.Build.0 = Release|Any CPU
{7D1D3B56-4EB4-4819-86FD-43330DED8EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D1D3B56-4EB4-4819-86FD-43330DED8EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D1D3B56-4EB4-4819-86FD-43330DED8EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D1D3B56-4EB4-4819-86FD-43330DED8EE7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{37455286-D8A7-4E0C-8B4D-C517D20C641A} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{D6F470A6-7395-4B8B-9D29-44DF0EC8F624} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{A3965B66-5A3E-4B8C-9574-28E5958D4828} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
Expand All @@ -528,6 +539,7 @@ Global
{4BC0E3D3-6EDD-43AA-8F15-DCFED8ACC93D} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{9D5A40CA-5594-4F5C-8230-7ADF7CC0558E} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{3B48A77B-5956-4A62-9081-92BA04B02B27} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{4C2FE49A-09E1-4979-AD46-CD64FD04C8F7} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
Expand All @@ -553,5 +565,6 @@ Global
{5764A3A4-586C-4536-8481-13007CAC111B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{59D1B5DC-9175-43EC-90C6-CBA601B3565F} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{BEC9ECE9-A3D6-4B24-A682-1FA890647D9D} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{7D1D3B56-4EB4-4819-86FD-43330DED8EE7} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.25-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.26-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common.Storage/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.25-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.26-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.25-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.26-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.25-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.26-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5562.19686-prerelease" targetFramework="net45" />
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common/Commands.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.25-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.26-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<SpecificVersion>False</SpecificVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.25-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.26-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Profile/Commands.Profile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.25-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.26-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Profile/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.25-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.26-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand Down
9 changes: 6 additions & 3 deletions src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.25-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.26-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
Expand Down Expand Up @@ -203,6 +203,9 @@
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationSuspendAndResumeJob.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AzureVMTests\TestGetAzureVM.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.SchedulerTests\TestSchedulerEndToEnd.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -284,10 +287,10 @@
<Compile Include="Resources\ResourceLocator.cs" />
<Compile Include="Scheduler\SchedulerTests.cs" />
<Compile Include="ServiceBusTests\ServiceBusAuthorizationRuleTests.cs" />
<Compile Include="ServiceManagement\GetVMTests.cs" />
<Compile Include="StorageTests\StorageContainerTest.cs" />
<Compile Include="StorageTests\StorageContextTest.cs" />
<Compile Include="StoreTests\StoreTests.cs" />
<Compile Include="ServiceManagement\VMProvisionScenarioTests.cs" />
<Compile Include="TrafficManagerTests\TrafficManagerTests.cs" />
<Compile Include="WAPackIaaS\CloudService\CmdletTestCloudServiceBase.cs" />
<Compile Include="WAPackIaaS\CloudService\GetWAPackCloudServiceTests.cs" />
Expand Down Expand Up @@ -408,7 +411,7 @@
<None Include="Resources\CloudService\Cache\mc.tgz">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\ServiceManagement\VMProvisionTests.ps1">
<None Include="Resources\ServiceManagement\AzureVMTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\ServiceManagement\Common.ps1">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.WindowsAzure.Commands.ScenarioTest.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Test;
using Xunit;
using Microsoft.Azure.Common.Authentication;

namespace Microsoft.WindowsAzure.Commands.ScenarioTest
{
public class ResourceManagerTests
{
private EnvironmentSetupHelper helper = new EnvironmentSetupHelper();

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.AcceptanceType, Category.BVT)]
[Trait(Category.Service, Category.ResourceManager)]
public void TestResourceManagerEndToEnd()
{
this.RunPowerShellTest("Test-ResourceManager");
}

protected void SetupManagementClients()
{
helper.SetupSomeOfManagementClients();
}

protected void RunPowerShellTest(params string[] scripts)
{
using (UndoContext context = UndoContext.Current)
{
context.Start(TestUtilities.GetCallingClass(1), TestUtilities.GetCurrentMethodName(2));

SetupManagementClients();

List<string> modules = Directory.GetFiles("Resources\\ResourceManager", "*.ps1").ToList();
modules.Add("Common.ps1");
modules.Add(@"..\..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureResourceManager.psd1");

helper.SetupEnvironment(AzureModule.AzureResourceManager);
helper.SetupModules(modules.ToArray());

helper.RunPowerShellTest(scripts);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,30 @@
.SYNOPSIS
Tests Create-AzureVM with valid information.
#>
function Test-CreateWindowsAzureQuickVM
function Test-GetAzureVM
{
# Setup

$location = Get-DefaultLocation
$imgName = Get-DefaultImage $location


$storageName = getAssetName
New-AzureStorageAccount -StorageAccountName $storageName -Location $location

Set-CurrentStorageAccountName $storageName

$vmName = "vm1"
$svcName = Get-CloudServiceName

# Test
New-AzureQuickVM -Windows -ImageName $imageName -Name $newAzureQuickVMName -ServiceName $newAzureQuickVMSvcName -Password "p@ssw0rd" -Location $location
}
New-AzureService -ServiceName $svcName -Location $location
New-AzureQuickVM -Windows -ImageName $imgName -Name $vmName -ServiceName $svcName -AdminUsername "pstestuser" -Password "p@ssw0rd"

Get-AzureVM -ServiceName $svcName -Name $vmName


# Cleanup
Cleanup-CloudService $svcName
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,79 @@
# limitations under the License.
# ----------------------------------------------------------------------------------


<#
.SYNOPSIS
Sets
Sets the default storage account
#>
function Set-CurrentStorageAccountName
{
Get-AzureSubscription -Default | Set-AzureSubscription -CurrentStorageAccountName ""
}
param([string] $storageAccountName)
$currentSubscription = Get-AzureSubscription -Current

Set-AzureSubscription -SubscriptionId $currentSubscription.SubscriptionId -CurrentStorageAccountName $storageAccountName
}

<#
.SYNOPSIS
Gets the default location
#>
function Get-DefaultLocation
{
return (Get-AzureLocation)[0].Name
}

<#
.SYNOPSIS
Gets the default image
#>
function Get-DefaultImage
{
param([string] $loc)
return (Get-AzureVMImage | where {$_.OS -eq "Windows"} | where {$_.Location.Contains($loc)})[0].ImageName
}


<#
.SYNOPSIS
Gets valid and available cloud service name.
#>
function Get-CloudServiceName
{
return getAssetName
}

<#
.SYNOPSIS
Cleanup cloud service
#>
function Cleanup-CloudService
{
param([string] $name)
try
{
Remove-AzureService -ServiceName $name -Force
}
catch
{
Write-Warning "Cannot Remove the Cloud Service"
}
}

<#
.SYNOPSIS
Cleanup storage
#>
function Cleanup-Storage
{
param([string] $name)
Remove-AzureStorageAccount -StorageAccountName $name
try
{
Remove-AzureStorageAccount -StorageAccountName $name
}
catch
{
Write-Warning "Cannot Remove the Storage Account"
}
}
Loading

0 comments on commit 053621e

Please sign in to comment.