blob: f3a17dc2d6e6e89ac055cee7b9b1d135f12ff503 [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
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -0500111*** Keywords ***
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -0600112
113Set Management Controller ID String
114 [Documentation] Set the management controller ID string.
115 [Arguments] ${string}
116
117 # Description of argument(s):
118 # string Management Controller ID String to be set
119
120 ${set_mc_id_string}= Run IPMI Standard Command
121 ... dcmi set_mc_id_string ${string}
122
123Get Management Controller ID String And Verify
124 [Documentation] Get the management controller ID sting.
125 [Arguments] ${string}
126
127 # Description of argument(s):
128 # string Management Controller ID string
129
130 ${get_mc_id}= Run IPMI Standard Command dcmi get_mc_id_string
131 Should Contain ${get_mc_id} ${string}
132 ... msg=Command failed: get_mc_id.
Sweta Potthuri0cc60502018-01-24 00:36:17 -0600133
134Verify Identify LED State
135 [Documentation] Verify the identify LED state
136 ... matches caller's expectations.
137 [Arguments] ${expected_state}
138
139 # Description of argument(s):
140 # expected_state The LED state expected by the caller ("Blink" or "Off").
141
142 ${resp}= Read Attribute ${LED_PHYSICAL_URI}/front_id State
143 Should Be Equal ${resp} xyz.openbmc_project.Led.Physical.Action.${expected_state}
144 ... msg=Unexpected LED state.
145
146 ${resp}= Read Attribute ${LED_PHYSICAL_URI}/rear_id State
147 Should Be Equal ${resp} xyz.openbmc_project.Led.Physical.Action.${expected_state}
148 ... msg=Unexpected LED state.
149