Fix to accommodate xyz's BMC dump path changes
BMC dump uri has changed from /xyz/openbmc_project/dump/entry/ to
/xyz/openbmc_project/dump/bmc/entry/. This change is to make dump
automation work on builds with or without this url changes.
Change-Id: I27b010d67f17efb88d60b673153fafa5a3b0565f
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/lib/dump_utils.robot b/lib/dump_utils.robot
index cb88423..19884fe 100644
--- a/lib/dump_utils.robot
+++ b/lib/dump_utils.robot
@@ -21,6 +21,10 @@
# returned if out of dump space was
# detected when creating the dump.
+ ${resp}= OpenBMC Get Request ${DUMP_URI}
+ Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
+ ... Set Test Variable ${DUMP_URI} /xyz/openbmc_project/dump/
+
${data}= Create Dictionary data=@{EMPTY}
${resp}= OpenBMC Post Request
... ${DUMP_URI}action/CreateDump data=${data} quiet=${1}
@@ -108,6 +112,10 @@
# dump_id An integer value that identifies a particular dump
# object(e.g. 1, 3, 5).
+ ${resp}= OpenBMC Get Request ${DUMP_URI}
+ Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
+ ... Set Test Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/
+
${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}${dump_id}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
@@ -119,6 +127,10 @@
# Description of Argument(s):
# dump_id An integer value that identifies a particular dump (e.g. 1, 3).
+ ${resp}= OpenBMC Get Request ${DUMP_URI}
+ Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
+ ... Set Test Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/
+
${data}= Create Dictionary data=@{EMPTY}
${resp}= OpenBMC Post Request
... ${DUMP_ENTRY_URI}${dump_id}/action/Delete data=${data}
@@ -128,6 +140,10 @@
Delete All Dumps
[Documentation] Delete all dumps.
+ ${resp}= OpenBMC Get Request ${DUMP_URI}
+ Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
+ ... Set Test Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/
+
# Check if dump entries exist, if not return.
${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list quiet=${1}
Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND}
@@ -163,6 +179,10 @@
Delete All BMC Dump
[Documentation] Delete all BMC dump entries using "DeleteAll" interface.
+ ${resp}= OpenBMC Get Request ${DUMP_URI}
+ Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
+ ... Set Test Variable ${DUMP_URI} /xyz/openbmc_project/dump/
+
${data}= Create Dictionary data=@{EMPTY}
${resp}= Openbmc Post Request ${DUMP_URI}action/DeleteAll data=${data}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
@@ -170,6 +190,10 @@
Dump Should Not Exist
[Documentation] Verify that BMC dumps do not exist.
+ ${resp}= OpenBMC Get Request ${DUMP_URI}
+ Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
+ ... Set Test Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/
+
${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list quiet=${1}
Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
@@ -193,6 +217,10 @@
Get Dump Entries
[Documentation] Return dump entries list.
+ ${resp}= OpenBMC Get Request ${DUMP_URI}
+ Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
+ ... Set Test Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/
+
${dump_entries}= Get URL List ${DUMP_ENTRY_URI}
[Return] ${dump_entries}