Handle NTP Datetime GET request post disabling it

Changes:
    - Added wait loop for 30 seconds to re-try due to NTP network
      restart

Tested:
     robot -v OPENBMC_HOST:xx.xx.xx.xx
         --include Verify_Server_Certificate_Replace
         --include Verify_Client_Certificate_Replace
         --include Verify_Client_Certificate_Install
         --include Verify_Server_Certificate_View_Via_Openssl
         --include Verify_CSR_Generation_For_Server_Certificate
         --include Verify_CSR_Generation_For_Client_Certificate
         --include Verify_Expired_Certificate_Replace
        redfish/managers/test_certificate.robot

Test Certificate :: Test certificate in OpenBMC.                      | PASS |
7 tests, 7 passed, 0 failed
==============================================================================

Change-Id: Ib4db3a534b76ec977ed11f3701db56ca5f8a8e19
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/certificate_utils.robot b/lib/certificate_utils.robot
index 0c258cb..db1c233 100755
--- a/lib/certificate_utils.robot
+++ b/lib/certificate_utils.robot
@@ -307,6 +307,8 @@
     Redfish.Patch  ${REDFISH_NW_PROTOCOL_URI}
     ...  body={'NTP':{'ProtocolEnabled': ${False}}}
     ...  valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
-    Sleep  2s
-    Redfish.Patch  ${REDFISH_BASE_URI}Managers/bmc  body={'DateTime': '${new_time}'}
+
+    # NTP network takes few seconds to restart.
+    Wait Until Keyword Succeeds  30 sec  10 sec
+    ...  Redfish.Patch  ${REDFISH_BASE_URI}Managers/bmc  body={'DateTime': '${new_time}'}
     ...  valid_status_codes=[${HTTP_OK}]