Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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.6.0" />
<PackageReference Include="Microsoft.Azure.Management.HDInsight" Version="6.0.0" />
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.1.0-preview.2" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,19 @@ public void TestCreateClusterWithKafkaRestProxy()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-CreateClusterWithKafkaRestProxy");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateClusterWithRelayOutoundAndPrivateLink()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-CreateClusterWithRelayOutoundAndPrivateLink");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateClusterWithCustomAmbariDatabase()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-CreateClusterWithCustomAmbariDatabase");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,82 @@ function Test-CreateClusterWithKafkaRestProxy{
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
}
}

<#
.SYNOPSIS
Test Create Azure HDInsight Cluster with Relay Outbound and Private Link
#>

function Test-CreateClusterWithRelayOutoundAndPrivateLink{

# Create some resources that will be used throughout test
try
{
# prepare parameter for creating parameter
$params= Prepare-ClusterCreateParameter -location "South Central US"

# Private Link requires vnet has firewall, this is difficult to create dynamically, just hardcode here
$vnetId="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/fakevnet"
$subnetName="default"

# create cluster
$cluster = New-AzHDInsightCluster -Location $params.location -ResourceGroupName $params.resourceGroupName `
-ClusterName $params.clusterName -ClusterSizeInNodes $params.clusterSizeInNodes -ClusterType $params.clusterType `
-StorageAccountResourceId $params.storageAccountResourceId -StorageAccountKey $params.storageAccountKey `
-HttpCredential $params.httpCredential -SshCredential $params.sshCredential `
-MinSupportedTlsVersion $params.minSupportedTlsVersion `
-VirtualNetworkId $vnetId -SubnetName $subnetName -Version 3.6 `
-ResourceProviderConnection Outbound -PrivateLink Enabled

Assert-AreEqual $cluster.NetworkProperties.ResourceProviderConnection Outbound
Assert-AreEqual $cluster.NetworkProperties.PrivateLink Enabled

}
finally
{
# Delete cluster and resource group
Remove-AzHDInsightCluster -ClusterName $cluster.Name
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
}
}

<#
.SYNOPSIS
Test Create Azure HDInsight Cluster with custom ambari database
#>

function Test-CreateClusterWithCustomAmbariDatabase{

# Create some resources that will be used throughout test
try
{
# prepare parameter for creating parameter
$params= Prepare-ClusterCreateParameter -location "South Central US"

# prepare custom ambari database
$databaseUserName="databaseuser"
$databasePassword="xxxxxxx"
$databasePassword=ConvertTo-SecureString $databasePassword -AsPlainText -Force
$sqlserverCredential=New-Object System.Management.Automation.PSCredential($databaseUserName, $databasePassword)
$sqlserver="yoursqlserver.database.windows.net"
$database="yourdatabase"
$config=New-AzHDInsightClusterConfig

# create cluster
$cluster = New-AzHDInsightCluster -Location $params.location -ResourceGroupName $params.resourceGroupName `
-ClusterName $params.clusterName -ClusterSizeInNodes $params.clusterSizeInNodes -ClusterType $params.clusterType `
-StorageAccountResourceId $params.storageAccountResourceId -StorageAccountKey $params.storageAccountKey `
-HttpCredential $params.httpCredential -SshCredential $params.sshCredential `
-MinSupportedTlsVersion $params.minSupportedTlsVersion `
-AmbariDatabase $config.AmbariDatabase

Assert-NotNull $cluster

}
finally
{
# Delete cluster and resource group
Remove-AzHDInsightCluster -ClusterName $cluster.Name
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
}
}
Loading