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}
diff --git a/redfish/managers/test_managers_bmc_time.robot b/redfish/managers/test_managers_bmc_time.robot
index 89b9f49..6be2fa7 100644
--- a/redfish/managers/test_managers_bmc_time.robot
+++ b/redfish/managers/test_managers_bmc_time.robot
@@ -154,7 +154,7 @@
     # The following patch command should set the ["NTP"]["ProtocolEnabled"] property to "True".
     Redfish.Patch  ${REDFISH_NW_PROTOCOL_URI}  body={'NTP':{'ProtocolEnabled': ${True}}}
     ...  valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
-    Wait Until Keyword Succeeds  30 sec  5 sec
+    Wait Until Keyword Succeeds  1 min  5 sec
     ...  Verify System Time Sync Status  ${True}
     ${ntp}=  Redfish.Get Attribute  ${REDFISH_NW_PROTOCOL_URI}  NTP
     Rprint Vars  ntp