Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK changes to support ADLS as option for default storage #2484

Merged
merged 8 commits into from
Nov 16, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Compile Include="ScenarioTests\ListClusterTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScenarioTests\ScriptActionsOnRunningCluster.cs" />
<Compile Include="UnitTests\ClusterCreateTests.cs" />
<Compile Include="UnitTests\StorageAccountTests.cs" />
<Compile Include="UnitTests\MetastoreTests.cs" />
</ItemGroup>
Expand All @@ -30,15 +31,9 @@
<None Include="SessionRecords\HDInsight.Tests.CreateClusterTests\TestAdJoinedIaasCreateGetDeleteCluster.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\HDInsight.Tests.CreateClusterTests\TestCreateDefaultFsAzureBlobClusterContainerNotSpecified.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\HDInsight.Tests.CreateClusterTests\TestCreateDuplicateCluster.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\HDInsight.Tests.CreateClusterTests\TestCreateDefaultFsAzureBlobClusterUsingClusterParameters.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\HDInsight.Tests.CreateClusterTests\TestCreateHumboldtClusterWithCustomVMSizes.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -137,6 +132,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>$(LibraryNugetPackageFolder)\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Moq">
<HintPath>$(LibraryNugetPackageFolder)\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.ResourceManager">
Expand All @@ -153,4 +151,4 @@
<Name>HDInsightManagement</Name>
</ProjectReference>
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -423,75 +423,5 @@ public void TestCreateLinuxSparkClusterWithComponentVersion()
Assert.Equal(result.State, AsyncOperationState.Succeeded);
}
}

[Fact]
public void TestCreateDefaultFsAzureBlobClusterUsingClusterParameters()
{
var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK };

using (var context = UndoContext.Current)
{
context.Start();

var client = HDInsightManagementTestUtilities.GetHDInsightManagementClient(handler);
var resourceManagementClient = HDInsightManagementTestUtilities.GetResourceManagementClient(handler);
var resourceGroup = HDInsightManagementTestUtilities.CreateResourceGroup(resourceManagementClient);

var cluster = GetClusterSpecHelpers.GetAzureBlobDefaultFsCreateParametersIaas();
const string dnsname = "hdisdk-defaultfsazureblob";
const string operationState = "Running";

var createresponse = client.Clusters.Create(resourceGroup, dnsname, cluster);
Assert.Equal(dnsname, createresponse.Cluster.Name);
Assert.Equal(operationState, createresponse.Cluster.Properties.ClusterState);

var clusterConfig = client.Clusters.GetClusterConfigurations(resourceGroup, dnsname, "core-site");
string value;
clusterConfig.Configuration.TryGetValue("fs.defaultFS", out value);
Assert.True(value.StartsWith("wasb://"));

client.Clusters.Get(resourceGroup, dnsname);

var result = client.Clusters.Delete(resourceGroup, dnsname);
Assert.Equal(result.StatusCode, HttpStatusCode.OK);
Assert.Equal(result.State, AsyncOperationState.Succeeded);

}
}

[Fact]
public void TestCreateDefaultFsAzureBlobClusterContainerNotSpecified()
{
var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK };

using (var context = UndoContext.Current)
{
context.Start();

var client = HDInsightManagementTestUtilities.GetHDInsightManagementClient(handler);
var resourceManagementClient = HDInsightManagementTestUtilities.GetResourceManagementClient(handler);
var resourceGroup = HDInsightManagementTestUtilities.CreateResourceGroup(resourceManagementClient);

var cluster = GetClusterSpecHelpers.GetAzureBlobDefaultFsCreateParametersIaas(specifyDefaultContainer:false);
const string dnsname = "hdisdk-defaultfsazureblob-nocontainer";
const string operationState = "Running";

var createresponse = client.Clusters.Create(resourceGroup, dnsname, cluster);
Assert.Equal(dnsname, createresponse.Cluster.Name);
Assert.Equal(operationState, createresponse.Cluster.Properties.ClusterState);

var clusterConfig = client.Clusters.GetClusterConfigurations(resourceGroup, dnsname, "core-site");
string value;
clusterConfig.Configuration.TryGetValue("fs.defaultFS", out value);
Assert.True(value.StartsWith("wasb://" + dnsname + "@"));

client.Clusters.Get(resourceGroup, dnsname);

var result = client.Clusters.Delete(resourceGroup, dnsname);
Assert.Equal(result.StatusCode, HttpStatusCode.OK);
Assert.Equal(result.State, AsyncOperationState.Succeeded);

}
}
}
}
Loading