如何借助Robot框架获取Linux中执行的命令的状态。
例如如果使用这个:
SSHLibrary open Connection (server)
SSHLibrary login xxxxx xxxxx
${1111}= Write ${command}
${2222}= Read delay=5s
在上面的脚本中,如何获取我已执行并存储在 ${1111} var 中的命令的状态,
例如;如果执行的命令通过,我必须获得 0 的状态,否则为 1
你需要使用执行命令 http://robotframework.org/SSHLibrary/latest/SSHLibrary.html#Execute%20Command代替Write http://robotframework.org/SSHLibrary/latest/SSHLibrary.html#Write
The SSH库文档 http://robotframework.org/SSHLibrary/latest/SSHLibrary.html给出这个例子:
${rc}= Execute Command echo Success guaranteed. return_stdout=False return_rc=True
Should Be Equal ${rc} ${0}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)