Skip to content

Commit bfc1490

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into vmss
Conflicts: src/ResourceManager/Compute/Commands.Compute.Test/packages.config src/ResourceManager/Compute/Commands.Compute/packages.config
2 parents 4a0f4a2 + 898f889 commit bfc1490

File tree

41 files changed

+6524
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+6524
-171
lines changed

src/ResourceManager/Common/Commands.ResourceManager.Common/RMProfileClient.cs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public AzureRMProfile Login(AzureAccount account, AzureEnvironment environment,
6161
// (tenant is not provided and subscription is not provided)
6262
else
6363
{
64-
foreach(var tenant in ListAccountTenants(account, environment, password, promptBehavior))
64+
foreach (var tenant in ListAccountTenants(account, environment, password, promptBehavior))
6565
{
6666
AzureTenant tempTenant;
6767
AzureSubscription tempSubscription;
6868
var token = AcquireAccessToken(account, environment, tenant.Id.ToString(), password,
6969
ShowDialog.Auto);
7070
if (newTenant == null && TryGetTenantSubscription(token, account, environment, tenant.Id.ToString(), subscriptionId, out tempSubscription, out tempTenant) &&
7171
newTenant == null)
72-
{
72+
{
7373
newTenant = tempTenant;
7474
newSubscription = tempSubscription;
7575
}
@@ -93,8 +93,8 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId)
9393
{
9494
_profile.Context = new AzureContext(
9595
_profile.Context.Subscription,
96-
_profile.Context.Account,
97-
_profile.Context.Environment,
96+
_profile.Context.Account,
97+
_profile.Context.Environment,
9898
new AzureTenant() { Id = new Guid(tenantId) });
9999

100100
if (_profile.Context.Account != null)
@@ -107,10 +107,17 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId)
107107
}
108108
}
109109

110-
if(!string.IsNullOrWhiteSpace(subscriptionId))
110+
if (!string.IsNullOrWhiteSpace(subscriptionId))
111111
{
112+
if (ListSubscriptions(_profile.Context.Tenant.Id.ToString()).FirstOrDefault(s =>
113+
String.Compare(s.Id.ToString(), subscriptionId, StringComparison.OrdinalIgnoreCase) == 0) == null)
114+
{
115+
throw new ArgumentException(string.Format(
116+
"Provided subscription {0} does not exist under current tenant {1}", subscriptionId, _profile.Context.Tenant.Id));
117+
}
118+
112119
var newSubscription = new AzureSubscription { Id = new Guid(subscriptionId) };
113-
if(_profile.Context.Subscription != null)
120+
if (_profile.Context.Subscription != null)
114121
{
115122
newSubscription.Account = _profile.Context.Subscription.Account;
116123
newSubscription.Environment = _profile.Context.Subscription.Environment;
@@ -121,7 +128,7 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId)
121128
_profile.Context = new AzureContext(
122129
newSubscription,
123130
_profile.Context.Account,
124-
_profile.Context.Environment,
131+
_profile.Context.Environment,
125132
_profile.Context.Tenant);
126133
}
127134

@@ -131,7 +138,7 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId)
131138
public List<AzureTenant> ListTenants(string tenant)
132139
{
133140
return ListAccountTenants(_profile.Context.Account, _profile.Context.Environment, null, ShowDialog.Auto)
134-
.Where(t => tenant == null ||
141+
.Where(t => tenant == null ||
135142
tenant.Equals(t.Id.ToString(), StringComparison.OrdinalIgnoreCase) ||
136143
tenant.Equals(t.Domain, StringComparison.OrdinalIgnoreCase))
137144
.ToList();
@@ -279,7 +286,7 @@ private bool TryGetTenantSubscription(IAccessToken accessToken,
279286
out AzureSubscription subscription,
280287
out AzureTenant tenant)
281288
{
282-
289+
283290
using (var subscriptionClient = AzureSession.ClientFactory.CreateCustomClient<SubscriptionClient>(
284291
new TokenCloudCredentials(accessToken.AccessToken),
285292
environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager)))
@@ -339,15 +346,15 @@ private bool TryGetTenantSubscription(IAccessToken accessToken,
339346

340347
private List<AzureTenant> ListAccountTenants(AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
341348
{
342-
var commonTenantToken = AcquireAccessToken( account, environment, AuthenticationFactory.CommonAdTenant,
349+
var commonTenantToken = AcquireAccessToken(account, environment, AuthenticationFactory.CommonAdTenant,
343350
password, promptBehavior);
344351

345352
using (var subscriptionClient = AzureSession.ClientFactory.CreateCustomClient<SubscriptionClient>(
346353
new TokenCloudCredentials(commonTenantToken.AccessToken),
347354
environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager)))
348355
{
349356
return subscriptionClient.Tenants.List().TenantIds
350-
.Select(ti => new AzureTenant() { Id = new Guid(ti.TenantId), Domain = commonTenantToken.GetDomain() } )
357+
.Select(ti => new AzureTenant() { Id = new Guid(ti.TenantId), Domain = commonTenantToken.GetDomain() })
351358
.ToList();
352359
}
353360
}
@@ -361,7 +368,7 @@ public IEnumerable<AzureTenant> ListTenants()
361368
return ListAccountTenants(_profile.Context.Account, _profile.Context.Environment, null, ShowDialog.Never);
362369
}
363370

364-
private IEnumerable<AzureSubscription> ListSubscriptionsForTenant(AzureAccount account, AzureEnvironment environment,
371+
private IEnumerable<AzureSubscription> ListSubscriptionsForTenant(AzureAccount account, AzureEnvironment environment,
365372
SecureString password, ShowDialog promptBehavior, string tenantId)
366373
{
367374
var accessToken = AcquireAccessToken(account, environment, tenantId, password, promptBehavior);

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Constants.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public class Category
7171
// Run Type
7272
public const string RunType = "RunType";
7373
public const string LiveOnly = "LiveOnly";
74-
public const string Manual = "Manual";
7574
//Uncomment when we need to tag on only run under mock
7675
//public const string MockedOnly = "MockedOnly";
7776

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
74-
<SpecificVersion>False</SpecificVersion>
75-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.10-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
74+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.11-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
75+
<Private>True</Private>
7676
</Reference>
7777
<Reference Include="Microsoft.Azure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7878
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>

src/ResourceManager/Compute/Commands.Compute.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
1010
<!--<package id="Microsoft.Azure.Management.Compute" version="9.0.4-preview" targetFramework="net45" />-->
11-
<package id="Microsoft.Azure.Management.Network" version="2.0.10-preview" targetFramework="net45" />
11+
<package id="Microsoft.Azure.Management.Network" version="2.0.11-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
1414
<package id="Microsoft.Azure.Test.Framework" version="1.0.5715.36130-prerelease" targetFramework="net45" />

src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
<Private>True</Private>
8686
</Reference>
8787
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
88-
<SpecificVersion>False</SpecificVersion>
89-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.10-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
88+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.11-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
89+
<Private>True</Private>
9090
</Reference>
9191
<Reference Include="Microsoft.Azure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9292
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>

src/ResourceManager/Compute/Commands.Compute/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
1212
<!--<package id="Microsoft.Azure.Management.Compute" version="9.0.4-preview" targetFramework="net45" />-->
13-
<package id="Microsoft.Azure.Management.Network" version="2.0.10-preview" targetFramework="net45" />
13+
<package id="Microsoft.Azure.Management.Network" version="2.0.11-preview" targetFramework="net45" />
1414
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
1515
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
1616
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="xunit.runner.console" version="2.0.0" />
4+
</packages>

src/ResourceManager/HDInsight/Commands.HDInsight.Test/packages.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
2020
<package id="Microsoft.Rest.ClientRuntime" version="1.2.0" targetFramework="net45" />
2121
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="0.9.3" targetFramework="net45" />
22+
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
2223
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
2324
<package id="xunit" version="1.9.2" targetFramework="net45" />
2425
<package id="xunit.extensions" version="1.9.2" targetFramework="net45" />
26+
<package id="xunit.runner.visualstudio" version="2.1.0-beta4-build1109" targetFramework="net45" />
2527
</packages>

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6868
</Reference>
6969
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70-
<SpecificVersion>False</SpecificVersion>
71-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.10-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
70+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.11-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
71+
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7474
<SpecificVersion>False</SpecificVersion>
@@ -299,6 +299,12 @@
299299
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.LoadBalancerTests\TestLoadBalancerSet.json">
300300
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
301301
</None>
302+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.LoadBalancerTests\TestLoadBalancerInboundNatPoolConfigCRUDPublicLB.json">
303+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
304+
</None>
305+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.LoadBalancerTests\TestLoadBalancerInboundNatPoolConfigInternalLB.json">
306+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
307+
</None>
302308
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkSecurityGroupTests\TestNetworkSecurityGroupCRUD.json">
303309
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
304310
</None>

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/LoadBalancerTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,19 @@ public void TestLoadBalancerNicAssociationDuringCreate()
102102
{
103103
NetworkResourcesController.NewInstance.RunPsTest("Test-LoadBalancer-NicAssociationDuringCreate");
104104
}
105+
106+
[Fact]
107+
[Trait(Category.AcceptanceType, Category.CheckIn)]
108+
public void TestLoadBalancerInboundNatPoolConfigInternalLB()
109+
{
110+
NetworkResourcesController.NewInstance.RunPsTest("Test-LoadBalancerInboundNatPoolConfigCRUD-InternalLB");
111+
}
112+
113+
[Fact]
114+
[Trait(Category.AcceptanceType, Category.CheckIn)]
115+
public void TestLoadBalancerInboundNatPoolConfigCRUDPublicLB()
116+
{
117+
NetworkResourcesController.NewInstance.RunPsTest("Test-LoadBalancerInboundNatPoolConfigCRUD-PublicLB");
118+
}
105119
}
106120
}

0 commit comments

Comments
 (0)