Skip to content

Commit

Permalink
latest swagger specs and tests.
Browse files Browse the repository at this point in the history
Run tests against prod.

Need to wait for fixes to ListCredential to make it into production or
need to remove it from the client.

Merge uploader changes from GA candidate.
  • Loading branch information
begoldsm committed Oct 26, 2016
1 parent 296f281 commit 31bc02c
Show file tree
Hide file tree
Showing 74 changed files with 13,138 additions and 8,154 deletions.
5 changes: 1 addition & 4 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- To Enable LocalFeed for testing uncomment the following line -->
<!-- <add key="Local" value="./tools/LocalFeed" /> -->
</packageSources>
<packageSources />
</configuration>
20 changes: 19 additions & 1 deletion src/ResourceManagement/DataLake.Analytics/DataLake.Analytics.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DataLakeAnalytics.Tests", "DataLakeAnalytics.Tests\DataLakeAnalytics.Tests.xproj", "{04B4A8C0-95B4-4139-BE8E-885E087F5205}"
EndProject
Expand All @@ -17,6 +17,12 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Management.
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Management.ResourceManager", "..\Resource\Microsoft.Azure.Management.ResourceManager\Microsoft.Azure.Management.ResourceManager.xproj", "{A5986BDB-0D0D-48AA-9E49-ECE96BAC8ADE}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime\Microsoft.Rest.ClientRuntime.xproj", "{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure\Microsoft.Rest.ClientRuntime.Azure.xproj", "{D5296EAB-C13E-4A88-9532-BD0677D18EC9}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure.Authentication", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure.Authentication\Microsoft.Rest.ClientRuntime.Azure.Authentication.xproj", "{6319205D-BBFC-4150-BEAE-31B1C9B911DD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,6 +57,18 @@ Global
{A5986BDB-0D0D-48AA-9E49-ECE96BAC8ADE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5986BDB-0D0D-48AA-9E49-ECE96BAC8ADE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5986BDB-0D0D-48AA-9E49-ECE96BAC8ADE}.Release|Any CPU.Build.0 = Release|Any CPU
{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.Build.0 = Release|Any CPU
{D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.Build.0 = Release|Any CPU
{6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,94 @@ public void GetCatalogItemsTest()
}
}

[Fact]
public void CredentialCRUDTest()
{
using (var context = MockContext.Start(this.GetType().FullName))
{
commonData = new CommonTestFixture(context);
commonData.HostUrl =
commonData.DataLakeAnalyticsManagementHelper.TryCreateDataLakeAnalyticsAccount(commonData.ResourceGroupName,
commonData.Location, commonData.DataLakeStoreAccountName, commonData.SecondDataLakeAnalyticsAccountName);
TestUtilities.Wait(120000); // Sleep for two minutes to give the account a chance to provision the queue
commonData.DataLakeAnalyticsManagementHelper.CreateCatalog(commonData.ResourceGroupName,
commonData.SecondDataLakeAnalyticsAccountName, commonData.DatabaseName, commonData.TableName, commonData.TvfName, commonData.ViewName, commonData.ProcName);
using (var clientToUse = commonData.GetDataLakeAnalyticsCatalogManagementClient(context))
{
// create the credential
clientToUse.Catalog.CreateCredential(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName, commonData.SecretName,
new DataLakeAnalyticsCatalogCredentialCreateParameters
{
Password = commonData.SecretPwd,
Uri = "https://adlasecrettest.contoso.com:443",
UserId = TestUtilities.GenerateGuid("fakeUserId01").ToString()
});

// Attempt to create the secret again, which should throw
Assert.Throws<CloudException>(
() => clientToUse.Catalog.CreateCredential(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName, commonData.SecretName,
new DataLakeAnalyticsCatalogCredentialCreateParameters
{
Password = commonData.SecretPwd,
Uri = "https://adlasecrettest.contoso.com:443",
UserId = TestUtilities.GenerateGuid("fakeUserId02").ToString()
}));

// create another credential
var secondSecretName = commonData.SecretName + "dup";
clientToUse.Catalog.CreateCredential(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName, secondSecretName,
new DataLakeAnalyticsCatalogCredentialCreateParameters
{
Password = commonData.SecretPwd,
Uri = "https://adlasecrettest.contoso.com:443",
UserId = TestUtilities.GenerateGuid("fakeUserId03").ToString()
});

// Get the credential and ensure the response contains a date.
var secretGetResponse = clientToUse.Catalog.GetCredential(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName, commonData.SecretName);

Assert.NotNull(secretGetResponse);
Assert.NotNull(secretGetResponse.Name);

// Get the Credential list
var credListResponse = clientToUse.Catalog.ListCredentials(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName);
Assert.True(credListResponse.Count() >= 1);
// look for the credential we created
Assert.True(credListResponse.Any(cred => cred.Name.Equals(commonData.CredentialName)));


// Get the specific credential as well
var credGetResponse = clientToUse.Catalog.GetCredential(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName, commonData.CredentialName);
Assert.Equal(commonData.CredentialName, credGetResponse.Name);

// Delete the credential
clientToUse.Catalog.DeleteCredential(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName, commonData.SecretName,
new DataLakeAnalyticsCatalogCredentialDeleteParameters(commonData.SecretPwd));

// Try to get the credential which should throw
Assert.Throws<CloudException>(() => clientToUse.Catalog.GetCredential(
commonData.SecondDataLakeAnalyticsAccountName,
commonData.DatabaseName, commonData.SecretName));

// TODO: once support is available for delete all credentials add tests here for that.
}
}
}

[Fact]
public void SecretAndCredentialCRUDTest()
{
Expand Down
Loading

0 comments on commit 31bc02c

Please sign in to comment.