Added test case to verify BMC core dump creation

Changes:

    - Added a test case to verify BMC core dump creation
      after an application crash

Tested:
     - Ran the test from sandbox successfully

Change-Id: Id89bf68a0b4b37dfa178fdf9202bef5a45fa91a3
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/redfish/managers/test_bmc_dumps.robot b/redfish/managers/test_bmc_dumps.robot
index 2abb129..18ad87c 100644
--- a/redfish/managers/test_bmc_dumps.robot
+++ b/redfish/managers/test_bmc_dumps.robot
@@ -194,6 +194,20 @@
     ...  body=${payload}  valid_status_codes=[${HTTP_INTERNAL_SERVER_ERROR}]
 
 
+Verify BMC Core Dump When Host Powered Off
+    [Documentation]  Verify BMC core dump after application crash at host powered off state.
+    [Tags]  Verify_BMC_Core_Dump_When_Host_Powered_Off
+
+    Redfish Power Off  stack_mode=skip
+
+    # Ensure all dumps are cleaned out.
+    Redfish Delete All BMC Dumps
+    Trigger Core Dump
+
+    # Verify that BMC dump is available.
+    Wait Until Keyword Succeeds  2 min  10 sec  Is BMC Dump Available
+
+
 *** Keywords ***
 
 Get BMC Dump Entries
@@ -210,6 +224,16 @@
     [Return]  ${dump_ids}
 
 
+Is BMC Dump Available
+    [Documentation]  Verify if BMC dump is available.
+
+    ${dump_entries}=  Get BMC Dump Entries
+
+    # Verifying that BMC dump is available.
+    ${length}=  Get length  ${dump_entries}
+    Should Be True  0 < ${length}
+
+
 Get Disk Usage For Dumps
     [Documentation]  Return disk usage in kilobyte for BMC dumps.