2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-02 19:40:10 +00:00

Retry rpower command in testcases

This commit is contained in:
Mark Gurevich 2020-04-03 13:24:49 -04:00
parent fc91f00df7
commit 533e4b3b5d

View File

@ -16,7 +16,10 @@ start:rpower_stat
description:This case is to test stat option could show the power status of nodes
Attribute: $$CN-The operation object of rpower command
label:cn_bmc_ready,hctrl_general
cmd:rpower $$CN on
#If rpower fails on the first try, try again with smaller memory
cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' failed with ${out}. Trying with smaller memory."; rpower $$CN on; fi
cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 5 ];then break;fi done
cmd:rpower $$CN stat
check:rc==0
@ -89,8 +92,11 @@ cmd:rpower $$CN off
cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done
cmd:rpower $$CN stat
check:output=~Not Activated|off
cmd:rpower $$CN on
#If rpower fails on the first try, try again with smaller memory
cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' failed with ${out}. Trying with smaller memory."; rpower $$CN on; fi
check:rc==0
cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done
cmd:rpower $$CN stat
check:output=~Running|on