Skip to content

Common Code Version of Compute Management Library (Issue #5512) #5709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Mar 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
b7cccfe
Common Code Version of Compute Management Library (Issue #5512)
vladimir-shcherbakov Mar 9, 2018
fdfcacf
CI build fix
vladimir-shcherbakov Mar 9, 2018
91ab984
proj files moved from Compute soulution to Profile.
vladimir-shcherbakov Mar 9, 2018
6bf4e57
jenkins build fix.
vladimir-shcherbakov Mar 10, 2018
f93ffbd
Merge remote-tracking branch 'upstream/preview' into iss#5512
vladimir-shcherbakov Mar 10, 2018
60b64cb
Microsoft.Azure.Commands.Common.Compute project ref added to Commands…
vladimir-shcherbakov Mar 12, 2018
5e3309a
Examples of the disabled passwords removed from the documentation hea…
vladimir-shcherbakov Mar 13, 2018
0d20a38
Merge remote-tracking branch 'upstream/preview' into iss#5512
vladimir-shcherbakov Mar 13, 2018
7b18865
Commands.Common.Compute project added to every solution referencing P…
vladimir-shcherbakov Mar 14, 2018
fd04b6d
[Trait(Category.RunType, Category.LiveOnly)] added
vladimir-shcherbakov Mar 14, 2018
4c885dc
Commands.ScenarioTests.Common proj referenced to get Category.RunType.
vladimir-shcherbakov Mar 15, 2018
62fd1f7
sign job related stuff added.
vladimir-shcherbakov Mar 21, 2018
4caf066
another try to make sign job pass.
vladimir-shcherbakov Mar 21, 2018
8bdbcb4
Commands.Common.Compute.proj added to ResourceManager/Compute/Stack/C…
vladimir-shcherbakov Mar 22, 2018
88bac37
Commands.Common.Compute.proj added to src/ResourceManager/Network/Sta…
vladimir-shcherbakov Mar 22, 2018
5fcf1fe
Commands.Common.Compute.proj added to
vladimir-shcherbakov Mar 23, 2018
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
28 changes: 15 additions & 13 deletions Azure.PowerShell.Netcore.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Authentication.Netcore", "src\Common\Commands.Common.Authentication\Common.Authentication.Netcore.csproj", "{D12674F6-CB92-438F-A68D-21CE12F8611B}"
EndProject
Expand Down Expand Up @@ -53,6 +53,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Strategies.Netcore",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Common.Tests", "src\Common\Commands.Common.Tests\Commands.Common.Tests.csproj", "{B0EF35E9-2D7A-4AAE-8A1A-728B6CC8524B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Common.Compute.Netcore", "src\Common\Commands.Common.Compute\Commands.Common.Compute.Netcore.csproj", "{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}"
EndProject
Global
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cormacpayne
It's not deleted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladimir-shcherbakov Commands.Common.Compute.Netcore is being added, but Commands.Compute.Netcore appears to be being removed

GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -207,18 +209,6 @@ Global
{AF50ACE6-9A6A-4A18-8140-B6C5BDD0EFD6}.Release|x64.Build.0 = Release|Any CPU
{AF50ACE6-9A6A-4A18-8140-B6C5BDD0EFD6}.Release|x86.ActiveCfg = Release|Any CPU
{AF50ACE6-9A6A-4A18-8140-B6C5BDD0EFD6}.Release|x86.Build.0 = Release|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Debug|x64.ActiveCfg = Debug|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Debug|x64.Build.0 = Debug|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Debug|x86.ActiveCfg = Debug|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Debug|x86.Build.0 = Debug|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Release|Any CPU.Build.0 = Release|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Release|x64.ActiveCfg = Release|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Release|x64.Build.0 = Release|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Release|x86.ActiveCfg = Release|Any CPU
{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}.Release|x86.Build.0 = Release|Any CPU
{40ACDC82-5A87-4D52-83B5-ED21274363A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40ACDC82-5A87-4D52-83B5-ED21274363A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40ACDC82-5A87-4D52-83B5-ED21274363A5}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -351,6 +341,18 @@ Global
{B0EF35E9-2D7A-4AAE-8A1A-728B6CC8524B}.Release|x64.Build.0 = Release|Any CPU
{B0EF35E9-2D7A-4AAE-8A1A-728B6CC8524B}.Release|x86.ActiveCfg = Release|Any CPU
{B0EF35E9-2D7A-4AAE-8A1A-728B6CC8524B}.Release|x86.Build.0 = Release|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Debug|x64.ActiveCfg = Debug|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Debug|x64.Build.0 = Debug|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Debug|x86.ActiveCfg = Debug|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Debug|x86.Build.0 = Debug|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Release|Any CPU.Build.0 = Release|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Release|x64.ActiveCfg = Release|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Release|x64.Build.0 = Release|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Release|x86.ActiveCfg = Release|Any CPU
{5E5D1F8E-92C8-40EB-AABA-DFD12AFD6D0A}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go in the profile tests project - if it does not, you will need to create a lot of test infrastructure to make this execute like the other tests.

<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.core.2.3.1\build\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.3.1\build\xunit.core.props')" />
<Import Project="..\..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8A4E00AA-5F65-4A95-B9B0-FEC06486555E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Azure.Commands.Common.Compute.Tests</RootNamespace>
<AssemblyName>Microsoft.Azure.Commands.Common.Compute.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.2.3.9\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="xunit.abstractions">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.3.1.3858, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.3.1.3858, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop">
<HintPath>..\..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CredentialManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Version2016-04-preview\ComputeManagementClientShould.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Commands.Common.Compute\Commands.Common.Compute.csproj">
<Project>{f6d508d1-be2d-475d-aa0f-dfb5c615cc9d}</Project>
<Name>Commands.Common.Compute</Name>
</ProjectReference>
<ProjectReference Include="..\Commands.ScenarioTests.Common\Commands.ScenarioTests.Common.csproj">
<Project>{C1BDA476-A5CC-4394-914D-48B0EC31A710}</Project>
<Name>Commands.ScenarioTests.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\xunit.analyzers.0.7.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\xunit.core.2.3.1\build\xunit.core.targets" Condition="Exists('..\..\packages\xunit.core.2.3.1\build\xunit.core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\xunit.core.2.3.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.3.1\build\xunit.core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
87 changes: 87 additions & 0 deletions src/Common/Commands.Common.Compute.Tests/CredentialManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.Common.Compute.Tests
{
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.Rest;

class CredentialManager
{
protected CredentialManager() { }

private const string ServicePrincipalEnvVariableName = "AZURE_SERVICE_PRINCIPAL";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a test infrastructure that does this -this will make it essentially impossible to run these tests on ci without setting up this environment variable everywhere. Let's dicuss thet best way to bring these tests inline.


private static readonly string UserId = "UserId".ToLower();
private static readonly string Password = "Password".ToLower();
private static readonly string AadTenant = "AADTenant".ToLower();
private static readonly string Subscription = "SubscriptionId".ToLower();
private const string AuthUrl = "https://login.microsoftonline.com/";
private const string BaseUrl = "https://management.azure.com/";

public string ApplicationId { get; private set; }
public string ApplicationSecret { get; private set; }
public string TenantId { get; private set; }
public string SubscriptionId { get; private set; }

public TokenCredentials TokenCredentials
{
get
{
var clientCredential = new ClientCredential(ApplicationId, ApplicationSecret);
var context = new AuthenticationContext(Path.Combine(AuthUrl, TenantId));
var result = context.AcquireTokenAsync(BaseUrl, clientCredential);

if (result == null) throw new InvalidOperationException("Failed to obtain the token");

return new TokenCredentials(result.Result.AccessToken);
}
}

public static CredentialManager FromServicePrincipalEnvVariable(string envVariableName = ServicePrincipalEnvVariableName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should likely remove this file.

{
//AZURE_SERVICE_PRINCIPAL = UserId =< UserGuid >; Password =< Password >; AADTenant =< TenantGuid >; SubscriptionId =< SubscriptionId >
var spString = Environment.GetEnvironmentVariable(envVariableName);

if (spString == null) throw new ArgumentNullException($"Failed to get environment variable {envVariableName}");

var sp = new Dictionary<string, string>();
var pairs = spString.Trim().Split(';');
foreach (var pair in pairs)
{
var keyVal = pair.Trim().Split(new[] { '=' }, 2);
if (keyVal.Length < 2) throw new ArgumentException($"Failed to parse {envVariableName}");
sp.Add(keyVal[0].Trim().ToLower(), keyVal[1].Trim());
}

if (!sp.ContainsKey(UserId.ToLower())) throw new ArgumentException($"Failed to find {UserId} in {envVariableName}");
if (!sp.ContainsKey(Password.ToLower())) throw new ArgumentException($"Failed to find {Password} in {envVariableName}");
if (!sp.ContainsKey(AadTenant.ToLower())) throw new ArgumentException($"Failed to find {AadTenant} in {envVariableName}");
if (!sp.ContainsKey(Subscription.ToLower())) throw new ArgumentException($"Failed to find {Subscription} in {envVariableName}");

var credentialManager = new CredentialManager
{
ApplicationId = sp[UserId],
ApplicationSecret = sp[Password],
TenantId = sp[AadTenant],
SubscriptionId = sp[Subscription]
};

return credentialManager;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Commands.Common.Compute.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("Commands.Common.Compute.Tests")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8a4e00aa-5f65-4a95-b9b0-fec06486555e")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------



namespace Microsoft.Azure.Commands.Common.Compute.Tests
{
using Compute.Version2016_04_preview;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
using System.Linq;

namespace Version2016_04_preview
{
public class ComputeManagementClientShould
{
private IComputeManagementClient Client {get;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all need to be check-in tests. Let's discuss what to do with this per the above.


public ComputeManagementClientShould()
{
var credManager = CredentialManager.FromServicePrincipalEnvVariable();
Client = new ComputeManagementClient(credManager.TokenCredentials)
{
SubscriptionId = credManager.SubscriptionId
};
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void ListVirtualMachine()
{
var vmClient = Client.VirtualMachines;
var vms = vmClient.ListAll().ToList();
Assert.True(vms.Count > 0);
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void ListVirtualMachineSizes()
{
var vmSizeClient = Client.VirtualMachineSizes;
var vmSizes = vmSizeClient.List("WestUs").ToList();
Assert.True(vmSizes.Count > 0);
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void ListVirtualMachineImagePublishers()
{
var vmImagesClient = Client.VirtualMachineImages;
var vmImagePublisers = vmImagesClient.ListPublishers("WestUs").ToList();
Assert.True(vmImagePublisers.Count > 0);
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
public void ListDisks()
{
var disksClient = Client.Disks;
var disks = disksClient.List().ToList();
Assert.True(disks.Count > 0);
}
}
}
}
11 changes: 11 additions & 0 deletions src/Common/Commands.Common.Compute.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.3" targetFramework="net452" />
<package id="xunit" version="2.3.1" targetFramework="net452" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net452" />
<package id="xunit.analyzers" version="0.7.0" targetFramework="net452" />
<package id="xunit.assert" version="2.3.1" targetFramework="net452" />
<package id="xunit.core" version="2.3.1" targetFramework="net452" />
<package id="xunit.extensibility.core" version="2.3.1" targetFramework="net452" />
<package id="xunit.extensibility.execution" version="2.3.1" targetFramework="net452" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>Microsoft.Azure.Commands.Common.Compute</AssemblyName>
<RootNamespace>Microsoft.Azure.Commands.Common.Compute</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\ResourceManager\Common\Commands.ResourceManager.Common\Common.ResourceManager.Netcore.csproj" />
</ItemGroup>

</Project>
Loading