From dc483c80cf8f0c94d430661b9637bea3cd8c3441 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Tue, 10 Apr 2018 04:20:47 -0400 Subject: [PATCH 1/2] add rbeacon test cases --- xCAT-test/autotest/testcase/rbeacon/cases0 | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 xCAT-test/autotest/testcase/rbeacon/cases0 diff --git a/xCAT-test/autotest/testcase/rbeacon/cases0 b/xCAT-test/autotest/testcase/rbeacon/cases0 new file mode 100644 index 000000000..5adcc8dfe --- /dev/null +++ b/xCAT-test/autotest/testcase/rbeacon/cases0 @@ -0,0 +1,59 @@ +start:rbeacon_null +description: this case is to test rbeacon usage +cmd:rbeacon +check:rc==0 +check:output=~Usage +end + +start:rbeacon_stat +description: this case is to test rbeacon CN stat +cmd:rbeacon $$CN stat +check:rc==0 +check:output=~$$CN\s*:\s*Front:Off Rear:Off|Front:On Rear:On|Front:Off Rear:On|Front:On Rear:Off +end + +start:rbeacon_on_off +description: this case is to test rbeacon CN on/off +cmd:rbeacon $$CN stat |tee /tmp/rbeaconstat +check:rc==0 +cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN on; fi +check:rc==0 +check:output=~$$CN\s*:\s*on +cmd:rbeacon $$CN stat +check:output=~$$CN\s*:\s*Front:Blink Rear:Blink +cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN off; fi +check:rc==0 +check:output=~$$CN\s*:\s*off +end + +start:rbeacon_help +description: this case is to test rbeacon -h and --help output +cmd:rbeacon -h +check:rc==0 +check:output=~Usage +check:output =~OpenPOWER \(OpenBMC\) specific: +cmd:rbeacon --help +check:rc==0 +check:output=~Usage +check:output =~OpenPOWER \(OpenBMC\) specific: +end + +start:rbeacon_version +description: this case is to test rbeacon -v and --version output +cmd:rbeacon -v +check:rc==0 +check:output=~Version +check:output =~git commit +cmd:rbeacon --version +check:rc==0 +check:output=~~Version +check:output =~git commit +end + +start:rbeacon_false +description: this case is to test rbeacon could process false input +cmd:rbeacon $$CN abc +check:rc!=0 +check:output=~$$CN\s*:\s*Error:\s*Only \'on\', \'off\' or \'stat\' is supported +end + From 3703091150f1c6a9867499a9c7b6d75d2885474a Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 12 Apr 2018 04:49:03 -0400 Subject: [PATCH 2/2] update according to comments --- xCAT-test/autotest/testcase/rbeacon/cases0 | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/xCAT-test/autotest/testcase/rbeacon/cases0 b/xCAT-test/autotest/testcase/rbeacon/cases0 index 5adcc8dfe..bf0343c72 100644 --- a/xCAT-test/autotest/testcase/rbeacon/cases0 +++ b/xCAT-test/autotest/testcase/rbeacon/cases0 @@ -1,5 +1,7 @@ start:rbeacon_null description: this case is to test rbeacon usage +os:Linux +hcp:openbmc cmd:rbeacon check:rc==0 check:output=~Usage @@ -7,27 +9,17 @@ end start:rbeacon_stat description: this case is to test rbeacon CN stat +os:Linux +hcp:openbmc cmd:rbeacon $$CN stat check:rc==0 check:output=~$$CN\s*:\s*Front:Off Rear:Off|Front:On Rear:On|Front:Off Rear:On|Front:On Rear:Off end -start:rbeacon_on_off -description: this case is to test rbeacon CN on/off -cmd:rbeacon $$CN stat |tee /tmp/rbeaconstat -check:rc==0 -cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN on; fi -check:rc==0 -check:output=~$$CN\s*:\s*on -cmd:rbeacon $$CN stat -check:output=~$$CN\s*:\s*Front:Blink Rear:Blink -cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN off; fi -check:rc==0 -check:output=~$$CN\s*:\s*off -end - start:rbeacon_help description: this case is to test rbeacon -h and --help output +os:Linux +hcp:openbmc cmd:rbeacon -h check:rc==0 check:output=~Usage @@ -40,6 +32,8 @@ end start:rbeacon_version description: this case is to test rbeacon -v and --version output +os:Linux +hcp:openbmc cmd:rbeacon -v check:rc==0 check:output=~Version @@ -52,6 +46,8 @@ end start:rbeacon_false description: this case is to test rbeacon could process false input +os:Linux +hcp:openbmc cmd:rbeacon $$CN abc check:rc!=0 check:output=~$$CN\s*:\s*Error:\s*Only \'on\', \'off\' or \'stat\' is supported