【发布时间】:2016-08-14 14:10:14
【问题描述】:
我有一个保存在远程服务器(linux 机器)上的 shell 脚本,我试图在从 windows 执行 SOAPui 的各种测试用例之间调用那个 shell 脚本。 所以我准备了一个 groovy 脚本:
def command="/usr/bin/ssh -p password username@IP_address bash -s < /home/test.sh"
def proc=command.execute().text
proc.waitFor()
但不幸的是,我收到一个错误:
java.io.IOException: Cannot run program "/usr/bin/ssh": CreateProcess error=2, The system cannot find the file specified error at line: 6强>
我试图对此进行更多搜索,但无法获得解决方案。一些链接是:
How to execute shell script using soapUI
http://groovy-lang.org/groovy-dev-kit.html#process-management
【问题讨论】:
-
如果您在 Windows 上执行 SOAPUI,则不能使用
/usr/bin/ssh,因为command.execute()在本地运行,而在 Windows 中您没有/usr/bin/ssh.尝试为 Windows 安装 ssh 客户端并在您的命令中使用它。 -
我知道我们不能使用 /usr/bin/ssh,但我只需要从 windows 中的 soapui 工具执行脚本。那么我将如何从 ssh 客户端执行 windows(如 putty 等)?
-
我用
putty放了一个样本,看看吧:)