Skip to content

Commit feea512

Browse files
aim-for-betterZhenyu Zhou
andauthored
[HDInsight] Support Node Reboot feature (#12124)
* Add two cmdlets: 1. Get-AzHDInsightHost to Get the hosts of the cluster 2. Restart-AzHDInsightHost to restart the specific hosts of the cluster * Add online version and revert release notes in psd1 file * Add DefaultParameterSet and update help doc Co-authored-by: Zhenyu Zhou <[email protected]>
1 parent 206393b commit feea512

File tree

15 files changed

+4230
-4
lines changed

15 files changed

+4230
-4
lines changed

src/HDInsight/HDInsight.Test/HDInsight.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
15-
<PackageReference Include="Microsoft.Azure.Management.HDInsight" Version="5.3.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.HDInsight" Version="5.4.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
1717
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.0" />
1818
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 Microsoft.Azure.ServiceManagement.Common.Models;
16+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17+
using Xunit;
18+
using Xunit.Abstractions;
19+
20+
namespace Commands.HDInsight.Test.ScenarioTests
21+
{
22+
public class HDInsightHostTests : TestController
23+
{
24+
public XunitTracingInterceptor _logger;
25+
26+
public HDInsightHostTests(ITestOutputHelper output)
27+
{
28+
_logger = new XunitTracingInterceptor(output);
29+
XunitTracingInterceptor.AddToContext(_logger);
30+
}
31+
32+
[Fact]
33+
[Trait(Category.AcceptanceType, Category.CheckIn)]
34+
public void TestHostRelatedCommands()
35+
{
36+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-HostRelatedCommands");
37+
}
38+
}
39+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
<#
16+
.SYNOPSIS
17+
Test list and restart the hosts of Azure HDInsight Cluster
18+
#>
19+
20+
function Test-HostRelatedCommands{
21+
22+
# Create some resources that will be used throughout test
23+
try
24+
{
25+
# test create cluster
26+
$cluster = Create-Cluster -location "South Central US"
27+
Assert-NotNull $cluster
28+
29+
#test Get-AzHDInsightHost
30+
$result = Get-AzHDInsightHost -ClusterName $cluster.Name
31+
Assert-NotNull $result
32+
33+
#test Restart-AzHDInsightHost
34+
$workernode1= $result|Where-Object {$_.Name -like "wn1*"}
35+
$resizeCluster = $workernode1 | Restart-AzHDInsightHost -ClusterName $cluster.Name
36+
}
37+
finally
38+
{
39+
# Delete cluster and resource group
40+
Remove-AzHDInsightCluster -ClusterName $cluster.Name
41+
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
42+
}
43+
}

0 commit comments

Comments
 (0)