George Keishing | 678b65c | 2017-08-31 16:16:39 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Suite for testing non sensors. |
| 3 | |
| 4 | Library ../lib/state_map.py |
| 5 | Resource ../lib/utils.robot |
| 6 | Resource ../lib/boot_utils.robot |
| 7 | Resource ../lib/state_manager.robot |
| 8 | Resource ../lib/openbmc_ffdc.robot |
| 9 | |
| 10 | Test Teardown Post Test Case Execution |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
| 14 | ${stack_mode} skip |
| 15 | |
| 16 | *** Test Cases *** |
| 17 | |
George Keishing | b3a4a48 | 2017-09-29 03:50:02 -0500 | [diff] [blame] | 18 | Verify Boot AttemptsLeft At Standby |
George Keishing | 678b65c | 2017-08-31 16:16:39 -0500 | [diff] [blame] | 19 | [Documentation] Verify system boot attempts on various boot states. |
George Keishing | b3a4a48 | 2017-09-29 03:50:02 -0500 | [diff] [blame] | 20 | [Tags] Verify_Boot_AttemptsLeft_At_Standby |
George Keishing | 678b65c | 2017-08-31 16:16:39 -0500 | [diff] [blame] | 21 | [Template] Validate Boot AttemptsLeft |
| 22 | |
| 23 | # Example: Expected state |
| 24 | # "data": { |
| 25 | # "/xyz/openbmc_project/state/host0": { |
| 26 | # "AttemptsLeft": 3, |
| 27 | # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified", |
| 28 | # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off", |
| 29 | # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive", |
| 30 | # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off" |
| 31 | # } |
| 32 | # } |
| 33 | |
| 34 | # System at standby AttemptsLeft |
| 35 | Reboot 3 |
George Keishing | b3a4a48 | 2017-09-29 03:50:02 -0500 | [diff] [blame] | 36 | |
| 37 | |
| 38 | Verify Boot AttemptsLeft At Host Booted |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 39 | [Documentation] Verify the number of Host boot attempts left. |
George Keishing | b3a4a48 | 2017-09-29 03:50:02 -0500 | [diff] [blame] | 40 | [Tags] Verify_Boot_AttemptsLeft_At_Host_Booted |
| 41 | [Template] Validate Boot AttemptsLeft |
| 42 | |
| 43 | # System at standby AttemptsLeft |
| 44 | Booted 3 |
| 45 | |
| 46 | |
| 47 | Verify Boot AttemptsLeft When Host Reboot |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 48 | [Documentation] Verify the number of Host reboots left. |
George Keishing | b3a4a48 | 2017-09-29 03:50:02 -0500 | [diff] [blame] | 49 | [Tags] Verify_Boot_AttemptsLeft_When_Host_Reboot |
| 50 | [Template] Validate Boot AttemptsLeft |
| 51 | |
| 52 | # System at standby AttemptsLeft |
| 53 | RebootHost 2 |
| 54 | |
| 55 | |
| 56 | Verify Boot AttemptsLeft When Power Off |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 57 | [Documentation] Verify the number of boots left while the system is poweref off. |
George Keishing | a2a6b57 | 2018-03-28 04:51:18 -0500 | [diff] [blame] | 58 | [Tags] Verify_Boot_AttemptsLeft_When_Power_Off |
George Keishing | b3a4a48 | 2017-09-29 03:50:02 -0500 | [diff] [blame] | 59 | [Template] Validate Boot AttemptsLeft |
| 60 | |
| 61 | # System at standby AttemptsLeft |
| 62 | Ready 2 |
George Keishing | 678b65c | 2017-08-31 16:16:39 -0500 | [diff] [blame] | 63 | |
| 64 | |
| 65 | Verify Boot Sensor States At Ready |
| 66 | [Documentation] Verify system boot states at "Ready" state. |
| 67 | [Tags] Verify_Boot_Sensor_States_At_Ready |
| 68 | [Template] Valid Boot States |
| 69 | |
| 70 | # Example: Expected state |
| 71 | # "data": { |
| 72 | # "/xyz/openbmc_project/state/bmc0": { |
| 73 | # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready", |
| 74 | # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None" |
| 75 | # }, |
| 76 | # "/xyz/openbmc_project/state/chassis0": { |
| 77 | # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.Off", |
| 78 | # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off" |
| 79 | # }, |
| 80 | # "/xyz/openbmc_project/state/host0": { |
| 81 | # "AttemptsLeft": 3, |
| 82 | # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified", |
| 83 | # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off", |
| 84 | # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive", |
| 85 | # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off" |
| 86 | # } |
| 87 | # } |
| 88 | |
| 89 | # System at standby. |
| 90 | Off |
| 91 | |
| 92 | |
| 93 | Verify Boot Sensor States On Reboot Ready |
| 94 | [Documentation] Verify system boot states at "Ready" state. |
| 95 | [Tags] Verify_Boot_Sensor_States_On_Reboot_Ready |
| 96 | [Template] Valid Boot States |
| 97 | |
| 98 | # Example: Expected state |
| 99 | # "data": { |
| 100 | # "/xyz/openbmc_project/state/bmc0": { |
| 101 | # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready", |
| 102 | # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None" |
| 103 | # }, |
| 104 | # "/xyz/openbmc_project/state/chassis0": { |
| 105 | # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.Off", |
| 106 | # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off" |
| 107 | # }, |
| 108 | # "/xyz/openbmc_project/state/host0": { |
| 109 | # "AttemptsLeft": 3, |
| 110 | # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified", |
| 111 | # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off", |
| 112 | # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive", |
| 113 | # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off" |
| 114 | # } |
| 115 | # } |
| 116 | |
| 117 | # BMC on reset to standby. |
| 118 | Reboot |
| 119 | |
| 120 | |
| 121 | Verify Boot Sensor States At Running |
| 122 | [Documentation] Verify system boot states at "Running" state. |
| 123 | [Tags] Verify_Boot_Sensor_States_At_Running |
| 124 | [Template] Valid Boot States |
| 125 | |
| 126 | # Example: Expected state |
| 127 | # "data": { |
| 128 | # "/xyz/openbmc_project/state/bmc0": { |
| 129 | # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready", |
| 130 | # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None" |
| 131 | # }, |
| 132 | # "/xyz/openbmc_project/state/chassis0": { |
| 133 | # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.On", |
| 134 | # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off" |
| 135 | # }, |
| 136 | # "/xyz/openbmc_project/state/host0": { |
| 137 | # "AttemptsLeft": 2, |
| 138 | # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.MotherboardInit", |
| 139 | # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Running", |
| 140 | # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive", |
| 141 | # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.On" |
| 142 | # } |
| 143 | # } |
| 144 | |
| 145 | # System at Running state but during initial state. |
| 146 | Running |
| 147 | |
| 148 | |
| 149 | Verify Boot Sensor States At Host Booted |
| 150 | [Documentation] Verify system boot states when host is booted. |
| 151 | [Tags] Verify_Boot_Sensor_States_At_Host_Booted |
| 152 | [Template] Valid Boot States |
| 153 | |
| 154 | # Example: Expected state |
| 155 | # "data": { |
| 156 | # "/xyz/openbmc_project/state/bmc0": { |
| 157 | # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready", |
| 158 | # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None" |
| 159 | # }, |
| 160 | # "/xyz/openbmc_project/state/chassis0": { |
| 161 | # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.On", |
| 162 | # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off" |
| 163 | # }, |
| 164 | # "/xyz/openbmc_project/state/host0": { |
| 165 | # "AttemptsLeft": 3, |
| 166 | # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart", |
| 167 | # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Running", |
| 168 | # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete", |
| 169 | # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.On" |
| 170 | # } |
| 171 | # } |
| 172 | |
| 173 | # System when host is booted. |
| 174 | Booted |
| 175 | |
| 176 | |
| 177 | Verify Boot Sensor States RR on Host Booted |
| 178 | [Documentation] Verify system boot states post BMC reset. |
| 179 | [Tags] Verify_Boot_Sensor_States_RR_on_Host_Booted |
| 180 | [Template] Valid Boot States |
| 181 | |
| 182 | # Example: Expected state |
| 183 | # "data": { |
| 184 | # "/xyz/openbmc_project/state/bmc0": { |
| 185 | # "CurrentBMCState": "xyz.openbmc_project.State.BMC.BMCState.Ready", |
| 186 | # "RequestedBMCTransition": "xyz.openbmc_project.State.BMC.Transition.None" |
| 187 | # }, |
| 188 | # "/xyz/openbmc_project/state/chassis0": { |
| 189 | # "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.On", |
| 190 | # "RequestedPowerTransition": "xyz.openbmc_project.State.Chassis.Transition.Off" |
| 191 | # }, |
| 192 | # "/xyz/openbmc_project/state/host0": { |
| 193 | # "AttemptsLeft": 3, |
| 194 | # "BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart", |
| 195 | # "CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Running", |
| 196 | # "OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete", |
| 197 | # "RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.On" |
| 198 | # } |
| 199 | # } |
| 200 | |
| 201 | # System when host is booted. |
| 202 | ResetReload |
| 203 | |
| 204 | |
| 205 | *** Keywords *** |
| 206 | |
| 207 | Validate Boot AttemptsLeft |
| 208 | [Documentation] Verify boot attempts for a given system state. |
| 209 | [Arguments] ${sys_state} ${expected_attempts_left} |
| 210 | |
| 211 | # Description of argument(s): |
| 212 | # sys_state A user-defined boot state (e.g. "Off", "On", etc). |
| 213 | # See VALID_BOOT_STATES in state_map.py. |
| 214 | # expected_attempts_left Boot attempts left. |
| 215 | |
| 216 | Choose Boot And Run ${sys_state} |
| 217 | ${atempts_left}= Read Attribute ${HOST_STATE_URI} AttemptsLeft |
| 218 | Should Be True ${atempts_left} == ${expected_attempts_left} |
| 219 | |
| 220 | |
| 221 | Valid Boot States |
| 222 | [Documentation] Verify boot states for a given system state. |
| 223 | [Arguments] ${sys_state} |
| 224 | |
| 225 | # Description of argument(s): |
| 226 | # sys_state A user-defined boot state (e.g. "Off", "On", etc). |
| 227 | # See VALID_BOOT_STATES in state_map.py. |
| 228 | |
| 229 | Choose Boot And Run ${sys_state} |
| 230 | ${boot_states}= Get Boot State |
| 231 | ${valid_state}= Valid Boot State ${sys_state} ${boot_states} |
| 232 | Should Be True ${valid_state} |
| 233 | |
| 234 | |
| 235 | Choose Boot And Run |
| 236 | [Documentation] Choose system boot type. |
| 237 | [Arguments] ${option} |
| 238 | |
| 239 | # Description of argument(s): |
| 240 | # option Boot type (e.g. "Off", "On", "Reboot", etc.). |
| 241 | |
| 242 | Run Keyword If '${option}' == 'Off' |
| 243 | ... Initiate Host PowerOff |
| 244 | ... ELSE IF '${option}' == 'Reboot' |
| 245 | ... Run Keywords Initiate Host PowerOff AND Initiate BMC Reboot |
| 246 | ... AND Wait For BMC Ready |
| 247 | ... ELSE IF '${option}' == 'Running' |
| 248 | ... Power On Till Chassis Is On |
| 249 | ... ELSE IF '${option}' == 'Booted' |
| 250 | ... Initiate Host Boot |
| 251 | ... ELSE IF '${option}' == 'RebootHost' |
| 252 | ... Initiate Host Reboot |
| 253 | ... ELSE IF '${option}' == 'ResetReload' |
| 254 | ... Reboot Host And Expect Runtime |
| 255 | |
| 256 | |
| 257 | Power On Till Chassis Is On |
| 258 | [Documentation] Initiate power on and check till chassis state is just |
| 259 | ... turned "On". |
| 260 | |
| 261 | # TODO: Move to smart power off once ready. |
| 262 | Initiate Host PowerOff |
| 263 | Initiate Host Boot wait=${0} |
| 264 | Wait Until Keyword Succeeds 2 min 10 sec Is Chassis On |
| 265 | |
| 266 | # TODO: Find better mechanism instead of wait. |
| 267 | Sleep 20 Sec |
| 268 | |
| 269 | |
| 270 | Reboot Host And Expect Runtime |
| 271 | [Documentation] Initiate reset reload when host is booted. |
| 272 | |
| 273 | Initiate BMC Reboot |
| 274 | Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted |
George Keishing | b39a679 | 2017-11-10 22:58:52 -0600 | [diff] [blame] | 275 | Verify BMC RTC And UTC Time Drift |
George Keishing | 678b65c | 2017-08-31 16:16:39 -0500 | [diff] [blame] | 276 | |
| 277 | |
| 278 | Post Test Case Execution |
| 279 | [Documentation] Do the post test teardown. |
| 280 | # - Capture FFDC on test failure. |
| 281 | # - Delete error logs. |
| 282 | # - Close all open SSH connections. |
| 283 | # - Clear all REST sessions. |
| 284 | |
| 285 | FFDC On Test Case Fail |
| 286 | Delete Error Logs |
| 287 | Close All Connections |
| 288 | |