GUI: Updated CLI Get BMC DateTime and Modify BMC Date keywords
Changes:
- Modified keyword called as CLI Get BMC DateTime.
- Modified keyword called as Modify BMC Date .
Tested:
- Successfully ran
redfish/managers/test_certificate.robot
Change-Id: I1341b3670bd5ae6d496d06ea0e32e43091e7c62e
Signed-off-by: rramyasr-in <rramyasr@in.ibm.com>
diff --git a/lib/certificate_utils.robot b/lib/certificate_utils.robot
index 56046a3..6aeec22 100755
--- a/lib/certificate_utils.robot
+++ b/lib/certificate_utils.robot
@@ -316,7 +316,10 @@
... body={'NTP':{'ProtocolEnabled': ${False}}}
... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
+ # Change date format to 2024-03-07T07:58:50+00:00 from 2024-03-07 07:58:50.000.
+ ${new_time_format}= Convert Date ${new_time} result_format=%Y-%m-%dT%H:%M:%S+00:00
+
# NTP network takes few seconds to restart.
Wait Until Keyword Succeeds 30 sec 10 sec
- ... Redfish.Patch ${REDFISH_BASE_URI}Managers/${MANAGER_ID} body={'DateTime': '${new_time}'}
- ... valid_status_codes=[${HTTP_OK}]
+ ... Redfish.Patch ${REDFISH_BASE_URI}Managers/${MANAGER_ID} body={'DateTime': '${new_time_format}'}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
diff --git a/lib/utils.robot b/lib/utils.robot
index 084d400..1411e23 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -790,7 +790,7 @@
CLI Get BMC DateTime
[Documentation] Returns BMC date time from date command.
- ${bmc_time_via_date} ${stderr} ${rc}= BMC Execute Command date +"%Y-%m-%d %H:%M:%S" print_err=1
+ ${bmc_time_via_date} ${stderr} ${rc}= BMC Execute Command date +"%Y-%m-%dT%H:%M:%S" print_err=1
RETURN ${bmc_time_via_date}
diff --git a/redfish/managers/test_certificate.robot b/redfish/managers/test_certificate.robot
index db064ec..7d00362 100644
--- a/redfish/managers/test_certificate.robot
+++ b/redfish/managers/test_certificate.robot
@@ -264,7 +264,7 @@
[Documentation] Restore BMC date to its prior value.
Redfish.Patch ${REDFISH_BASE_URI}Managers/${MANAGER_ID} body={'DateTime': '${cli_date_time}'}
- ... valid_status_codes=[${HTTP_OK}]
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
Generate CSR Via Redfish