Fix using SSH command while SSH protocol is disabled
Reboot command OBMC Reboot (off) run /sbin/reboot via SSH protocol,
use rest API to trigger BMC reboot instead while run SSH disabled test.
Signed-off-by: Brian Ma <chma0@nuvoton.com>
Change-Id: I5fb5aad8de6259feaace05a2ab7f9e2173ea0343
diff --git a/redfish/managers/test_bmc_protocol_settings.robot b/redfish/managers/test_bmc_protocol_settings.robot
index 92bbe52..a59ecc3 100644
--- a/redfish/managers/test_bmc_protocol_settings.robot
+++ b/redfish/managers/test_bmc_protocol_settings.robot
@@ -79,7 +79,7 @@
Enable SSH Protocol ${False}
# Reboot BMC and verify persistency.
- OBMC Reboot (off)
+ Redfish BMC Reboot
# Check if SSH is really disabled via Redfish.
Verify SSH Protocol State ${False}
@@ -162,3 +162,23 @@
*** Keywords ***
+Is BMC LastResetTime Changed
+ [Documentation] return fail if BMC last reset time is not changed
+ [Arguments] ${reset_time}
+
+ ${last_reset_time}= Redfish.Get Attribute /redfish/v1/Managers/bmc LastResetTime
+ Should Not Be Equal ${last_reset_time} ${reset_time}
+
+
+Redfish BMC Reboot
+ [Documentation] Use Redfish API reboot BMC and wait for BMC ready
+
+ # Get BMC last reset time for compare
+ ${last_reset_time}= Redfish.Get Attribute /redfish/v1/Managers/bmc LastResetTime
+
+ # Reboot BMC by Redfish API
+ Redfish BMC Reset Operation
+
+ # Wait for BMC real reboot and Redfish API ready
+ Wait Until Keyword Succeeds 3 min 10 sec Is BMC LastResetTime Changed ${last_reset_time}
+