Skip to content

Fix and rerecord Aks test #6198

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

Merged
merged 1 commit into from
May 11, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ public KubernetesTests(ITestOutputHelper output)
TestExecutionHelpers.SetUpSessionAndProfile();
}

[Fact(Skip = "Need service team to re-record test after changes to the ClientRuntime.")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait("Re-record", "ClientRuntime changes")]
public void TestAzureKubernetes()
{
TestController.NewInstance.RunPowerShellTest("Test-AzureRmKubernetes");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,27 @@ public void RunPowerShellTest(params string[] scripts)
string jsonOutput = @"{""" + subscription + @""":{ ""service_principal"":""foo"",""client_secret"":""bar""}}";
AzureSession.Instance.DataStore.WriteFile(Path.Combine(home, ".azure", "acsServicePrincipal.json"), jsonOutput);
}
else if (HttpMockServer.GetCurrentMode() == HttpRecorderMode.Record)
{
AzureSession.Instance.DataStore = new MemoryDataStore();
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var dir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath);
var subscription = HttpMockServer.Variables["SubscriptionId"];
var currentEnvironment = TestEnvironmentFactory.GetTestEnvironment();
string spn = null;
string spnSecret = null;
if (currentEnvironment.ConnectionString.KeyValuePairs.ContainsKey("ServicePrincipal"))
{
spn = currentEnvironment.ConnectionString.KeyValuePairs["ServicePrincipal"];
}
if (currentEnvironment.ConnectionString.KeyValuePairs.ContainsKey("ServicePrincipalSecret"))
{
spnSecret = currentEnvironment.ConnectionString.KeyValuePairs["ServicePrincipalSecret"];
}
AzureSession.Instance.DataStore.WriteFile(Path.Combine(home, ".ssh", "id_rsa.pub"), File.ReadAllText(dir + "/Fixtures/id_rsa.pub"));
string jsonOutput = @"{""" + subscription + @""":{ ""service_principal"":""" + spn + @""",""client_secret"":"""+ spnSecret + @"""}}";
AzureSession.Instance.DataStore.WriteFile(Path.Combine(home, ".azure", "acsServicePrincipal.json"), jsonOutput);
}

helper.RunPowerShellTest(scripts);
}
Expand Down

Large diffs are not rendered by default.