Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 1 | *** Settings *** |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 2 | Documentation Test to discover the BMC. Before running suit, |
| 3 | ... check BMC and Avahi browse machine should be in same subnet. |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 4 | |
| 5 | Variables ../../data/variables.py |
| 6 | Library SSHLibrary |
| 7 | Library ../../lib/external_intf/management_console_utils.py |
| 8 | Library ../../lib/gen_robot_print.py |
| 9 | Library ../../lib/gen_print.py |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 10 | Library ../../lib/gen_misc.py |
| 11 | Resource ../../lib/external_intf/management_console_utils.robot |
Sushil Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame] | 12 | Resource ../../lib/redfish_code_update_utils.robot |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 13 | Resource ../../lib/boot_utils.robot |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 14 | Resource ../../syslib/utils_os.robot |
| 15 | |
| 16 | Suite Setup Suite Setup Execution |
Sushil Singh | 51be134 | 2020-05-05 00:19:40 -0500 | [diff] [blame] | 17 | Suite Teardown Redfish.Logout |
| 18 | Test Setup Printn |
Sushil Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame] | 19 | Test Teardown FFDC On Test Case Fail |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 20 | |
| 21 | *** Test Cases *** |
| 22 | |
| 23 | Discover 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 Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 33 | Discover 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 Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 37 | |
| 38 | # Service type |
| 39 | _obmc_rest._tcp |
| 40 | _obmc_redfish._tcp |
| 41 | |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 42 | |
| 43 | Disable 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 Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame] | 52 | |
| 53 | Discover 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 Singh | 6a8cb08 | 2020-04-15 06:50:28 -0500 | [diff] [blame] | 61 | |
| 62 | Discover BMC Pre And Post Firmware Update Of Different Build |
Sushil Singh | 51be134 | 2020-05-05 00:19:40 -0500 | [diff] [blame] | 63 | [Documentation] Discover BMC, when code update occurs for different release. |
Sushil Singh | 6a8cb08 | 2020-04-15 06:50:28 -0500 | [diff] [blame] | 64 | [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 Singh | 51be134 | 2020-05-05 00:19:40 -0500 | [diff] [blame] | 70 | |
| 71 | Discover 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 Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 79 | *** Keywords *** |
| 80 | |
| 81 | Suite 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 Singh | 51be134 | 2020-05-05 00:19:40 -0500 | [diff] [blame] | 89 | Redfish.Login |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 90 | |
| 91 | |
| 92 | Check 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 | |
| 104 | Discover BMC With Service Type |
| 105 | [Documentation] To get the discoverd BMC list. |
| 106 | [Arguments] ${service_type} |
| 107 | |
| 108 | # Description of argument(s): |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 109 | # service_type BMC service type e.g. |
| 110 | # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 111 | |
| 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 Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 131 | [Return] ${bmc_list} |
| 132 | |
| 133 | |
| 134 | Verify 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 Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 148 | Set Daemon And Discover BMC After Reboot |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 149 | [Documentation] Discover BMC After reboot. |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 150 | [Arguments] ${service_type} ${skip}=False |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 151 | |
| 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 Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 155 | # 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 Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 158 | |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 159 | Verify Existence Of BMC Record From List ${service_type} |
| 160 | Run Keyword If '${skip}' == 'True' Set AvahiDaemon Service command=stop |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 161 | 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 Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame] | 166 | |
| 167 | |
| 168 | Discover 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 Singh | 51be134 | 2020-05-05 00:19:40 -0500 | [diff] [blame] | 173 | # service_type BMC service type e.g. |
| 174 | # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). |
Sushil Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame] | 175 | |
| 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 Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame] | 179 | 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 Singh | 51be134 | 2020-05-05 00:19:40 -0500 | [diff] [blame] | 182 | |
| 183 | |
| 184 | Discover 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 |