public static void AnonymousBVTClassInitialize(TestContext testContext) { TestBase.TestClassInitialize(testContext); CLICommonBVT.SaveAndCleanSubScriptionAndEnvConnectionString(); StorageAccountName = Test.Data.Get("StorageAccountName"); StorageEndPoint = Test.Data.Get("StorageEndPoint").Trim(); useHttps = true; PowerShellAgent.SetAnonymousStorageContext(StorageAccountName, useHttps, StorageEndPoint); downloadDirRoot = Test.Data.Get("DownloadDir"); SetupDownloadDir(); }
public void GetMooncakeStorageContext() { CLICommonBVT.SaveAndCleanSubScriptionAndEnvConnectionString(); PowerShellAgent.ImportAzureSubscriptionAndSetStorageAccount( Test.Data.Get("MooncakeSubscriptionPath"), Test.Data.Get("MooncakeSubscriptionName"), null); ValidateStorageContext(Test.Data.Get("MooncakeStorageAccountName"), Test.Data.Get("MooncakeStorageAccountKey"), "core.chinacloudapi.cn"); }
public static void Initialize(TestContext testContext, bool useHttps) { StorageAccount = null; TestBase.TestClassInitialize(testContext); CLICommonBVT.SaveAndCleanSubScriptionAndEnvConnectionString(); StorageAccountName = Test.Data.Get("StorageAccountName"); StorageEndPoint = Test.Data.Get("StorageEndPoint").Trim(); if (lang == Language.PowerShell) { PowerShellAgent.SetAnonymousStorageContext(StorageAccountName, useHttps, StorageEndPoint); } downloadDirRoot = Test.Data.Get("DownloadDir"); SetupDownloadDir(); }
public static void InvalidCredentialCasesClassInit(TestContext testContext) { StorageAccount = null; TestBase.TestClassInitialize(testContext); CLICommonBVT.SaveAndCleanSubScriptionAndEnvConnectionString(); string storageAccountName = Test.Data.Get("StorageAccountName"); string storageEndPoint = Test.Data.Get("StorageEndPoint").Trim(); Agent.Context = StorageAccount; if (lang == Language.PowerShell) { PowerShellAgent.SetAnonymousStorageContext(storageAccountName, useHttps, storageEndPoint); } else { NodeJSAgent.AgentConfig.ConnectionString = null; PreviousUseEnvVar = NodeJSAgent.AgentConfig.UseEnvVar; NodeJSAgent.AgentConfig.UseEnvVar = true; } }
public void RunCmdletWithoutStorageContext() { PowerShellAgent.RemoveAzureSubscriptionIfExists(); CLICommonBVT.SaveAndCleanSubScriptionAndEnvConnectionString(); string containerName = Utility.GenNameString("container"); CloudBlobContainer container = blobUtil.CreateContainer(containerName); try { bool terminated = false; try { agent.GetAzureStorageContainer(containerName); } catch (CmdletInvocationException e) { terminated = true; Test.Info(e.Message); Test.Assert(e.Message.StartsWith("Can not find your azure storage credential."), "Can not find your azure storage credential."); } finally { if (!terminated) { Test.AssertFail("without storage context should return a terminating error"); } } } finally { blobUtil.RemoveContainer(containerName); } CLICommonBVT.RestoreSubScriptionAndEnvConnectionString(); }
public void GetStorageContextWithoutSubscription() { CLICommonBVT.SaveAndCleanSubScriptionAndEnvConnectionString(); ValidateStorageContext(Test.Data.Get("StorageAccountName"), Test.Data.Get("StorageAccountKey"), "core.windows.net"); }