Skip to content

Commit 893887b

Browse files
committed
2 parents 6df2bce + ef5a076 commit 893887b

File tree

16 files changed

+218
-18
lines changed

16 files changed

+218
-18
lines changed

setup/azurecmdfiles.wxi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@
500500
</Component>
501501
</Directory>
502502
<Directory Id="dir75F2C4F350248207C418DE5A1C651FB6" Name="AzureRM.Cdn">
503-
<Component Id="cmpD18084727DDF26BDFCE36BE4EF3E3FBC" Guid="*">
504-
<File Id="fil94E16717A827E81C325C0FF864D01FFC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Cdn\AzureRm.Cdn.psd1" />
503+
<Component Id="cmpB7108FC1E0DA3A2DABE2F5A549025C62" Guid="*">
504+
<File Id="filB74B1CDF4E2C5B548CAC901E51955AA5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Cdn\AzureRM.Cdn.psd1" />
505505
</Component>
506506
<Component Id="cmp87DFE6BA28632B552074C8A05968ED49" Guid="*">
507507
<File Id="filB29D13A0412832DF84301430FAF5C2EB" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Cdn\AzureRM.Tags.psd1" />
@@ -5064,7 +5064,7 @@
50645064
<ComponentRef Id="cmp8E6B2CBC9EF2E6C9012C5090F2932C68" />
50655065
<ComponentRef Id="cmp30F0EC1B207C0F4C59F81099974C18E3" />
50665066
<ComponentRef Id="cmp22BC5873E0018F5801CD486C6CBCE0C5" />
5067-
<ComponentRef Id="cmpD18084727DDF26BDFCE36BE4EF3E3FBC" />
5067+
<ComponentRef Id="cmpB7108FC1E0DA3A2DABE2F5A549025C62" />
50685068
<ComponentRef Id="cmp87DFE6BA28632B552074C8A05968ED49" />
50695069
<ComponentRef Id="cmpFCC54BA077C7C12B0A49F42DD3039435" />
50705070
<ComponentRef Id="cmp984FE30B4A873A5B1BC8F7E85B1CEF85" />
File renamed without changes.

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/TestController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void RunPsTestWorkflow(
135135
"ScenarioTests\\" + callingClassName + ".ps1",
136136
_helper.RMProfileModule,
137137
_helper.RMResourceModule,
138-
@"AzureRm.Cdn.psd1");
138+
@"AzureRM.Cdn.psd1");
139139

140140
try
141141
{
-5.21 KB
Binary file not shown.

src/ResourceManager/Cdn/Commands.Cdn/Commands.Cdn.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@
168168
</ProjectReference>
169169
</ItemGroup>
170170
<ItemGroup>
171-
<None Include="AzureRm.Cdn.psd1">
171+
<None Include="..\AzureRM.Cdn.psd1">
172+
<Link>AzureRM.Cdn.psd1</Link>
172173
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
173174
</None>
174175
<None Include="Microsoft.Azure.Commands.Cdn.dll-help.psd1" />

src/ResourceManager/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</Reference>
5353
<Reference Include="Microsoft.Azure.Management.HDInsight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5454
<SpecificVersion>False</SpecificVersion>
55-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.10-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
55+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.12-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
5656
</Reference>
5757
<Reference Include="Microsoft.Azure.Management.HDInsight.Job">
5858
<SpecificVersion>False</SpecificVersion>
@@ -163,6 +163,7 @@
163163
</ItemGroup>
164164
<ItemGroup>
165165
<Compile Include="HDInsightTestBase.cs" />
166+
<Compile Include="UnitTests\PremiumClusterTests.cs" />
166167
<Compile Include="UnitTests\ScriptActionTests.cs" />
167168
<None Include="ScenarioTests\HDInsightConfigurationTests.ps1">
168169
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/ResourceManager/HDInsight/Commands.HDInsight.Test/ScenarioTests/HDInsightConfigurationTests.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
Tests pipelining with creating the config
1919
#>
2020
function Test-ConfigurationPipelining{
21-
#test New-AzureRmHDInsightClusterConfig
22-
$config = New-AzureRmHDInsightClusterConfig -ClusterType Hadoop
21+
#test New-AzureRmHDInsightClusterConfig
22+
$config = New-AzureRmHDInsightClusterConfig -ClusterType Hadoop -ClusterTier Standard
2323
Assert-NotNull $config.ClusterType
24+
Assert-NotNull $config.ClusterTier
2425

2526
#test Add-AzureRmHDInsightStorage
2627
Assert-AreEqual $config.AdditionalStorageAccounts.Count 0
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System.Collections.Generic;
16+
using System.Management.Automation;
17+
using Microsoft.Azure.Commands.HDInsight.Models;
18+
using Microsoft.Azure.Management.HDInsight.Models;
19+
using Microsoft.WindowsAzure.Commands.Common;
20+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
21+
using Moq;
22+
using Newtonsoft.Json;
23+
using Xunit;
24+
25+
namespace Microsoft.Azure.Commands.HDInsight.Test
26+
{
27+
public class PremiumClusterTests : HDInsightTestBase
28+
{
29+
private NewAzureHDInsightClusterCommand cmdlet;
30+
private const string StorageName = "PlaceStorageName";
31+
private const string StorageKey = "PlaceStorageKey";
32+
private const int ClusterSize = 4;
33+
34+
private readonly PSCredential _httpCred;
35+
36+
public PremiumClusterTests()
37+
{
38+
base.SetupTestsForManagement();
39+
_httpCred = new PSCredential("hadoopuser", string.Format("Password1!").ConvertToSecureString());
40+
cmdlet = new NewAzureHDInsightClusterCommand
41+
{
42+
CommandRuntime = commandRuntimeMock.Object,
43+
HDInsightManagementClient = hdinsightManagementMock.Object
44+
};
45+
}
46+
47+
[Fact]
48+
[Trait(Category.AcceptanceType, Category.CheckIn)]
49+
public void CanCreateNewPremiumHDInsightCluster()
50+
{
51+
cmdlet.ClusterName = ClusterName;
52+
cmdlet.ResourceGroupName = ResourceGroupName;
53+
cmdlet.ClusterSizeInNodes = ClusterSize;
54+
cmdlet.Location = Location;
55+
cmdlet.HttpCredential = _httpCred;
56+
cmdlet.DefaultStorageAccountName = StorageName;
57+
cmdlet.DefaultStorageAccountKey = StorageKey;
58+
cmdlet.ClusterType = ClusterType;
59+
cmdlet.OSType = OSType.Linux;
60+
cmdlet.ClusterTier = Tier.Premium;
61+
cmdlet.SshCredential = _httpCred;
62+
var cluster = new Cluster
63+
{
64+
Id = "id",
65+
Name = ClusterName,
66+
Location = Location,
67+
Properties = new ClusterGetProperties
68+
{
69+
ClusterVersion = "3.2",
70+
ClusterState = "Running",
71+
ClusterDefinition = new ClusterDefinition
72+
{
73+
ClusterType = ClusterType
74+
},
75+
QuotaInfo = new QuotaInfo
76+
{
77+
CoresUsed = 24
78+
},
79+
OperatingSystemType = OSType.Linux,
80+
ClusterTier = Tier.Premium
81+
}
82+
};
83+
var coreConfigs = new Dictionary<string, string>
84+
{
85+
{"fs.defaultFS", "wasb://giyertestcsmv2@" + StorageName},
86+
{
87+
"fs.azure.account.key." + StorageName,
88+
StorageKey
89+
}
90+
};
91+
var gatewayConfigs = new Dictionary<string, string>
92+
{
93+
{"restAuthCredential.isEnabled", "true"},
94+
{"restAuthCredential.username", _httpCred.UserName},
95+
{"restAuthCredential.password", _httpCred.Password.ConvertToString()}
96+
};
97+
98+
var configurations = new Dictionary<string, Dictionary<string, string>>
99+
{
100+
{"core-site", coreConfigs},
101+
{"gateway", gatewayConfigs}
102+
};
103+
var serializedConfig = JsonConvert.SerializeObject(configurations);
104+
cluster.Properties.ClusterDefinition.Configurations = serializedConfig;
105+
106+
var getresponse = new ClusterGetResponse {Cluster = cluster};
107+
108+
hdinsightManagementMock.Setup(c => c.CreateNewCluster(ResourceGroupName, ClusterName, It.Is<ClusterCreateParameters>(
109+
parameters =>
110+
parameters.ClusterSizeInNodes == ClusterSize &&
111+
parameters.DefaultStorageAccountName == StorageName &&
112+
parameters.DefaultStorageAccountKey == StorageKey &&
113+
parameters.Location == Location &&
114+
parameters.UserName == _httpCred.UserName &&
115+
parameters.Password == _httpCred.Password.ConvertToString() &&
116+
parameters.SshUserName == _httpCred.UserName &&
117+
parameters.SshPassword == _httpCred.Password.ConvertToString() &&
118+
parameters.ClusterType == ClusterType &&
119+
parameters.OSType == OSType.Linux &&
120+
parameters.ClusterTier == Tier.Premium)))
121+
.Returns(getresponse)
122+
.Verifiable();
123+
124+
cmdlet.ExecuteCmdlet();
125+
126+
commandRuntimeMock.VerifyAll();
127+
commandRuntimeMock.Verify(f => f.WriteObject(It.Is<AzureHDInsightCluster>(
128+
clusterout =>
129+
clusterout.ClusterState == "Running" &&
130+
clusterout.ClusterType == ClusterType &&
131+
clusterout.ClusterVersion == "3.2" &&
132+
clusterout.CoresUsed == 24 &&
133+
clusterout.Location == Location &&
134+
clusterout.Name == ClusterName &&
135+
clusterout.OperatingSystemType == OSType.Linux &&
136+
clusterout.ClusterTier == Tier.Premium)),
137+
Times.Once);
138+
}
139+
}
140+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Authorization" version="0.18.2-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.10-preview" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.12-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.HDInsight.Job" version="2.0.0-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Resources" version="2.19.0-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />

src/ResourceManager/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
</Reference>
124124
<Reference Include="Microsoft.Azure.Management.HDInsight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
125125
<SpecificVersion>False</SpecificVersion>
126-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.10-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
126+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.12-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
127127
</Reference>
128128
<Reference Include="Microsoft.Azure.Management.HDInsight.Job">
129129
<SpecificVersion>False</SpecificVersion>

0 commit comments

Comments
 (0)