blob: 6c0d047b3a70b525b7af11a8a85de4902752bcb0 [file] [log] [blame]
Rahul Maheshwari982fee42017-05-03 00:33:15 -05001*** Settings ***
2Documentation This suite tests IPMI SOL in OpenBMC.
3
4Resource ../../lib/ipmi_client.robot
5Resource ../../lib/openbmc_ffdc.robot
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -05006Library ../../lib/ipmi_utils.py
Rahul Maheshwari982fee42017-05-03 00:33:15 -05007
8Test Teardown Post Test Case Execution
9
10*** Variables ***
11
12*** Test Cases ***
13
14Verify SOL During Boot
15 [Documentation] Verify SOL during boot.
16 [Tags] Verify_SOL_During_Boot
17
18 ${current_state}= Get Host State Via External IPMI
Rahul Maheshwaricd441b82017-06-01 13:42:35 -050019 Run Keyword If '${current_state}' == 'on'
Rahul Maheshwari982fee42017-05-03 00:33:15 -050020 ... Initiate Host PowerOff Via External IPMI
21 Initiate Host Boot Via External IPMI wait=${0}
22
23 Activate SOL Via IPMI
24 Wait Until Keyword Succeeds 10 mins 30 secs
25 ... Check IPMI SOL Output Content Petitboot
26
27Verify Deactivate Non Existing SOL
28 [Documentation] Verify deactivate non existing SOL session.
29 [Tags] Verify_Deactivate_Non_Existing_SOL
30
31 ${resp}= Deactivate SOL Via IPMI
32 Should Contain ${resp} SOL payload already de-activated
33 ... case_insensitive=True
34
35
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -050036Set Valid SOL Retry Count
37 # Description of template fields:
38 # Setting name Min valid value Max valid value
39 retry-count 0 7
40 [Documentation] Verify valid SOL's retry count via IPMI.
41 [Tags] Set_Valid_SOL_Retry_Count
42
43 [Template] Verify SOL Setting
44
45
46Set Valid SOL Retry Interval
47 # Description of template fields:
48 # Setting name Min valid value Max valid value
49 retry-interval 0 255
50 [Documentation] Verify valid SOL's retry interval via IPMI.
51 [Tags] Set_Valid_SOL_Retry_Interval
52
53 [Template] Verify SOL Setting
54
55
56Set Valid SOL Character Accumulate Level
57 # Description of template fields:
58 # Setting name Min valid value Max valid value
59 character-accumulate-level 1 255
60 [Documentation] Verify valid SOL's character accumulate level via IPMI.
61 [Tags] Set_Valid_SOL_Character_Accumulate_Level
62
63 [Template] Verify SOL Setting
64
65
66Set Valid SOL Character Send Threshold
67 # Description of template fields:
68 # Setting name Min valid value Max valid value
69 character-send-threshold 0 255
70 [Documentation] Verify valid SOL's character send threshold via IPMI.
71 [Tags] Set_Valid_SOL_Character_Send_Threshold
72
73 [Template] Verify SOL Setting
74
75
Rahul Maheshwari982fee42017-05-03 00:33:15 -050076*** Keywords ***
77
Rahul Maheshwari982fee42017-05-03 00:33:15 -050078Check IPMI SOL Output Content
79 [Documentation] Check if SOL has given content.
80 [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST}
81 # Description of argument(s):
82 # data Content which need to be checked(e.g. Petitboot, ISTEP).
83 # file_path The file path on the local machine to check SOL content.
84 # By default it check SOL content from /tmp/sol_<BMC_IP>.
85
86 ${rc} ${output}= Run and Return RC and Output cat ${file_path}
87 Should Be Equal ${rc} ${0} msg=${output}
88
89 Should Contain ${output} ${data} case_insensitive=True
Rahul Maheshwarid629b5c2017-05-23 08:06:28 -050090
91
92Verify SOL Setting
93 [Documentation] Verify SOL Setting via IPMI.
94 [Arguments] ${setting_name} ${min_value} ${max_value}
95 # Description of Arguments:
96 # setting_name Setting to verify (e.g. "retry-count").
97 # min_value min valid value for given setting.
98 # max_value max valid value for given setting.
99
100 ${value}=
101 ... Evaluate random.randint(${min_value}, ${max_value}) modules=random
102
103 # Character accumulate level setting is set in multiples of 5.
104 # Retry interval setting is set in multiples of 10.
105 # Reference IPMI specification v2.0
106
107 ${expected_value}= Run Keyword If
108 ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5
109 ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10
110 ... ELSE Set Variable ${value}
111
112 Set SOL Setting ${setting_name} '${value}'
113
114 # Replace "-" with space " " in setting name.
115 # E.g. "retry-count" to "retry count"
116 ${setting_name}= Evaluate $setting_name.replace('-',' ')
117
118 ${sol_info_dict}= Get SOL Info
119
120 # Get exact SOL setting name from sol info output.
121 ${list}= Get Matches ${sol_info_dict} ${setting_name}*
122 ... case_insensitive=${True}
123 ${setting_name_from_dict}= Get From List ${list} 0
124
125 # Get SOL setting value from above setting name.
126 ${setting_value}= Get From Dictionary
127 ... ${sol_info_dict} ${setting_name_from_dict}
128
129 Should Be Equal '${setting_value}' '${expected_value}'
130
131 # Power on host to check if SOL is working fine with new setting.
132 ${current_state}= Get Host State Via External IPMI
133 Run Keyword If '${current_state}' == 'on'
134 ... Initiate Host PowerOff Via External IPMI
135 Initiate Host Boot Via External IPMI wait=${0}
136
137 Activate SOL Via IPMI
138 Wait Until Keyword Succeeds 10 mins 30 secs
139 ... Check IPMI SOL Output Content Petitboot
140
141
142Restore Default SOL Configuration
143 [Documentation] Restore default SOL configuration.
144
145 Open Connection And Log In
146
147 Set SOL Setting retry-count 7
148 Set SOL Setting retry-interval 10
149 Set SOL Setting character-accumulate-level 20
150 Set SOL Setting character-send-threshold 1
151
152 Close All Connections
153
154
155Post Test Case Execution
156 [Documentation] Do the post test teardown.
157
158 Deactivate SOL Via IPMI
159 FFDC On Test Case Fail
160 Restore Default SOL Configuration