diff --git a/xCAT-test/autotest/testcase/xcatd/case0 b/xCAT-test/autotest/testcase/xcatd/case0 index dfca7e43e..cb4600fc4 100644 --- a/xCAT-test/autotest/testcase/xcatd/case0 +++ b/xCAT-test/autotest/testcase/xcatd/case0 @@ -3,17 +3,17 @@ description:stop then start xcatd daemon, and check all the 6 processes are runn os:linux cmd:service xcatd status check:rc==0 -check:output=~xCAT service is running +check:output=~xcatd service is running cmd:service xcatd stop check:rc==0 cmd:sleep 3 cmd:service xcatd start check:rc==0 -check:output=~Starting x(cat|CAT)d +check:output=~Starting xcatd check:output=~[ OK ] cmd:service xcatd status check:rc==0 -check:output=~xCAT service is running +check:output=~xcatd service is running cmd:result=`ps -ef | grep "xcatd: SSL listener" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi check:output=~only one process cmd:result=`ps -ef | grep "xcatd: DB Access" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi @@ -34,14 +34,14 @@ description:stop xcatd daemon, then check all the 6 processes are stopped os:linux cmd:service xcatd status check:rc==0 -check:output=~xCAT service is running +check:output=~xcatd service is running cmd:service xcatd stop check:rc==0 check:output=~Stopping x(cat|CAT)d check:output=~[ OK ] cmd:sleep 3 cmd:service xcatd status -check:output=~xCAT service is not running +check:output=~xcatd service is not running cmd:ps -ef | grep xcatd check:output!~"xcatd: SSL listener" check:output!~"xcatd: DB Access" @@ -57,12 +57,12 @@ start:xcatd_restart description:restart xcatd daemon os:linux cmd:service xcatd status -check:output=~xCAT service is running +check:output=~xcatd service is running check:rc==0 cmd:times=10; while [ $times -gt 0 ]; do service xcatd restart; if [ "$?" -ne "0" ]; then break; fi; ((times--)); done; if [ $times -gt 0 ]; then $?=1; fi check:rc==0 cmd:service xcatd status -check:output=~xCAT service is running +check:output=~xcatd service is running check:rc==0 end @@ -71,7 +71,7 @@ description:with XCATBYPASS=YES, the command works either xcatd deamon running o os:linux cmd:service xcatd status check:rc==0 -check:output=~xCAT service is running +check:output=~xcatd service is running cmd:XCATBYPASS=YES tabdump site check:rc==0 cmd:service xcatd stop @@ -80,7 +80,7 @@ check:output=~Stopping x(cat|CAT)d check:output=~[ OK ] cmd:sleep 3 cmd:service xcatd status -check:output=~xCAT service is not running +check:output=~xcatd service is not running cmd:tabdump site check:rc!=0 cmd:XCATBYPASS=YES tabdump site @@ -91,7 +91,7 @@ check:output=~Starting x(cat|CAT)d check:output=~[ OK ] cmd:service xcatd status check:rc==0 -check:output=~xCAT service is running +check:output=~xcatd service is running end start:disable_root_permission_in_policy_table @@ -99,7 +99,7 @@ description:disable root permission, only with XCATBYPASS=YES, the command works os:linux cmd:service xcatd status check:rc==0 -check:output=~xCAT service is running +check:output=~xcatd service is running cmd:chtab name=root policy.rule=disable check:rc==0 cmd:lsdef @@ -117,7 +117,140 @@ description:assign root permission to certain command, only this command works os:linux cmd:service xcatd status check:rc==0 -check:output=~xCAT service is running +check:output=~xcatd service is running +cmd:lsdef +check:rc==0 +cmd:tabdump policy +check:rc==0 +cmd:chtab name=root policy.commands=lsdef policy.rule=allow +check:rc==0 +cmd:lsdef +check:rc==0 +cmd:tabdump policy +check:output=~Error: Permission denied for request +cmd:chtab name=root policy.commands= policy.rule=allow +check:rc==0 +end +start:xcatd_start +description:stop then start xcatd daemon, and check all the 6 processes are running +os:linux +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service is running +cmd:service xcatd stop +check:rc==0 +cmd:sleep 3 +cmd:service xcatd start +check:rc==0 +check:output=~Starting xcatd +check:output=~[ OK ] +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service is running +cmd:result=`ps -ef | grep "xcatd: SSL listener" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi +check:output=~only one process +cmd:result=`ps -ef | grep "xcatd: DB Access" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi +check:output=~only one process +cmd:result=`ps -ef | grep "xcatd: UDP listener" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi +check:output=~only one process +cmd:result=`ps -ef | grep "xcatd: install monitor" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi +check:output=~only one process +cmd:result=`ps -ef | grep "xcatd: Discovery worke" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi +check:output=~only one process +cmd:result=`ps -ef | grep "xcatd: Command log writer" | grep -v grep | wc -l`; if [ $result -eq 1 ]; then echo "only one process"; fi +check:output=~only one process +end + + +start:xcatd_stop +description:stop xcatd daemon, then check all the 6 processes are stopped +os:linux +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service is running +cmd:service xcatd stop +check:rc==0 +check:output=~Stopping x(cat|CAT)d +check:output=~[ OK ] +cmd:sleep 3 +cmd:service xcatd status +check:output=~xcatd service is not running +cmd:ps -ef | grep xcatd +check:output!~"xcatd: SSL listener" +check:output!~"xcatd: DB Access" +check:output!~"xcatd: UDP listener" +check:output!~"xcatd: install monitor" +check:output!~"xcatd: Discovery worke" +check:output!~"xcatd: Command log writer" +cmd:service xcatd start +check:rc==0 +end + +start:xcatd_restart +description:restart xcatd daemon +os:linux +cmd:service xcatd status +check:output=~xcatd service is running +check:rc==0 +cmd:times=10; while [ $times -gt 0 ]; do service xcatd restart; if [ "$?" -ne "0" ]; then break; fi; ((times--)); done; if [ $times -gt 0 ]; then $?=1; fi +check:rc==0 +cmd:service xcatd status +check:output=~xcatd service is running +check:rc==0 +end + +start:run_command_with_XCATBYPASS +description:with XCATBYPASS=YES, the command works either xcatd deamon running or not +os:linux +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service is running +cmd:XCATBYPASS=YES tabdump site +check:rc==0 +cmd:service xcatd stop +check:rc==0 +check:output=~Stopping x(cat|CAT)d +check:output=~[ OK ] +cmd:sleep 3 +cmd:service xcatd status +check:output=~xcatd service is not running +cmd:tabdump site +check:rc!=0 +cmd:XCATBYPASS=YES tabdump site +check:rc==0 +cmd:service xcatd start +check:rc==0 +check:output=~Starting x(cat|CAT)d +check:output=~[ OK ] +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service is running +end + +start:disable_root_permission_in_policy_table +description:disable root permission, only with XCATBYPASS=YES, the command works +os:linux +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service is running +cmd:chtab name=root policy.rule=disable +check:rc==0 +cmd:lsdef +check:output=~Error: Permission denied for request +cmd:XCATBYPASS=YES lsdef +check:rc==0 +cmd:XCATBYPASS=YES chtab name=root policy.rule=allow +check:rc==0 +cmd:lsdef +check:rc==0 +end + +start:assign_certain_command_permission +description:assign root permission to certain command, only this command works +os:linux +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service is running cmd:lsdef check:rc==0 cmd:tabdump policy