Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite is for testing System time in Open BMC. |
| 3 | |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 4 | Resource ../lib/rest_client.robot |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 5 | Resource ../lib/ipmi_client.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 6 | Resource ../lib/openbmc_ffdc.robot |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 7 | Resource ../lib/state_manager.robot |
Sandhya Somashekar | 839a0c2 | 2019-01-31 05:05:43 -0600 | [diff] [blame] | 8 | Resource ../lib/resource.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 10 | Library OperatingSystem |
| 11 | Library DateTime |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 12 | |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 13 | Test Setup Open Connection And Log In |
| 14 | Test Teardown Post Test Case Execution |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 15 | |
Sweta Potthuri | b163120 | 2017-08-28 04:11:34 -0500 | [diff] [blame] | 16 | Force Tags Clock_Time |
| 17 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 18 | *** Variables *** |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 19 | ${SYSTEM_TIME_INVALID} 01/01/1969 00:00:00 |
| 20 | ${SYSTEM_TIME_VALID} 02/29/2016 09:10:00 |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 21 | ${ALLOWED_TIME_DIFF} 3 |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 22 | # Equivalent epoch time for 02/17/2017 04:11:40 |
| 23 | ${SYSTEM_TIME_VALID_EPOCH} ${1487304700000000} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 24 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 25 | *** Test Cases *** |
| 26 | |
| 27 | Get System Time |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 28 | [Documentation] Get system time using IPMI and verify that it matches |
| 29 | ... with BMC date time. |
George Keishing | 845fb82 | 2016-11-01 13:23:19 -0500 | [diff] [blame] | 30 | [Tags] Get_System_Time |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 31 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 32 | ${resp}= Run IPMI Standard Command sel time get |
| 33 | ${ipmidate}= Convert Date ${resp} date_format=%m/%d/%Y %H:%M:%S |
| 34 | ... exclude_millis=yes |
| 35 | ${bmcdate}= Get BMC Time Using IPMI |
| 36 | ${diff}= Subtract Date From Date ${bmcdate} ${ipmidate} |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 37 | ${diff}= Convert To Number ${diff} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 38 | Should Be True ${diff} < ${ALLOWED_TIME_DIFF} |
| 39 | ... Open BMC time does not match with IPMI sel time |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 40 | |
Rahul Maheshwari | 52d9294 | 2019-01-21 10:54:52 -0600 | [diff] [blame] | 41 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 42 | Set Valid System Time |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 43 | [Documentation] Set system time using IPMI and verify that it is |
| 44 | ... correctly set in BMC. |
George Keishing | 845fb82 | 2016-11-01 13:23:19 -0500 | [diff] [blame] | 45 | [Tags] Set_Valid_System_Time |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 46 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 47 | Set Time Mode ${MANUAL_MODE} |
Rahul Maheshwari | 7588f87 | 2017-04-13 05:51:24 -0500 | [diff] [blame] | 48 | |
Rahul Maheshwari | 11a1cc3 | 2019-01-24 02:53:05 -0600 | [diff] [blame] | 49 | # Added delay for NTP mode to get disabled fully |
| 50 | Sleep 30s |
| 51 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 52 | ${resp}= Run IPMI Standard Command sel time set "${SYSTEM_TIME_VALID}" |
| 53 | ${setdate}= Convert Date ${SYSTEM_TIME_VALID} |
| 54 | ... date_format=%m/%d/%Y %H:%M:%S exclude_millis=yes |
| 55 | ${bmcdate}= Get BMC Time Using IPMI |
| 56 | ${diff}= Subtract Date From Date ${bmcdate} ${setdate} |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 57 | ${diff}= Convert To Number ${diff} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 58 | Should Be True ${diff} < ${ALLOWED_TIME_DIFF} |
| 59 | ... Open BMC time does not match with set time |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 60 | |
Rahul Maheshwari | 52d9294 | 2019-01-21 10:54:52 -0600 | [diff] [blame] | 61 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 62 | Set Invalid System Time |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 63 | [Documentation] Set system time with invalid time using IPMI and verify |
| 64 | ... that it should throw error. |
George Keishing | 845fb82 | 2016-11-01 13:23:19 -0500 | [diff] [blame] | 65 | [Tags] Set_Invalid_System_Time |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 66 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 67 | Set Time Mode ${MANUAL_MODE} |
Rahul Maheshwari | 7588f87 | 2017-04-13 05:51:24 -0500 | [diff] [blame] | 68 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 69 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 70 | ... sel time set "${SYSTEM_TIME_INVALID}" |
| 71 | Should Start With ${msg} Specified time could not be parsed |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 72 | |
| 73 | Set System Time with no time |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 74 | [Documentation] Set system time with no time using IPMI and verify |
| 75 | ... that it should throw error. |
George Keishing | 845fb82 | 2016-11-01 13:23:19 -0500 | [diff] [blame] | 76 | [Tags] Set_System_Time_with_no_time |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 77 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 78 | Set Time Mode ${MANUAL_MODE} |
Rahul Maheshwari | 7588f87 | 2017-04-13 05:51:24 -0500 | [diff] [blame] | 79 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 80 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 81 | ... sel time set "" |
| 82 | Should Start With ${msg} Specified time could not be parsed |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 83 | |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 84 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 85 | Set BMC Time With BMC And Manual |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 86 | [Documentation] Set BMC time when time owner is BMC and time mode is |
| 87 | ... manual. |
| 88 | [Tags] Set_BMC_Time_With_BMC_And_Manual |
| 89 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 90 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 91 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 92 | #Operation Owner Mode Status BMC Time Host Time |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 93 | Set BMC Time ${BMC_OWNER} ${MANUAL_MODE} ok Set Change |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 94 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 95 | |
| 96 | Set BMC Time With Both And Manual |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 97 | [Documentation] Set BMC time when time owner is Both and time mode is |
| 98 | ... manual. |
| 99 | [Tags] Set_BMC_Time_With_Both_And_Manual |
| 100 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 101 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 102 | #Operation Owner Mode Status BMC Time Host Time |
| 103 | Set BMC Time ${BOTH_OWNER} ${MANUAL_MODE} ok Set Change |
| 104 | |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 105 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 106 | Set BMC Time With Split And Manual |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 107 | [Documentation] Set BMC time when time owner is Split and time mode is |
| 108 | ... manual. |
| 109 | [Tags] Set_BMC_Time_With_Split_And_Manual |
| 110 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 111 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 112 | #Operation Owner Mode Status BMC Time Host Time |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 113 | Set BMC Time ${SPLIT_OWNER} ${MANUAL_MODE} ok Set No Change |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 114 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 115 | |
| 116 | Set BMC Time With BMC And NTP |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 117 | [Documentation] Set BMC time when time owner is BMC and time mode is |
| 118 | ... NTP. |
| 119 | [Tags] Set_BMC_Time_With_BMC_And_NTP |
| 120 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 121 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 122 | #Operation Owner Mode Status BMC Time Host Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 123 | Set BMC Time ${BMC_OWNER} ${NTP_MODE} error Not Set No Change |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 124 | |
| 125 | |
| 126 | Set BMC Time With Host And Manual |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 127 | [Documentation] Set BMC time when time owner is Host and time mode is |
| 128 | ... Manual. |
| 129 | [Tags] Set_BMC_Time_With_Host_And_Manual |
| 130 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 131 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 132 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 133 | #Operation Owner Mode Status BMC Time Host Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 134 | Set BMC Time ${HOST_OWNER} ${MANUAL_MODE} error Not Set No Change |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 135 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 136 | |
| 137 | Set BMC Time With Both And NTP |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 138 | [Documentation] Set BMC time when time owner is Both and time mode is |
| 139 | ... NTP. |
| 140 | [Tags] Set_BMC_Time_With_Both_And_NTP |
| 141 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 142 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 143 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 144 | #Operation Owner Mode Status BMC Time Host Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 145 | Set BMC Time ${BOTH_OWNER} ${NTP_MODE} error Not Set No Change |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 146 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 147 | |
| 148 | Set BMC Time With Split And NTP |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 149 | [Documentation] Set BMC time when time owner is Split and time mode is |
| 150 | ... NTP. |
| 151 | [Tags] Set_BMC_Time_With_Split_And_NTP |
| 152 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 153 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 154 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 155 | #Operation Owner Mode Status BMC Time Host Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 156 | Set BMC Time ${SPLIT_OWNER} ${NTP_MODE} error Not Set No Change |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 157 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 158 | |
| 159 | Set BMC Time With Host And NTP |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 160 | [Documentation] Set BMC time when time owner is Host and time mode is |
| 161 | ... NTP. |
| 162 | [Tags] Set_BMC_Time_With_Host_And_NTP |
| 163 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 164 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 165 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 166 | #Operation Owner Mode Status BMC Time Host Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 167 | Set BMC Time ${HOST_OWNER} ${NTP_MODE} error Not Set No Change |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 168 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 169 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 170 | Set Host Time With Host And Manual |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 171 | [Documentation] Set host time when time owner is host and time mode is |
| 172 | ... manual. |
| 173 | [Tags] Set_Host_Time_With_Host_And_Manual |
| 174 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 175 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 176 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 177 | #Operation Owner Mode Status BMC Time Host Time |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 178 | Set Host Time ${HOST_OWNER} ${MANUAL_MODE} ok Change Set |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 179 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 180 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 181 | Set Host Time With Both And NTP |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 182 | [Documentation] Set host time when time owner is both and time mode is |
| 183 | ... NTP. |
| 184 | [Tags] Set_Host_Time_With_Both_And_NTP |
| 185 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 186 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 187 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 188 | #Operation Owner Mode Status BMC Time Host Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 189 | Set Host Time ${BOTH_OWNER} ${NTP_MODE} error No Change Not Set |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 190 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 191 | |
| 192 | Set Host Time With Split And Manual |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 193 | [Documentation] Set host time when time owner is split and time mode is |
| 194 | ... manual. |
| 195 | [Tags] Set_Host_Time_With_Split_And_Manual |
| 196 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 197 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 198 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 199 | #Operation Owner Mode Status BMC Time Host Time |
| 200 | Set Host Time ${SPLIT_OWNER} ${MANUAL_MODE} ok No Change Set |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 201 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 202 | |
| 203 | Set Host Time With Split And NTP |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 204 | [Documentation] Set host time when time owner is split and time mode is |
| 205 | ... NTP. |
| 206 | [Tags] Set_Host_Time_With_Split_And_NTP |
| 207 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 208 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 209 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 210 | #Operation Owner Mode Status BMC Time HOST Time |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 211 | Set Host Time ${SPLIT_OWNER} ${NTP_MODE} ok No Change Set |
| 212 | |
| 213 | |
| 214 | Set Host Time With BMC And Manual |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 215 | [Documentation] Set host time when time owner is BMC and time mode is |
| 216 | ... Manual. |
| 217 | [Tags] Set_Host_Time_With_BMC_And_Manual |
| 218 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 219 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 220 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 221 | #Operation Owner Mode Status BMC Time HOST Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 222 | Set Host Time ${BMC_OWNER} ${MANUAL_MODE} error No Change Not Set |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 223 | |
| 224 | |
| 225 | Set Host Time With BMC Owner NTP |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 226 | [Documentation] Set host time when time owner is BMC and time mode is |
| 227 | ... NTP. |
George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 228 | [Tags] Set_Host_Time_With_BMC_Owner_NTP |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 229 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 230 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 231 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 232 | #Operation Owner Mode Status BMC Time HOST Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 233 | Set Host Time ${BMC_OWNER} ${NTP_MODE} error No Change Not Set |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 234 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 235 | |
| 236 | Set Host Time With Host And NTP |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 237 | [Documentation] Set host time when time owner is Host and time mode is |
| 238 | ... NTP. |
| 239 | [Tags] Set_Host_Time_With_Host_And_NTP |
| 240 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 241 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 242 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 243 | #Operation Owner Mode Status BMC Time Host Time |
Rahul Maheshwari | 8cc4717 | 2018-09-06 01:46:50 -0500 | [diff] [blame] | 244 | Set Host Time ${HOST_OWNER} ${NTP_MODE} error Not Change No Set |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 245 | |
| 246 | |
Rahul Maheshwari | 52d9294 | 2019-01-21 10:54:52 -0600 | [diff] [blame] | 247 | Set Host Time With Both And Manual |
| 248 | [Documentation] Set host time when time owner is both and time mode is |
| 249 | ... manual. |
| 250 | [Tags] Set_Host_Time_With_Both_And_Manual |
| 251 | [Template] Set Time Using REST |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 252 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | 52d9294 | 2019-01-21 10:54:52 -0600 | [diff] [blame] | 253 | |
| 254 | #Operation Owner Mode Status BMC Time Host Time |
| 255 | Set Host Time ${BOTH_OWNER} ${MANUAL_MODE} ok Change Set |
| 256 | |
| 257 | |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 258 | Set Invalid Time Mode |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 259 | [Documentation] Set time mode with invalid value using REST and verify |
| 260 | ... that it should throw error. |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 261 | [Tags] Set_Invalid_Time_Mode |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 262 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 263 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 264 | ${timemode}= |
| 265 | ... Set Variable xyz.openbmc_project.Time.Synchronization.Method.abc |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 266 | ${valueDict}= Create Dictionary data=${timemode} |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 267 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 268 | ${resp}= OpenBMC Put Request |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 269 | ... ${TIME_MANAGER_URI}sync_method/attr/TimeSyncMethod data=${valueDict} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 270 | ${jsondata}= to JSON ${resp.content} |
| 271 | Should Be Equal ${jsondata['status']} error |
| 272 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 273 | ${mode}= Read Attribute ${TIME_MANAGER_URI}sync_method TimeSyncMethod |
| 274 | Should Not Be Equal ${mode} |
| 275 | ... xyz.openbmc_project.Time.Synchronization.Method.abc |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 276 | |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 277 | |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 278 | Set Invalid Time Owner |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 279 | [Documentation] Set time owner with invalid value using REST and verify |
| 280 | ... that it should throw error. |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 281 | [Tags] Set_Invalid_Time_Owner |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 282 | [Teardown] Run Keywords Set Time Owner ${BMC_OWNER} AND Post Test Case Execution |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 283 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 284 | ${timeowner}= Set Variable xyz.openbmc_project.Time.Owner.Owners.xyz |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 285 | ${valueDict}= Create Dictionary data=${timeowner} |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 286 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 287 | ${resp}= OpenBMC Put Request |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 288 | ... ${TIME_MANAGER_URI}owner/attr/TimeOwner data=${valueDict} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 289 | ${jsondata}= to JSON ${resp.content} |
| 290 | Should Be Equal ${jsondata['status']} error |
| 291 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 292 | ${owner}= Read Attribute ${TIME_MANAGER_URI}owner TimeOwner |
| 293 | Should Not Be Equal ${owner} xyz.openbmc_project.Time.Owner.Owners.xyz |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 294 | |
| 295 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 296 | *** Keywords *** |
| 297 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 298 | Get BMC Time Using IPMI |
| 299 | [Documentation] Returns BMC time of the system via IPMI |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 300 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 301 | ${stdout} ${stderr} ${output}= |
| 302 | ... Execute Command date "+%m/%d/%Y %H:%M:%S" |
| 303 | ... return_stdout=True return_stderr= True return_rc=True |
| 304 | Should Be Equal ${output} ${0} msg=${stderr} |
| 305 | |
| 306 | ${resp}= Convert Date ${stdout} date_format=%m/%d/%Y %H:%M:%S |
| 307 | ... exclude_millis=yes |
| 308 | Should Not Be Empty ${resp} |
| 309 | [Return] ${resp} |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 310 | |
Rahul Maheshwari | 52d9294 | 2019-01-21 10:54:52 -0600 | [diff] [blame] | 311 | |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 312 | Set Time Owner |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 313 | [Arguments] ${args} |
| 314 | [Documentation] Set time owner of the system via REST |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 315 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 316 | ${timeowner}= Set Variable ${args} |
| 317 | ${valueDict}= Create Dictionary data=${timeowner} |
| 318 | |
| 319 | ${resp}= OpenBMC Put Request |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 320 | ... ${TIME_MANAGER_URI}owner/attr/TimeOwner data=${valueDict} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 321 | ${jsondata}= to JSON ${resp.content} |
| 322 | |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 323 | ${host_state}= Get Host State |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 324 | |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 325 | Run Keyword If '${host_state}' == 'Off' |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 326 | ... Log System is in off state so owner change will get applied. |
| 327 | ... ELSE Run keyword |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 328 | ... Initiate Host PowerOff |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 329 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 330 | ${owner}= Read Attribute ${TIME_MANAGER_URI}owner TimeOwner |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 331 | Should Be Equal ${owner} ${args} |
| 332 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 333 | [Return] ${jsondata['status']} |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 334 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 335 | |
Tony Lee | 3829a2b | 2020-06-09 17:03:04 +0800 | [diff] [blame] | 336 | Verify Set Time Via REST |
| 337 | [Documentation] Verify set time via REST. |
| 338 | [Arguments] ${target} ${expected_status} |
| 339 | # Description of argument(s): |
| 340 | # target The target of the set time operation: "bmc" or "host". |
| 341 | # expected_status Expected status of set time operation |
| 342 | |
| 343 | ${time_owner_url}= Set Variable ${TIME_MANAGER_URI}${target} |
| 344 | |
| 345 | ${args}= Create Dictionary data=${SYSTEM_TIME_VALID_EPOCH} |
| 346 | ${resp}= OpenBMC Put Request |
| 347 | ... ${time_owner_url}/attr/Elapsed data=${args} |
| 348 | ${jsondata}= to Json ${resp.content} |
| 349 | Run Keyword If "${expected_status}" == "ok" |
| 350 | ... Should Not Be Equal As Strings ${jsondata['message']} 403 Forbidden |
| 351 | Should Be Equal As Strings ${jsondata['status']} ${expected_status} |
| 352 | |
| 353 | |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 354 | Set Time Mode |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 355 | [Arguments] ${args} |
| 356 | [Documentation] Set time mode of the system via REST |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 357 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 358 | ${timemode}= Set Variable ${args} |
| 359 | ${valueDict}= Create Dictionary data=${timemode} |
| 360 | |
| 361 | ${resp}= OpenBMC Put Request |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 362 | ... ${TIME_MANAGER_URI}sync_method/attr/TimeSyncMethod data=${valueDict} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 363 | ${jsondata}= to JSON ${resp.content} |
| 364 | Sleep 5s |
| 365 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 366 | ${mode}= Read Attribute ${TIME_MANAGER_URI}sync_method TimeSyncMethod |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 367 | Should Be Equal ${mode} ${args} |
| 368 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 369 | |
| 370 | Get BMC Time Using REST |
| 371 | [Documentation] Returns BMC time of the system via REST |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 372 | ... Time Format : epoch time in microseconds |
| 373 | ... e.g 1507809604687329 |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 374 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 375 | ${resp}= Read Attribute ${TIME_MANAGER_URI}/bmc Elapsed |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 376 | [Return] ${resp} |
| 377 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 378 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 379 | Get HOST Time Using REST |
| 380 | [Documentation] Returns HOST time of the system via REST |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 381 | ... Time Format : epoch time in microseconds |
| 382 | ... e.g 1507809604687329 |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 383 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 384 | ${resp}= Read Attribute ${TIME_MANAGER_URI}/host Elapsed |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 385 | [Return] ${resp} |
| 386 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 387 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 388 | Set Time Using REST |
| 389 | [Arguments] ${operation} ${owner} ${mode} ${status} ${bmc_time} |
| 390 | ... ${host_time} |
| 391 | [Documentation] Set BMC or Host time on system via REST. |
| 392 | ... Description of arguments: |
| 393 | ... operation : Set BMC/Host time |
| 394 | ... owner: Time owner |
| 395 | ... mode: Time mode |
| 396 | ... status: Expected status of set BMC time URI |
| 397 | ... bmc_time: Status of BMC time after operation |
| 398 | ... host_time: Status of HOST time after operation |
| 399 | ... Set - Given time is set |
| 400 | ... Not Set - Given time is not set |
| 401 | ... Change - time is change |
| 402 | ... No Change - time is not change |
| 403 | |
| 404 | Set Time Owner ${owner} |
| 405 | Set Time Mode ${mode} |
| 406 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 407 | ${setdate}= Set Variable ${SYSTEM_TIME_VALID_EPOCH} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 408 | |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 409 | ${start_time}= Get Current Date |
| 410 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 411 | ${old_bmc_time}= Get BMC Time Using REST |
| 412 | ${old_host_time}= Get HOST Time Using REST |
| 413 | |
Rahul Maheshwari | 52d9294 | 2019-01-21 10:54:52 -0600 | [diff] [blame] | 414 | Run Keyword If '${operation}' == 'Set BMC Time' |
| 415 | ... Wait Until Keyword Succeeds 1 min 20 sec Verify Set Time Via REST |
| 416 | ... bmc ${status} |
| 417 | ... ELSE IF '${operation}' == 'Set Host Time' |
| 418 | ... Wait Until Keyword Succeeds 1 min 20 sec Verify Set Time Via REST |
| 419 | ... host ${status} |
| 420 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 421 | |
| 422 | ${new_bmc_time}= Get BMC Time Using REST |
| 423 | ${new_host_time}= Get HOST Time Using REST |
| 424 | |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 425 | ${end_time}= Get Current Date |
| 426 | ${time_duration}= Subtract Date From Date ${start_time} ${end_time} |
| 427 | ${time_duration} Evaluate abs(${time_duration}) |
| 428 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 429 | # Convert epoch to date format: YYYY-MM-DD hh:mm:ss.mil |
| 430 | ${setdate}= Convert epoch to date ${setdate} |
| 431 | ${new_bmc_time}= Convert epoch to date ${new_bmc_time} |
| 432 | ${old_bmc_time}= Convert epoch to date ${old_bmc_time} |
| 433 | ${new_host_time}= Convert epoch to date ${new_host_time} |
| 434 | ${old_host_time}= Convert epoch to date ${old_host_time} |
| 435 | |
| 436 | |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 437 | ${bmc_diff_set_new}= |
| 438 | ... Subtract Date From Date ${setdate} ${new_bmc_time} |
| 439 | ${bmc_diff_set_new}= Evaluate abs(${bmc_diff_set_new}) |
| 440 | ${bmc_diff_old_new}= |
| 441 | ... Subtract Date From Date ${old_bmc_time} ${new_bmc_time} |
| 442 | ${bmc_diff_old_new}= Evaluate abs(${bmc_diff_old_new}) |
| 443 | |
| 444 | ${host_diff_set_new}= |
| 445 | ... Subtract Date From Date ${setdate} ${new_host_time} |
| 446 | ${host_diff_set_new}= Evaluate abs(${host_diff_set_new}) |
| 447 | ${host_diff_old_new}= |
| 448 | ... Subtract Date From Date ${old_host_time} ${new_host_time} |
| 449 | ${host_diff_old_new}= Evaluate abs(${host_diff_old_new}) |
| 450 | |
| 451 | Run Keyword If '${bmc_time}' == 'Not Set' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 452 | ... Should Be True ${bmc_diff_set_new} >= ${time_duration} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 453 | ... ELSE IF '${bmc_time}' == 'Set' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 454 | ... Should Be True ${bmc_diff_set_new} <= ${time_duration} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 455 | ... ELSE IF '${bmc_time}' == 'No Change' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 456 | ... Should Be True ${bmc_diff_old_new} <= ${time_duration} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 457 | ... ELSE IF '${bmc_time}' == 'Change' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 458 | ... Should Be True ${bmc_diff_old_new} >= ${time_duration} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 459 | |
| 460 | Run Keyword If '${host_time}' == 'No Change' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 461 | ... Should Be True ${host_diff_old_new} <= ${time_duration} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 462 | ... ELSE IF '${host_time}' == 'Change' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 463 | ... Should Be True ${host_diff_old_new} >= ${time_duration} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 464 | ... ELSE IF '${host_time}' == 'Not Set' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 465 | ... Should Be True ${host_diff_set_new} >= ${time_duration} |
Rahul Maheshwari | f878590 | 2016-12-12 01:23:13 -0600 | [diff] [blame] | 466 | ... ELSE IF '${host_time}' == 'Set' |
Sridevi Ramesh | ae44482 | 2017-02-13 05:51:52 -0600 | [diff] [blame] | 467 | ... Should Be True ${host_diff_set_new} <= ${time_duration} |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 468 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 469 | Convert epoch to date |
| 470 | [Documentation] Convert epoch time to date format. |
| 471 | [Arguments] ${epoch_time} |
| 472 | # Description of argument(s): |
Rahul Maheshwari | 7e86332 | 2018-02-02 06:03:06 -0600 | [diff] [blame] | 473 | # epoch_time epoch time in milliseconds. |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 474 | # (e.g. 1487304700000000) |
| 475 | |
Rahul Maheshwari | 7e86332 | 2018-02-02 06:03:06 -0600 | [diff] [blame] | 476 | # Convert epoch_time into floating point number. |
| 477 | ${epoch_time}= Convert To Number ${epoch_time} |
| 478 | |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 479 | # Convert epoch time from microseconds to seconds |
| 480 | ${epoch_time_sec}= Evaluate ${epoch_time}/1000000 |
| 481 | |
| 482 | # Convert epoch time to date format: YYYY-MM-DD hh:mm:ss.mil |
| 483 | # e.g. 2017-02-16 22:14:11.000 |
| 484 | ${date}= Convert Date ${epoch_time_sec} |
| 485 | |
| 486 | [Return] ${date} |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 487 | |
Rahul Maheshwari | 52d9294 | 2019-01-21 10:54:52 -0600 | [diff] [blame] | 488 | |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 489 | Post Test Case Execution |
| 490 | [Documentation] Do the post test teardown. |
| 491 | ... 1. Capture FFDC on test failure. |
| 492 | ... 2. Sets defaults for time mode and owner. |
| 493 | ... 3. Close all open SSH connections. |
Rahul Maheshwari | 93f6809 | 2016-10-24 02:42:12 -0500 | [diff] [blame] | 494 | |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 495 | FFDC On Test Case Fail |
Rahul Maheshwari | f486ae8 | 2017-10-24 06:10:14 -0500 | [diff] [blame] | 496 | Set Time Mode ${NTP_MODE} |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 497 | Close All Connections |