blob: 6af146b2cd265531c1afdde92c3a09e54ec78788 [file] [log] [blame]
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -05001*** Settings ***
2Documentation This suite is for testing general IPMI functions.
3
4Resource ../../lib/ipmi_client.robot
5Resource ../../lib/openbmc_ffdc.robot
6
7Test Teardown FFDC On Test Case Fail
8
9*** Variables ***
10
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -060011${new_mc_id}= HOST
12
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -050013*** Test Cases ***
14
15Set Asset Tag With Valid String Length
16 [Documentation] Set asset tag with valid string length and verify.
17 [Tags] Set_Asset_Tag_With_Valid_String_Length
18
19 # Allowed MAX characters length for asset tag name is 63.
20 ${random_string}= Generate Random String 63
21 Run Keyword Run IPMI Standard Command dcmi set_asset_tag ${random_string}
22
23 ${asset_tag}= Run Keyword Run IPMI Standard Command dcmi asset_tag
24 Should Contain ${asset_tag} ${random_string}
25
26
27Set Asset Tag With Invalid String Length
28 [Documentation] Verify error while setting invalid asset tag via IPMI.
29 [Tags] Set_Asset_Tag_With_Invalid_String_Length
30
31 # Any string more than 63 character is invalid for asset tag.
32 ${random_string}= Generate Random String 64
33
34 ${resp}= Run Keyword And Expect Error * Run IPMI Standard Command
35 ... dcmi set_asset_tag ${random_string}
36 Should Contain ${resp} Parameter out of range ignore_case=True
37
38
39Set Asset Tag With Valid String Length Via REST
40 [Documentation] Set valid asset tag via REST and verify.
41 [Tags] Set_Asset_Tag_With_Valid_String_Length_Via_REST
42
43 ${random_string}= Generate Random String 63
44 ${args}= Create Dictionary data=${random_string}
45 Write Attribute /xyz/openbmc_project/inventory/system AssetTag
46 ... data=${args}
47
48 ${asset_tag}= Read Attribute /xyz/openbmc_project/inventory/system
49 ... AssetTag
50 Should Be Equal As Strings ${asset_tag} ${random_string}
51
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -060052Verify Get And Set Management Controller ID String
53 [Documentation] Verify get and set management controller ID string.
54 [Tags] Verify_Get_And_Set_Management_Controller_ID_String
55
56 # Get the value of the managemment controller ID string.
57 # Example:
58 # Get Management Controller Identifier String: witherspoon
59
60 ${cmd_output}= Run IPMI Standard Command dcmi get_mc_id_string
61
62 # Extract management controller ID from cmd_output.
63 ${initial_mc_id}= Fetch From Right ${cmd_output} :${SPACE}
64
65 # Set the management controller ID string to other value.
66 # Example:
67 # Set Management Controller Identifier String Command: HOST
68
69 Set Management Controller ID String ${new_mc_id}
70
71 # Get the management controller ID and verify.
72 Get Management Controller ID String And Verify ${new_mc_id}
73
74 # Set the value back to the initial value and verify.
75 Set Management Controller ID String ${initial_mc_id}
76
77 # Get the management controller ID and verify.
78 Get Management Controller ID String And Verify ${initial_mc_id}
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -050079
Sweta Potthuri0cc60502018-01-24 00:36:17 -060080Verify Chassis Identify via IPMI
81 [Documentation] Verify "chassis identify" using IPMI command.
82 [Tags] Verify_Chassis_Identify_via_IPMI
83
84 # Set to default "chassis identify" and verify that LED blinks for 15s.
85 Run IPMI Standard Command chassis identify
86 Verify Identify LED State Blink
87
88 Sleep 15s
89 Verify Identify LED State Off
90
91 # Set "chassis identify" to 10s and verify that the LED blinks for 10s.
92 Run IPMI Standard Command chassis identify 10
93 Verify Identify LED State Blink
94
95 Sleep 10s
96 Verify Identify LED State Off
97
98Verify Chassis Identify Off And Force Identify On via IPMI
99 [Documentation] Verify "chassis identify" off
100 ... and "force identify on" via IPMI.
101 [Tags] Verify_Chassis_Identify_Off_And_Force_Identify_On_via_IPMI
102
103 # Set the LED to "Force Identify On".
104 Run IPMI Standard Command chassis identify force
105 Verify Identify LED State Blink
106
107 # Set "chassis identify" to 0 and verify that the LED turns off.
108 Run IPMI Standard Command chassis identify 0
109 Verify Identify LED State Off
110
Sweta Potthuri7d3af3c2018-01-29 03:07:07 -0600111Test Watchdog Reset Via IPMI And Verify Using REST
112 [Documentation] Test watchdog reset via IPMI and verify using REST.
113 [Tags] Test_Watchdog_Reset_Via_IPMI_And_Verify_Using_REST
114
115 Initiate Host Boot
116
117 Set Watchdog Enabled Using REST ${1}
118
119 Watchdog Object Should Exist
120
121 # Resetting the watchdog via IPMI.
122 Run IPMI Standard Command mc watchdog reset
123
124 # Verify the watchdog is reset using REST after an interval of 1000ms.
125 Sleep 1000ms
126 ${watchdog_time_left}=
127 ... Read Attribute ${HOST_WATCHDOG_URI} TimeRemaining
128 Should Be True
129 ... ${watchdog_time_left}<${1200000} and ${watchdog_time_left}>${2000}
130 ... msg=Watchdog timer didn't reset.
131
132Test Watchdog Off Via IPMI And Verify Using REST
133 [Documentation] Test watchdog off via IPMI and verify using REST.
134 [Tags] Test_Watchdog_Off_Via_IPMI_And_Verify_Using_REST
135
136 Initiate Host Boot
137
138 Set Watchdog Enabled Using REST ${1}
139
140 Watchdog Object Should Exist
141
142 # Turn off the watchdog via IPMI.
143 Run IPMI Standard Command mc watchdog off
144
145 # Verify the watchdog is off using REST
146 ${watchdog_state}= Read Attribute ${HOST_WATCHDOG_URI} Enabled
147 Should Be Equal ${watchdog_state} ${0}
148 ... msg=msg=Verification failed for watchdog off check.
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -0500149*** Keywords ***
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -0600150
151Set Management Controller ID String
152 [Documentation] Set the management controller ID string.
153 [Arguments] ${string}
154
155 # Description of argument(s):
156 # string Management Controller ID String to be set
157
158 ${set_mc_id_string}= Run IPMI Standard Command
159 ... dcmi set_mc_id_string ${string}
160
161Get Management Controller ID String And Verify
162 [Documentation] Get the management controller ID sting.
163 [Arguments] ${string}
164
165 # Description of argument(s):
166 # string Management Controller ID string
167
168 ${get_mc_id}= Run IPMI Standard Command dcmi get_mc_id_string
169 Should Contain ${get_mc_id} ${string}
170 ... msg=Command failed: get_mc_id.
Sweta Potthuri0cc60502018-01-24 00:36:17 -0600171
172Verify Identify LED State
173 [Documentation] Verify the identify LED state
174 ... matches caller's expectations.
175 [Arguments] ${expected_state}
176
177 # Description of argument(s):
178 # expected_state The LED state expected by the caller ("Blink" or "Off").
179
180 ${resp}= Read Attribute ${LED_PHYSICAL_URI}/front_id State
181 Should Be Equal ${resp} xyz.openbmc_project.Led.Physical.Action.${expected_state}
182 ... msg=Unexpected LED state.
183
184 ${resp}= Read Attribute ${LED_PHYSICAL_URI}/rear_id State
185 Should Be Equal ${resp} xyz.openbmc_project.Led.Physical.Action.${expected_state}
186 ... msg=Unexpected LED state.
187
Sweta Potthuri7d3af3c2018-01-29 03:07:07 -0600188Set Watchdog Enabled Using REST
189 [Documentation] Set watchdog Enabled field using REST.
190 [Arguments] ${value}
191
192 # Description of argument(s):
193 # value Integer value (eg. "0-Disabled", "1-Enabled").
194
195 ${value_dict}= Create Dictionary data=${value}
196 ${resp}= OpenBMC Put Request ${HOST_WATCHDOG_URI}/attr/Enabled
197 ... data=${value_dict}