robotframework封装关键字用于控制ats
ats的控制主要包括:
1、更新配置文件、重新加载配置文件
2、启动、停止、重启
3、清除ats缓存
前情回顾:控制ats之前、首先需要一个建立一个ssh链接
http://blog.csdn.net/zpeng421x/article/details/73330816
具体封装:
----------------------------------------------------------------------------
AtsControl
[Documentation] ats control: start, stop, restart, clean
[Arguments] ${host_alias} ${action}
Run Keyword If '${action}' == 'start' AtsStart ${host_alias}
Run Keyword If '${action}' == 'stop' AtsStop ${host_alias}
Run Keyword If '${action}' == 'restart' AtsRestart ${host_alias}
Run Keyword If '${action}' == 'clean' AtsClean ${host_alias}
AtsStart
[Documentation] ats start
[Arguments] ${host_alias}
Run Keyword If '${${host_alias}_host}' == '${LOCAL_IP}' RunReturnOk ${ts_start}
Run Keyword If '${${host_alias}_host}' != '${LOCAL_IP}' SshExecuteCmdRc ${host_alias} ${ts_start}
----------------------------------------------------------------------------
测试用例:
----------------------------------------------------------------------------
case1:
[Documentation] ats start
[Tags] start
AtsControl start
----------------------------------------------------------------------------