Dump: Added function to check dump status in BMC
Changes:
Added Keywords to Get BMC Dump status and Verify BMC Dump status.
Tested:
Created dummy testcase to test
Signed-off-by: harikaVi <chandra.harika.joggireddy@ibm.com>
Change-Id: I1ad485c50b29d6862a324cf21d66d8ec5e0b5a79
diff --git a/lib/dump_utils.robot b/lib/dump_utils.robot
index b920efe..0db9d40 100644
--- a/lib/dump_utils.robot
+++ b/lib/dump_utils.robot
@@ -435,4 +435,33 @@
... '${resp["TaskState"]}' in ${expected_status}
Sleep 5s
- END
\ No newline at end of file
+ END
+
+Get Dump Status In BMC
+ [Documentation] Get dump status from BMC using busctl method.
+ [Arguments] ${dump_uri}
+
+ # Description of argument(s):
+ # dump_uri Dump URI E.g: /xyz/openbmc_project/dump/bmc/entry/7.
+
+ ${cmd}= Catenate busctl get-property xyz.openbmc_project.Dump.Manager
+ ... ${dump_uri} xyz.openbmc_project.Common.Progress Status
+
+ ${stdout} ${stderr} ${rc}= BMC Execute Command ${cmd}
+ Log ${stdout}
+ # Example output:
+ # s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed".
+
+ ${status}= Set Variable ${stdout.split('.')[-1].strip('"')}
+ [Return] ${status}
+
+Verify Dump Status In BMC
+ [Documentation] Verify Dump Status in BMC.
+ [Arguments] ${dump_uri} ${expected_dump_status}
+
+ # Description of argument(s):
+ # dump_uri Dump URI E.g: /xyz/openbmc_project/dump/bmc/entry/7.
+ # expected_dump_status Expected Dump Status (Completed or Failed etc).
+
+ ${dump_status}= Get Dump Status In BMC ${dump_uri}
+ Should Be Equal ${dump_status} ${expected_dump_status}