Managers bmc & bmc time script fix
1. redfish/managers/test_managers_bmc.robot
Made the following changes
- In Verify boot count after reboot test case, store the
initial state of NTP/ProtocolEnabled.
- Set NTP/ProtocolEnabled to TRUE.
- In Teardown restore the NTP to initial state.
This is been done since the test case fails when NTP is disabled.
2. redfish/managers/test_managers_bmc_time.robot
- In Verify Enable NTP test case, while checking the service sync
status for systemd-timesyncd, added a wait time of 1 min.
This is done since after Redfish NTP Patch to Enabled state,
the service status gets updated after some time which causes
test script failure.
Tested: Run robot redfish/managers/test_managers_bmc.robot
Run robot redfish/managers/test_managers_bmc_time.robot
Signed-off-by: Aravinth R <aravinthr@ami.com>
Change-Id: I1d7e1a0189e4d0030e58062b0bf93e8e5c9b47bb
diff --git a/redfish/managers/test_managers_bmc.robot b/redfish/managers/test_managers_bmc.robot
index 277f193..4ac9e5e 100644
--- a/redfish/managers/test_managers_bmc.robot
+++ b/redfish/managers/test_managers_bmc.robot
@@ -166,6 +166,9 @@
Verify Boot Count After BMC Reboot
[Documentation] Verify boot count increments on BMC reboot.
[Tags] Verify_Boot_Count_After_BMC_Reboot
+ [Setup] Run Keywords Update NTP Test Initial Status AND
+ ... Set NTP state ${TRUE}
+ [Teardown] Restore NTP Status
Set BMC Boot Count ${0}
Redfish OBMC Reboot (off)
@@ -196,3 +199,26 @@
FFDC On Test Case Fail
Run Keyword And Ignore Error redfish.Logout
+
+
+Update NTP Test Initial Status
+ [Documentation] Update the initial status of NTP.
+
+ ${original_ntp}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} NTP
+ Set Suite Variable ${original_ntp}
+
+
+Set NTP state
+ [Documentation] Set NTP service inactive.
+ [Arguments] ${state}
+
+ Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={'NTP':{'ProtocolEnabled': ${state}}}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
+
+
+Restore NTP Status
+ [Documentation] Restore NTP Status.
+
+ Run Keyword If '${original_ntp["ProtocolEnabled"]}' == 'True'
+ ... Set NTP state ${TRUE}
+ ... ELSE Set NTP state ${FALSE}