public void ResetServerPassword() { string arguments = string.Format("-subscriptionID \"{0}\" -serializedCert \"{1}\" -serverLocation \"{2}\"", this.subscriptionID, this.serializedCert, this.serverLocation); bool testResult = PSScriptExecutor.ExecuteScript(FunctionalTest.ResetPasswordScript, arguments); Assert.IsTrue(testResult); }
public void OutputObjectFormatValidation() { string outputFile = Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid() + ".txt"); string arguments = string.Format("-subscriptionID \"{0}\" -serializedCert \"{1}\" -serverLocation \"{2}\" -OutputFile \"{3}\"", this.subscriptionID, this.serializedCert, this.serverLocation, outputFile); bool testResult = PSScriptExecutor.ExecuteScript(ServerTest.FormatValidationScript, arguments); Assert.IsTrue(testResult); OutputFormatValidator.ValidateOutputFormat(outputFile, @"Server\ExpectedFormat.txt"); }
public void FirewallTest() { string arguments = string.Format( "-subscriptionID \"{0}\" -serializedCert \"{1}\" -serverLocation \"{2}\" -Endpoint \"{3}\"", this.subscriptionID, this.serializedCert, this.serverLocation, LocalRdfeEndpoint); bool testResult = PSScriptExecutor.ExecuteScript(ServerTest.FirewallTestScript, arguments); Assert.IsTrue(testResult); }
public void DeleteDatabase() { string arguments = string.Format( CultureInfo.InvariantCulture, "-Name \"{0}\" -ManageUrl \"{1}\" -UserName \"{2}\" -Password \"{3}\"", "testDeletedbfromcmdlet", this.manageUrl, this.userName, this.password); bool testResult = PSScriptExecutor.ExecuteScript(DatabaseTest.DeleteScript, arguments); Assert.IsTrue(testResult); }
public void CreateContext() { string arguments = string.Format( CultureInfo.InvariantCulture, "-ManageUrl \"{0}\" -UserName \"{1}\" -Password \"{2}\"", this.manageUrl, this.userName, this.password); bool testResult = PSScriptExecutor.ExecuteScript( DatabaseTest.CreateContextScript, arguments); Assert.IsTrue(testResult); }
public void OutputObjectFormatValidation() { string outputFile = Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid() + ".txt"); string arguments = string.Format("-subscriptionID \"{0}\" -serializedCert \"{1}\" -serverLocation \"{2}\" -OutputFile \"{3}\"", this.subscriptionID, this.serializedCert, this.serverLocation, outputFile); bool testResult = PSScriptExecutor.ExecuteScript(FunctionalTest.FormatValidationScript, arguments); Assert.IsTrue(testResult); string actualFormat = GetMaskedData(outputFile); Console.WriteLine(actualFormat); string expectedFormat = GetMaskedData("ExpectedFormat.txt"); Assert.AreEqual(expectedFormat, actualFormat, "Format of output object didn't match"); }
public void GetServerQuotaTest() { string arguments = string.Format( "-SloManageUrl \"{0}\" -subscriptionID \"{1}\" -serializedCert \"{2}\" -serverLocation \"{3}\" " + " -Endpoint \"{4}\" -Username \"{5}\" -Password \"{6}\"", this.manageUrl, this.subscriptionID, this.serializedCert, this.serverLocation, LocalRdfeEndpoint, this.username, this.password); bool testResult = PSScriptExecutor.ExecuteScript(ServerTest.GetQuotaScript, arguments); Assert.IsTrue(testResult); }
public void OutputObjectFormatValidation() { string outputFile = Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid() + ".txt"); string arguments = string.Format( CultureInfo.InvariantCulture, "-Name \"{0}\" -ManageUrl \"{1}\" -UserName \"{2}\" -Password \"{3}\" -OutputFile \"{4}\"", "testFormatdbfromcmdlet", this.manageUrl, this.userName, this.password, outputFile); bool testResult = PSScriptExecutor.ExecuteScript(DatabaseTest.FormatValidationScript, arguments); Assert.IsTrue(testResult); OutputFormatValidator.ValidateOutputFormat(outputFile, @"Database\ExpectedFormat.txt"); }
public void CreateContext() { string arguments = string.Format( CultureInfo.InvariantCulture, "-ManageUrl \"{0}\" -UserName \"{1}\" -Password \"{2}\" " + "-SubscriptionId \"{3}\" -SerializedCert \"{4}\" ", SqlDatabaseTestSettings.Instance.ManageUrl, SqlDatabaseTestSettings.Instance.UserName, SqlDatabaseTestSettings.Instance.Password, SqlDatabaseTestSettings.Instance.SubscriptionId, SqlDatabaseTestSettings.Instance.SerializedCert); bool testResult = PSScriptExecutor.ExecuteScript( DatabaseTest.CreateContextScript, arguments); Assert.IsTrue(testResult); }
public void DeleteDatabase() { string arguments = string.Format( CultureInfo.InvariantCulture, "-Name \"{0}\" -ManageUrl \"{1}\" -UserName \"{2}\" -Password \"{3}\" " + "-ServerName \"{4}\" -SubscriptionID \"{5}\" -SerializedCert \"{6}\" " + "-Endpoint \"{7}\"", "testDeletedbfromcmdlet", this.manageUrl, this.userName, this.password, this.serverName, this.subscriptionId, this.serializedCert, LocalRdfeEndpoint); bool testResult = PSScriptExecutor.ExecuteScript(DatabaseTest.DeleteScript, arguments); Assert.IsTrue(testResult); }
public void CreateAndGetDatabase() { string arguments = string.Format( CultureInfo.InvariantCulture, "-Name \"{0}\" -ManageUrl \"{1}\" -UserName \"{2}\" -Password \"{3}\" " + "-ServerName \"{4}\" -SubscriptionID \"{5}\" -SerializedCert \"{6}\" " + "-Endpoint \"{7}\"", "testcreatedbfromcmdlet", SqlDatabaseTestSettings.Instance.ManageUrl, SqlDatabaseTestSettings.Instance.UserName, SqlDatabaseTestSettings.Instance.Password, SqlDatabaseTestSettings.Instance.ServerName, SqlDatabaseTestSettings.Instance.SubscriptionId, SqlDatabaseTestSettings.Instance.SerializedCert, LocalRdfeEndpoint); bool testResult = PSScriptExecutor.ExecuteScript(DatabaseTest.CreateScript, arguments); Assert.IsTrue(testResult); }
protected override void Process([NotNull] ProcessorArgs arguments) { Assert.ArgumentNotNull(arguments, "arguments"); InstallContainerArgs args = (InstallContainerArgs)arguments; this._logger = args.Logger; Assert.ArgumentNotNull(args, "args"); string destinationFolder = args.Destination; Assert.ArgumentNotNullOrEmpty(destinationFolder, "destinationFolder"); UpdateTlsDynamicConfig(args); string script = GetScript(args); PSExecutor ps = new PSScriptExecutor(destinationFolder, script); ExecuteScript(() => ps.Execute()); }
public void ImportExportDatabase() { string outputFile = Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid() + ".txt"); string cmdlineArgs = "-UserName \"{0}\" -Password \"{1}\" -SubscriptionId \"{2}\" -SerializedCert \"{3}\" " + "-ContainerName \"{4}\" -StorageName \"{5}\" -StorageAccessKey \"{6}\" " + "-ServerLocation \"{7}\""; string arguments = string.Format( CultureInfo.InvariantCulture, cmdlineArgs, this.userName, this.password, this.ieSubscriptionId, this.serializedCert, this.containerName, this.storageName, this.accessKey, this.ieServerLocation); bool testResult = PSScriptExecutor.ExecuteScript(DatabaseTest.ImportExportScript, arguments); Assert.IsTrue(testResult); }
public VsPowerShellScriptExecutor(IScriptExecutor scriptExecutor) { // We only work in VS where we know it's a PSScriptExecutor. _scriptExecutor = (PSScriptExecutor)scriptExecutor; }
public void CreateGetDeleteServerTest() { string arguments = string.Format("-subscriptionID \"{0}\" -serializedCert \"{1}\" -serverLocation \"{2}\"", this.subscriptionID, this.serializedCert, this.serverLocation); bool testResult = PSScriptExecutor.ExecuteScript(ServerTest.ServerTestScript, arguments); Assert.IsTrue(testResult); }