blob: a1460a46cfe99ae8144c0622e8840aca97cda854 [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
44 [Documentation] BMC should be discoverable in next reboot even after disabling Avahi deamon.
45 [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
53Discover BMC Pre And Post Firmware Update Of Same Build
54 [Documentation] Discover BMC, when code update occurs for same build.
55 [Tags] Discover_BMC_Pre_And_Post_Firmware_Update_Of_Same_Build
56 [Template] Discover BMC Pre And Post Firmware Update
57
58 # Service type Service type
59 _obmc_rest._tcp _obmc_redfish._tcp
60
Sushil Singh6a8cb082020-04-15 06:50:28 -050061
62Discover BMC Pre And Post Firmware Update Of Different Build
Sushil Singh51be1342020-05-05 00:19:40 -050063 [Documentation] Discover BMC, when code update occurs for different release.
Sushil Singh6a8cb082020-04-15 06:50:28 -050064 [Tags] Discover_BMC_Pre_And_Post_Firmware_Update_Of_Different_Build
65 [Template] Discover BMC Pre And Post Firmware Update
66
67 # Service type Service type
68 _obmc_rest._tcp _obmc_redfish._tcp
69
Sushil Singh51be1342020-05-05 00:19:40 -050070
71Discover BMC Pre And While Host Boot InProgress
72 [Documentation] Discover BMC, while Host boot in progress.
73 [Tags] Discover_BMC_Pre_And_While_Host_Boot_InProgress
74 [Template] Discover BMC Before And During Host Boot
75
76 # Service type Service type
77 _obmc_rest._tcp _obmc_redfish._tcp
78
Sushil Singh8023a8c2020-03-16 05:56:39 -050079*** Keywords ***
80
81Suite Setup Execution
82 [Documentation] Do the suite setup.
83
84 Should Not Be Empty ${AVAHI_CLIENT}
85 Should Not Be Empty ${AVAHI_CLIENT_USERNAME}
86 Should Not Be Empty ${AVAHI_CLIENT_PASSWORD}
87 Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD}
88 Check Avahi Package
Sushil Singh51be1342020-05-05 00:19:40 -050089 Redfish.Login
Sushil Singh8023a8c2020-03-16 05:56:39 -050090
91
92Check Avahi Package
93 [Documentation] To check for avahi-tools package.
94
95 # Expected command output as below.
96 # avahi-tools-0.6.31-19.el7.x86_64
97
98 ${command}= Set Variable rpm -qa | grep avahi-tools
99 ${resp_rpm} ${stderr}= Execute Command ${command} return_stderr=True
100 Should Be Empty ${stderr}
101 Should Contain ${resp_rpm} avahi-tools ignore_case=True msg=avahi-tools is not available.
102
103
104Discover BMC With Service Type
105 [Documentation] To get the discoverd BMC list.
106 [Arguments] ${service_type}
107
108 # Description of argument(s):
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500109 # service_type BMC service type e.g.
110 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
Sushil Singh8023a8c2020-03-16 05:56:39 -0500111
112 # bmc_list:
113 # [1]:
114 # [service]: _obmc_XXXX._tcp
115 # [hostname]: System Name
116 # [address]: XXX.XXX.XXX.XXX
117 # [port]: XXX
118 # [txt]:
119 # [2]:
120 # [service]: _obmc_XXXX._tcp
121 # [hostname]: System Name
122 # [address]: XXX.XXX.XXX.XXX
123 # [port]: XXX
124 # [txt]:
125
126 ${resp_service} ${stderr}= Execute Command avahi-browse -rt ${service_type} return_stderr=True
127 ${bmc_list} ${exc_msg}= Get BMC Records ${service_type} ${resp_service}
128 Print Timen Exception message is ${exc_msg}
129 Should Not Be Empty ${bmc_list}
130 Rprint Vars bmc_list
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500131 [Return] ${bmc_list}
132
133
134Verify Existence Of BMC Record From List
135 [Documentation] Verify the existence of BMC record from list of BMC records.
136 [Arguments] ${service_type}
137
138 # Description of argument(s):
139 # service_type BMC service type e.g.
140 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
141
142 ${bmc_list}= Discover BMC With Service Type ${service_type}
143 ${openbmc_host_name} ${openbmc_ip}= Get Host Name IP host=${OPENBMC_HOST}
144 ${resp}= Check BMC Record Exists ${bmc_list} ${openbmc_ip}
145 Should Be True 'True' == '${resp}'
146
147
Sushil Singhe6edfad2020-04-13 07:45:03 -0500148Set Daemon And Discover BMC After Reboot
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500149 [Documentation] Discover BMC After reboot.
Sushil Singhe6edfad2020-04-13 07:45:03 -0500150 [Arguments] ${service_type} ${skip}=False
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500151
152 # Description of argument(s):
153 # service_type BMC service type e.g.
154 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
Sushil Singhe6edfad2020-04-13 07:45:03 -0500155 # skip Default value set to False.
156 # If the value is True, Disable the AvahiDaemon.
157 # If the value is False, skip the step to disable the AvahiDaemon.
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500158
Sushil Singhe6edfad2020-04-13 07:45:03 -0500159 Verify Existence Of BMC Record From List ${service_type}
160 Run Keyword If '${skip}' == 'True' Set AvahiDaemon Service command=stop
Sushil Singhc5e9ebc2020-04-09 03:32:57 -0500161 Redfish OBMC Reboot (off)
162 Verify AvahiDaemon Service Status message=start
163 Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD}
164 Wait Until Keyword Succeeds 2 min 30 sec
165 ... Verify Existence Of BMC Record From List ${service_type}
Sushil Singha2bf3f32020-04-15 05:23:57 -0500166
167
168Discover BMC Pre And Post Firmware Update
169 [Documentation] Discover BMC, After code update.
170 [Arguments] ${service_type1} ${service_type2}
171
172 # Description of argument(s):
Sushil Singh51be1342020-05-05 00:19:40 -0500173 # service_type BMC service type e.g.
174 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
Sushil Singha2bf3f32020-04-15 05:23:57 -0500175
176 Valid File Path IMAGE_FILE_PATH
177 Verify Existence Of BMC Record From List ${service_type1}
178 Verify Existence Of BMC Record From List ${service_type2}
Sushil Singha2bf3f32020-04-15 05:23:57 -0500179 Redfish Update Firmware apply_time=Immediate image_type=BMC image
180 Verify Existence Of BMC Record From List ${service_type1}
181 Verify Existence Of BMC Record From List ${service_type2}
Sushil Singh51be1342020-05-05 00:19:40 -0500182
183
184Discover BMC Before And During Host Boot
185 [Documentation] Discover BMC, when host boot in progress.
186 [Arguments] ${service_type1} ${service_type2}
187
188 # Description of argument(s):
189 # service_type BMC service type e.g.
190 # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp).
191
192 Verify Existence Of BMC Record From List ${service_type1}
193 Verify Existence Of BMC Record From List ${service_type2}
194 Redfish Power Off stack_mode=skip
195 Get Host Power State
196 Redfish Power Operation reset_type=On
197 Sleep 15s
198 Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD}
199 FOR ${index} IN RANGE 10
200 Sleep 3s
201 Verify Existence Of BMC Record From List ${service_type1}
202 Verify Existence Of BMC Record From List ${service_type2}
203 END
204 Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted