blob: f1932b97eaab1828995305662038858d65a69e52 [file] [log] [blame]
Sivas SRR0e3bc6d2019-04-23 08:36:35 -05001*** Settings ***
2Documentation Test BMC manager time functionality.
3Resource ../../lib/resource.robot
4Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/common_utils.robot
6Resource ../../lib/openbmc_ffdc.robot
7Resource ../../lib/utils.robot
8
9Test Setup Run Keywords Printn AND redfish.Login
10Test Teardown Test Teardown Execution
11
12*** Variables ***
13${max_time_diff_in_seconds} 6
14
15*** Test Cases ***
16
17Verify Redfish BMC Time
18 [Documentation] Verify that date/time obtained via redfish matches
19 ... date/time obtained via BMC command line.
20 [Tags] Verify_Redfish_BMC_Time
21
22 ${redfish_date_time}= Redfish Get DateTime
23 ${cli_date_time}= CLI Get BMC DateTime
24 ${time_diff}= Subtract Date From Date ${cli_date_time}
25 ... ${redfish_date_time}
26 ${time_diff}= Evaluate abs(${time_diff})
27 Rprint Vars redfish_date_time cli_date_time time_diff
28 Should Be True ${time_diff} < ${max_time_diff_in_seconds}
29 ... The difference between Redfish time and CLI time exceeds the allowed time difference.
30
31
32*** Keywords ***
33
34Test Teardown Execution
35 [Documentation] Do the post test teardown.
36
37 FFDC On Test Case Fail
38 redfish.Logout
39
40
41Redfish Get DateTime
42 [Documentation] Returns BMC Datetime value from Redfish.
43
44 ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/bmc DateTime
45 [Return] ${date_time}