public SSHClientOutput execCommand(String command) throws Exception { return execCommand(command, 7200, null); }
private Pair<Integer, String> runRemoteCommand(String command, Logger logAppender) throws IOException { SSHClient ssh = new SSHClient(remoteHost, port, remoteUser, remotePwd); SSHClientOutput sshOutput; try { sshOutput = ssh.execCommand(command, remoteTimeoutSeconds, logAppender); int exitCode = sshOutput.getExitCode(); String output = sshOutput.getText(); return Pair.newPair(exitCode, output); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e.getMessage(), e); } }
public SSHClientOutput execCommand(String command) throws Exception { return execCommand(command, 7200, null); }
@Test public void testCmd() throws Exception { if (isRemote == false) return; SSHClient ssh = new SSHClient(this.hostname, this.port, this.username, this.password); SSHClientOutput output = ssh.execCommand("echo hello"); assertEquals(0, output.getExitCode()); assertEquals("hello\n", output.getText()); }
private Pair<Integer, String> runRemoteCommand(String command, Logger logAppender) throws IOException { SSHClient ssh = new SSHClient(remoteHost, remoteUser, remotePwd); SSHClientOutput sshOutput; try { sshOutput = ssh.execCommand(command, remoteTimeoutSeconds, logAppender); int exitCode = sshOutput.getExitCode(); String output = sshOutput.getText(); return new Pair<Integer, String>(exitCode, output); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e.getMessage(), e); } }
public SSHClientOutput execCommand(String command) throws Exception { return execCommand(command, 7200, null); }
public SSHClientOutput execCommand(String command) throws Exception { return execCommand(command, 7200, null); }
@Test public void testCmd() throws Exception { if (isRemote == false) return; SSHClient ssh = new SSHClient(this.hostname, this.username, this.password); SSHClientOutput output = ssh.execCommand("echo hello"); assertEquals(0, output.getExitCode()); assertEquals("hello\n", output.getText()); }
private Pair<Integer, String> runRemoteCommand(String command, Logger logAppender) throws IOException { SSHClient ssh = new SSHClient(remoteHost, port, remoteUser, remotePwd); SSHClientOutput sshOutput; try { sshOutput = ssh.execCommand(command, remoteTimeoutSeconds, logAppender); int exitCode = sshOutput.getExitCode(); String output = sshOutput.getText(); return Pair.newPair(exitCode, output); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e.getMessage(), e); } }
private Pair<Integer, String> runRemoteCommand(String command, Logger logAppender) throws IOException { SSHClient ssh = new SSHClient(remoteHost, remoteUser, remotePwd); SSHClientOutput sshOutput; try { sshOutput = ssh.execCommand(command, remoteTimeoutSeconds, logAppender); int exitCode = sshOutput.getExitCode(); String output = sshOutput.getText(); return new Pair<Integer, String>(exitCode, output); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e.getMessage(), e); } }