Add infrastructure for checking Zombie process on BMC

Resolves openbmc/openbmc-test-automation#236

Change-Id: I46b71b089b4a5a847d6813f6031464a02fc4d3fc
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
old mode 100644
new mode 100755
index b7134a1..9c42892
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -360,7 +360,7 @@
 Get Time Stamp
     [Documentation]     Get the current time stamp data
     ${cur_time}=    Get Current Date   result_format=%Y%m%d%H%M%S%f
-    [return]   ${cur_time}
+    [Return]   ${cur_time}
 
 
 Verify BMC State
@@ -504,3 +504,10 @@
     ${list}=   Get Dictionary Keys   ${resp}
     ${resp}=   Get Matches   ${list}   regexp=^.*[0-9a-z_].${endpoint}[0-9]*$
     [return]   ${resp}
+
+Check Zombie Process
+    [Documentation]    Check if any defunct process exist or not on BMC
+    ${count}   ${stderr}   ${rc}=  Execute Command     ps -o stat | grep Z | wc -l
+    ...    return_stderr=True  return_rc=True
+    Should Be True    ${count}==0
+    Should Be Empty    ${stderr}