public void SSHConnectScopeWithSSHRunShellCommandInside() { var connectScopeActivity = new SSHConnectScope { Host = Test_SSHHost, Username = Test_SSHUsername, Password = new InArgument <SecureString>(value => new NetworkCredential("", Test_SSHPassword).SecurePassword), Port = 22, ShellExpectedPrompt = Test_ExpectedPrompt, TimeoutMS = 3000 }; connectScopeActivity.Body.Handler = new Sequence() { Activities = { new SSHRunShellCommand { Command = $"ssh {Test_SSHUsername}@localhost", TimeoutMS = 3000, ShellExpectedPrompt = "password\\:", CheckExitCode = false }, new SSHRunShellCommand { Command = Test_SSHPassword, TimeoutMS = 3000, CheckExitCode = true }, new SSHRunShellCommand { Command = "ls", TimeoutMS = 3000, CheckExitCode = true }, new SSHRunShellCommand { Command = "exit", TimeoutMS = 3000, CheckExitCode = true } } }; var output = WorkflowInvoker.Invoke(connectScopeActivity); }
public void SSHConnectScopeWithSSHRunCommandInside() { var connectScopeActivity = new SSHConnectScope { Host = Test_SSHHost, Username = Test_SSHUsername, Password = new InArgument <SecureString>(value => new NetworkCredential("", Test_SSHPassword).SecurePassword), Port = 22, TimeoutMS = 5000 }; var runCommandActivity = new SSHRunCommand { Command = Test_SSHCommand, TimeoutMS = 3000 }; connectScopeActivity.Body.Handler = new Sequence() { Activities = { runCommandActivity } }; var output = WorkflowInvoker.Invoke(connectScopeActivity); }
public void SSHConnectScopeWithoutSSHRunCommandInside() { var connectScopeActivity = new SSHConnectScope { Host = Test_SSHHost, Username = Test_SSHUsername, Password = new InArgument <SecureString>(value => new NetworkCredential("", Test_SSHPassword).SecurePassword), Port = 22, TimeoutMS = 3000 }; var output = WorkflowInvoker.Invoke(connectScopeActivity); }