blob: f9f21401a99680f4554226cfef6c8c0fdbd14f75 [file] [log] [blame]
Sushil Singh8023a8c2020-03-16 05:56:39 -05001*** Settings ***
Sushil Singhc5e9ebc2020-04-09 03:32:57 -05002Documentation Test to discover the BMC. Before running suit,
3... check BMC and Avahi browse machine should be in same subnet.
Sushil Singh8023a8c2020-03-16 05:56:39 -05004
5Variables ../../data/variables.py
6Library SSHLibrary
7Library ../../lib/external_intf/management_console_utils.py
8Library ../../lib/gen_robot_print.py
9Library ../../lib/gen_print.py
Sushil Singhc5e9ebc2020-04-09 03:32:57 -050010Library ../../lib/gen_misc.py
11Resource ../../lib/external_intf/management_console_utils.robot
Sushil Singha2bf3f32020-04-15 05:23:57 -050012Resource ../../lib/redfish_code_update_utils.robot
Sushil Singhc5e9ebc2020-04-09 03:32:57 -050013Resource ../../lib/boot_utils.robot
Sushil Singh8023a8c2020-03-16 05:56:39 -050014Resource ../../syslib/utils_os.robot
15
16Suite Setup Suite Setup Execution
Sushil Singh51be1342020-05-05 00:19:40 -050017Suite Teardown Redfish.Logout
18Test Setup Printn
Sushil Singha2bf3f32020-04-15 05:23:57 -050019Test Teardown FFDC On Test Case Fail
Sushil Singh8023a8c2020-03-16 05:56:39 -050020
21*** Test Cases ***
22
23Discover BMC With Different Service Type
24 [Documentation] Discover all the BMC with different service type support.
25 [Tags] Discover_BMC_With_Different_Service_Type
26 [Template] Discover BMC With Service Type
27
28 # Service type
29 _obmc_rest._tcp
30 _obmc_redfish._tcp
31
32
Sushil Singhe6edfad2020-04-13 07:45:03 -050033Discover BMC Pre And Post Reboot
34 [Documentation] Discover BMC before and after reboot.
35 [Tags] Discover_BMC_Pre_And_Post_Reboot
36 [Template] Set Daemon And Discover BMC After Reboot
Sushil Singhc5e9ebc2020-04-09 03:32:57 -050037
38 # Service type
39 _obmc_rest._tcp
40 _obmc_redfish._tcp
41
Sushil Singhe6edfad2020-04-13 07:45:03 -050042
43Disable AvahiDaemon And Discover BMC After Reboot
George Keishinge20f82c2020-05-13 10:51:02 -050044 [Documentation] BMC should be discoverable in next reboot even after disabling Avahi daemon.
Sushil Singhe6edfad2020-04-13 07:45:03 -050045 [Tags] Disable_AvahiDaemon_And_Discover_BMC_After_Reboot
46 [Template] Set Daemon And Discover BMC After Reboot
47
48 # Service type skip
49 _obmc_rest._tcp True
50 _obmc_redfish._tcp True
51
Sushil Singha2bf3f32020-04-15 05:23:57 -050052
Sushil Singhe46ba2d2020-05-07 07:39:34 -050053Discover BMC Pre And Post Firmware Update Of Same Release
54 [Documentation] Discover BMC, when firmware update occurs for same release.
55 [Tags] Discover_BMC_Pre_And_Post_Firmware_Update_Of_Same_Release
Sushil Singha2bf3f32020-04-15 05:23:57 -050056 [Template] Discover BMC Pre And Post Firmware Update
57
Sushil Singhe46ba2d2020-05-07 07:39:34 -050058 # Service type Service type status
59 _obmc_rest._tcp _obmc_redfish._tcp True
Sushil Singha2bf3f32020-04-15 05:23:57 -050060
Sushil Singh6a8cb082020-04-15 06:50:28 -050061
Sushil Singhe46ba2d2020-05-07 07:39:34 -050062Discover BMC Pre And Post Firmware Update Of Different Release
63 [Documentation] Discover BMC, when firmware update occurs for different release.
64 [Tags] Discover_BMC_Pre_And_Post_Firmware_Update_Of_Different_Release
Sushil Singh6a8cb082020-04-15 06:50:28 -050065 [Template] Discover BMC Pre And Post Firmware Update
66
Sushil Singhe46ba2d2020-05-07 07:39:34 -050067 # Service type Service type status
68 _obmc_rest._tcp _obmc_redfish._tcp True
Sushil Singh6a8cb082020-04-15 06:50:28 -050069
Sushil Singh51be1342020-05-05 00:19:40 -050070
Sushil Singhe46ba2d2020-05-07 07:39:34 -050071Discover BMC Fail After Firmware Update Of Different Release
72 [Documentation] Discover BMC fail, when firmware update occurs for different release.
73 [Tags] Discover_BMC_Fail_After_Firmware_Update_Of_Different_Release
74 [Template] Discover BMC Pre And Post Firmware Update
75
76 # Service type Service type status
77 _obmc_rest._tcp _obmc_redfish._tcp False
78
79
80Discover BMC Pre And Post When Host Boot InProgress
81 [Documentation] Discover BMC, when Host boot in progress.
82 [Tags] Discover_BMC_Pre_And_Post_When_Host_Boot_InProgress
83 [Template] Discover BMC Pre And Post When Host Boot
Sushil Singh51be1342020-05-05 00:19:40 -050084
85 # Service type Service type
86 _obmc_rest._tcp _obmc_redfish._tcp
87
Sushil Singh8023a8c2020-03-16 05:56:39 -050088*** Keywords ***
89
90Suite Setup Execution
91 [Documentation] Do the suite setup.
92
93 Should Not Be Empty ${AVAHI_CLIENT}
94 Should Not Be Empty ${AVAHI_CLIENT_USERNAME}
95 Should Not Be Empty ${AVAHI_CLIENT_PASSWORD}
96 Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD}
97 Check Avahi Package
Sushil Singh51be1342020-05-05 00:19:40 -050098 Redfish.Login
Sushil Singh8023a8c2020-03-16 05:56:39 -050099
100
101Check Avahi Package
102 [Documentation] To check for avahi-tools package.
103
104 # Expected command output as below.
105 # avahi-tools-0.6.31-19.el7.x86_64
106
107 ${command}= Set Variable rpm -qa | grep avahi-tools
108 ${resp_rpm} ${stderr}= Execute Command ${command} return_stderr=True
109 Should Be Empty ${stderr}
110 Should Contain ${resp_rpm} avahi-tools ignore_case=True msg=avahi-tools is not available.
111
112
113Discover BMC With Service Type
114 [Documentation] To get the discoverd BMC list.
115 [Arguments] ${service_type}
116
117 # Description of argument(s):
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500118 # service_type BMC service type e.g.
119 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
Sushil Singh8023a8c2020-03-16 05:56:39 -0500120
121 # bmc_list:
122 # [1]:
123 # [service]: _obmc_XXXX._tcp
124 # [hostname]: System Name
125 # [address]: XXX.XXX.XXX.XXX
126 # [port]: XXX
127 # [txt]:
128 # [2]:
129 # [service]: _obmc_XXXX._tcp
130 # [hostname]: System Name
131 # [address]: XXX.XXX.XXX.XXX
132 # [port]: XXX
133 # [txt]:
134
135 ${resp_service} ${stderr}= Execute Command avahi-browse -rt ${service_type} return_stderr=True
136 ${bmc_list} ${exc_msg}= Get BMC Records ${service_type} ${resp_service}
137 Print Timen Exception message is ${exc_msg}
138 Should Not Be Empty ${bmc_list}
139 Rprint Vars bmc_list
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500140 [Return] ${bmc_list}
141
142
143Verify Existence Of BMC Record From List
144 [Documentation] Verify the existence of BMC record from list of BMC records.
145 [Arguments] ${service_type}
146
147 # Description of argument(s):
148 # service_type BMC service type e.g.
149 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
150
151 ${bmc_list}= Discover BMC With Service Type ${service_type}
152 ${openbmc_host_name} ${openbmc_ip}= Get Host Name IP host=${OPENBMC_HOST}
153 ${resp}= Check BMC Record Exists ${bmc_list} ${openbmc_ip}
154 Should Be True 'True' == '${resp}'
155
156
Sushil Singhe6edfad2020-04-13 07:45:03 -0500157Set Daemon And Discover BMC After Reboot
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500158 [Documentation] Discover BMC After reboot.
Sushil Singhe6edfad2020-04-13 07:45:03 -0500159 [Arguments] ${service_type} ${skip}=False
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500160
161 # Description of argument(s):
162 # service_type BMC service type e.g.
163 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
Sushil Singhe6edfad2020-04-13 07:45:03 -0500164 # skip Default value set to False.
165 # If the value is True, Disable the AvahiDaemon.
166 # If the value is False, skip the step to disable the AvahiDaemon.
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500167
Sushil Singhe6edfad2020-04-13 07:45:03 -0500168 Verify Existence Of BMC Record From List ${service_type}
169 Run Keyword If '${skip}' == 'True' Set AvahiDaemon Service command=stop
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500170 Redfish OBMC Reboot (off)
171 Verify AvahiDaemon Service Status message=start
172 Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD}
173 Wait Until Keyword Succeeds 2 min 30 sec
174 ... Verify Existence Of BMC Record From List ${service_type}
Sushil Singha2bf3f32020-04-15 05:23:57 -0500175
176
177Discover BMC Pre And Post Firmware Update
178 [Documentation] Discover BMC, After code update.
179 [Arguments] ${service_type1} ${service_type2}
180
181 # Description of argument(s):
Sushil Singh51be1342020-05-05 00:19:40 -0500182 # service_type BMC service type e.g.
183 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
Sushil Singha2bf3f32020-04-15 05:23:57 -0500184
185 Valid File Path IMAGE_FILE_PATH
186 Verify Existence Of BMC Record From List ${service_type1}
187 Verify Existence Of BMC Record From List ${service_type2}
Sushil Singha2bf3f32020-04-15 05:23:57 -0500188 Redfish Update Firmware apply_time=Immediate image_type=BMC image
Sushil Singhe46ba2d2020-05-07 07:39:34 -0500189 ${keyword_status}= Run Keyword And Return Status
190 ... Verify Existence Of BMC Record From List ${service_type1}
191 Should Be Equal '${status}' '${keyword_status}'
192 ${keyword_status}= Run Keyword And Return Status
193 ... Verify Existence Of BMC Record From List ${service_type2}
194 Should Be Equal '${status}' '${keyword_status}'
Sushil Singh51be1342020-05-05 00:19:40 -0500195
196
Sushil Singhe46ba2d2020-05-07 07:39:34 -0500197Discover BMC Pre And Post When Host Boot
198 [Documentation] Discover BMC, when host boot progress.
Sushil Singh51be1342020-05-05 00:19:40 -0500199 [Arguments] ${service_type1} ${service_type2}
200
201 # Description of argument(s):
202 # service_type BMC service type e.g.
203 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
204
205 Verify Existence Of BMC Record From List ${service_type1}
206 Verify Existence Of BMC Record From List ${service_type2}
207 Redfish Power Off stack_mode=skip
208 Get Host Power State
209 Redfish Power Operation reset_type=On
210 Sleep 15s
211 Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD}
212 FOR ${index} IN RANGE 10
213 Sleep 3s
214 Verify Existence Of BMC Record From List ${service_type1}
215 Verify Existence Of BMC Record From List ${service_type2}
216 END
217 Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted