blob: e501079abb1ed989a51f7412878056ef16c0526f [file] [log] [blame]
Charles Paul Hoferbbc0f202017-09-29 11:48:39 -05001*** Settings ***
2Documentation Test SBE side switching with watchdog errors.
3
4Library ../lib/state.py
5Library ../lib/utils.py
6Variables ../data/variables.py
7Resource ../lib/boot_utils.robot
8
9*** Test Cases ***
10
11Test SBE Side Switch
12 [Documentation] Trigger watchdog errors on the host until it side
13 ... switches.
14 [Tags] Test_SBE_Side_Switch
15
16 Delete All Error Logs
17 Set Auto Reboot ${1}
18 REST Power On
19
20 Start Journal Log
21
22 ${attempts_left}= Read Attribute /xyz/openbmc_project/state/host0
23 ... AttemptsLeft
24 Should Be Equal As Strings ${attempts_left} 2
25 Trigger Host Watchdog Error
26 Wait For Host Reboot
27 ${attempts_left}= Read Attribute /xyz/openbmc_project/state/host0
28 ... AttemptsLeft
29 Should Be Equal As Strings ${attempts_left} 1
30 Trigger Host Watchdog Error
31 Wait For Host Reboot
32 ${attempts_left}= Read Attribute /xyz/openbmc_project/state/host0
33 ... AttemptsLeft
34 Should Be Equal As Strings ${attempts_left} 0
35
36 # Verify the side switched
37 ${journal_text}= Stop Journal Log
38 Should Contain ${journal_text} Setting SBE seeprom side to 1
39
40
41*** Keywords ***
42
43Wait For Host Reboot
44 [Documentation] Wait for the host to reboot.
45
46 ${match_state}= Create Dictionary host=^Off$
47 Wait State ${match_state} wait_time=5 min
48 ${match_state}= Create Dictionary host=^Running$
49 Wait State ${match_state} wait_time=5 min