Skip to content

Commit 4ad9f43

Browse files
adathatrigkeishin
authored andcommitted
Validate immediate datetime change
Validates https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-time-manager/+/31284/ This suite does not contain any test which waits for deferred updates. Hence does not require any change wrt that. Signed-off-by: Anusha Dathatri <[email protected]> Change-Id: I3b6fb750f153c3513714460a713d9e6a614871a4
1 parent ed61612 commit 4ad9f43

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

redfish/managers/test_managers_bmc_time.robot

+34-1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,20 @@ Verify Enable NTP
162162
Valid Value ntp["ProtocolEnabled"] valid_values=[True]
163163

164164

165+
Verify Immediate Consumption Of BMC Date
166+
[Documentation] Verify immediate change in BMC date time.
167+
[Tags] Verify_Immediate_Consumption_Of_BMC_Date
168+
[Setup] Run Keywords Set Time To Manual Mode AND
169+
... Sleep 2s AND Redfish Set DateTime valid_status_codes=[${HTTP_OK}]
170+
[Teardown] Run Keywords FFDC On Test Case Fail AND
171+
... Redfish Set DateTime valid_status_codes=[${HTTP_OK}]
172+
[Template] Set BMC Date And Verify
173+
174+
# host_state
175+
on
176+
off
177+
178+
165179
*** Keywords ***
166180

167181

@@ -260,4 +274,23 @@ Restore NTP Status
260274
261275
Run Keyword If '${original_ntp["ProtocolEnabled"]}' == 'True'
262276
... Set NTP state ${TRUE}
263-
... ELSE Set NTP state ${FALSE}
277+
... ELSE Set NTP state ${FALSE}
278+
279+
280+
Set BMC Date And Verify
281+
[Documentation] Set BMC Date Time at a given host state and verify.
282+
[Arguments] ${host_state}
283+
# Description of argument(s):
284+
# host_state Host state at which date time will be updated for verification
285+
# (eg. on, off).
286+
287+
Run Keyword If '${host_state}' == 'on'
288+
... Redfish Power On stack_mode=skip
289+
... ELSE
290+
... Redfish Power off stack_mode=skip
291+
${current_date}= Get Current Date time_zone=UTC
292+
${new_value}= Subtract Time From Date ${current_date} 1 day
293+
Redfish Set DateTime ${new_value} valid_status_codes=[${HTTP_OK}]
294+
${current_value}= Redfish Get DateTime
295+
${time_diff}= Subtract Date From Date ${current_value} ${new_value}
296+
Should Be True '${time_diff}'<='3'

0 commit comments

Comments
 (0)