Sivas SRR | 0e3bc6d | 2019-04-23 08:36:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test BMC manager time functionality. |
| 3 | Resource ../../lib/resource.robot |
| 4 | Resource ../../lib/bmc_redfish_resource.robot |
| 5 | Resource ../../lib/common_utils.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/utils.robot |
| 8 | |
| 9 | Test Setup Run Keywords Printn AND redfish.Login |
| 10 | Test Teardown Test Teardown Execution |
| 11 | |
| 12 | *** Variables *** |
| 13 | ${max_time_diff_in_seconds} 6 |
| 14 | |
| 15 | *** Test Cases *** |
| 16 | |
| 17 | Verify 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 | |
| 34 | Test Teardown Execution |
| 35 | [Documentation] Do the post test teardown. |
| 36 | |
| 37 | FFDC On Test Case Fail |
| 38 | redfish.Logout |
| 39 | |
| 40 | |
| 41 | Redfish 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} |