Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion src/HDInsight/HDInsight.Test/HDInsight.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
<PackageReference Include="Microsoft.Azure.Management.HDInsight" Version="5.3.0" />
<PackageReference Include="Microsoft.Azure.Management.HDInsight" Version="5.4.0" />
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />
Expand Down
39 changes: 39 additions & 0 deletions src/HDInsight/HDInsight.Test/ScenarioTests/HDInsightHostTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// ----------------------------------------------------------------------------------
//
// 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 Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
using Xunit.Abstractions;

namespace Commands.HDInsight.Test.ScenarioTests
{
public class HDInsightHostTests : TestController
{
public XunitTracingInterceptor _logger;

public HDInsightHostTests(ITestOutputHelper output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestHostRelatedCommands()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-HostRelatedCommands");
}
}
}
43 changes: 43 additions & 0 deletions src/HDInsight/HDInsight.Test/ScenarioTests/HDInsightHostTests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# ----------------------------------------------------------------------------------
#
# 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.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Test list and restart the hosts of Azure HDInsight Cluster
#>

function Test-HostRelatedCommands{

# Create some resources that will be used throughout test
try
{
# test create cluster
$cluster = Create-Cluster -location "South Central US"
Assert-NotNull $cluster

#test Get-AzHDInsightHost
$result = Get-AzHDInsightHost -ClusterName $cluster.Name
Assert-NotNull $result

#test Restart-AzHDInsightHost
$workernode1= $result|Where-Object {$_.Name -like "wn1*"}
$resizeCluster = $workernode1 | Restart-AzHDInsightHost -ClusterName $cluster.Name
}
finally
{
# Delete cluster and resource group
Remove-AzHDInsightCluster -ClusterName $cluster.Name
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
}
}
Loading