Redfish DateTime set with invalid data
Following test case automated:
- Verify Set DateTime With Invalid Data Using Redfish.
Change-Id: I67f29a75293e9e5d6e66f4e5bef0e633e57db178
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/redfish/managers/test_managers_bmc_time.robot b/redfish/managers/test_managers_bmc_time.robot
index 9f35fa8..ea01908 100644
--- a/redfish/managers/test_managers_bmc_time.robot
+++ b/redfish/managers/test_managers_bmc_time.robot
@@ -11,6 +11,7 @@
*** Variables ***
${max_time_diff_in_seconds} 6
+${invalid_datetime} "2019-04-251T12:24:46+00:00"
*** Test Cases ***
@@ -48,6 +49,13 @@
Redfish Set DateTime ${old_bmc_time}
+Verify Set DateTime With Invalid Data Using Redfish
+ [Documentation] Verify error while setting invalid DateTime using Redfish.
+ [Tags] Verify_Set_DateTime_With_Invalid_Data_Using_Redfish
+
+ Redfish Set DateTime ${invalid_datetime} valid_status_codes=[${HTTP_BAD_REQUEST}]
+
+
*** Keywords ***
Test Teardown Execution
@@ -66,12 +74,16 @@
Redfish Set DateTime
[Documentation] Set DateTime using Redfish.
- [Arguments] ${date_time}
+ [Arguments] ${date_time} &{kwargs}
# Description of argument(s):
- # date_time New time to set for BMC (eg. 2019-06-30 09:21:28).
+ # date_time New time to set for BMC (eg.
+ # "2019-06-30 09:21:28").
+ # kwargs Additional parms to be passed directly to
+ # th Redfish.Patch function. A good use for
+ # this is when testing a bad date-time, the
+ # caller can specify
+ # valid_status_codes=[${HTTP_BAD_REQUEST}].
- ${payload}= Create Dictionary DateTime=${date_time}
- Redfish.Patch ${REDFISH_BASE_URI}Managers/bmc body=&{payload}
- ... valid_status_codes=[${HTTP_OK}, ${HTTP_BAD_REQUEST}]
-
+ Redfish.Patch ${REDFISH_BASE_URI}Managers/bmc body={'DateTime': '${date_time}'}
+ ... &{kwargs}