Skip to content

Commit 885effd

Browse files
pridhivirajstewartsmith
authored andcommitted
Fix some command executions in OpTestPrdDaemon test.
Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
1 parent ffb5f01 commit 885effd

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

testcases/OpTestPrdDaemon.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,19 @@ def runTest(self):
7676
self.cv_SYSTEM.host_console_login()
7777

7878
# To check opal-prd daemon is running or not
79-
l_cmd = "ps -ef | grep opal-prd | head -1 | awk '{ print $2 }'"
80-
l_res = self.cv_HOST.host_run_command(l_cmd)
79+
l_res = self.cv_HOST.host_run_command("pidof opal-prd")
8180

8281
# To kill the opal-prd daemon using its PID
8382
l_cmd = "kill -9 %d" % int(l_res[0])
8483
l_res = self.cv_HOST.host_run_command(l_cmd)
8584

8685
# To check if opal-prd daemon is spawned again even after killing
87-
l_cmd = "ps -ef | grep opal-prd | head -1 | awk '{ print $2 }'"
88-
l_res = commands.getstatusoutput(l_cmd)
89-
print l_res
90-
9186
try:
92-
if int(l_res[0]) == 0:
93-
print "opal-prd daemon is always running"
87+
l_res = self.cv_HOST.host_run_command(l_cmd)
9488
except CommandFailed as c:
9589
self.assertEqual(c.exitcode, 0, "opal-prd daemon is not running always:Need to raise a bug: %s" % str(c))
9690

91+
print "opal-prd daemon is always running"
92+
9793
return BMC_CONST.FW_SUCCESS
9894

0 commit comments

Comments
 (0)