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 | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame^] | 17 | Test Teardown FFDC On Test Case Fail |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 18 | |
| 19 | *** Test Cases *** |
| 20 | |
| 21 | Discover BMC With Different Service Type |
| 22 | [Documentation] Discover all the BMC with different service type support. |
| 23 | [Tags] Discover_BMC_With_Different_Service_Type |
| 24 | [Template] Discover BMC With Service Type |
| 25 | |
| 26 | # Service type |
| 27 | _obmc_rest._tcp |
| 28 | _obmc_redfish._tcp |
| 29 | |
| 30 | |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 31 | Discover BMC Pre And Post Reboot |
| 32 | [Documentation] Discover BMC before and after reboot. |
| 33 | [Tags] Discover_BMC_Pre_And_Post_Reboot |
| 34 | [Template] Set Daemon And Discover BMC After Reboot |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 35 | |
| 36 | # Service type |
| 37 | _obmc_rest._tcp |
| 38 | _obmc_redfish._tcp |
| 39 | |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 40 | |
| 41 | Disable AvahiDaemon And Discover BMC After Reboot |
| 42 | [Documentation] BMC should be discoverable in next reboot even after disabling Avahi deamon. |
| 43 | [Tags] Disable_AvahiDaemon_And_Discover_BMC_After_Reboot |
| 44 | [Template] Set Daemon And Discover BMC After Reboot |
| 45 | |
| 46 | # Service type skip |
| 47 | _obmc_rest._tcp True |
| 48 | _obmc_redfish._tcp True |
| 49 | |
Sushil Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame^] | 50 | |
| 51 | Discover BMC Pre And Post Firmware Update Of Same Build |
| 52 | [Documentation] Discover BMC, when code update occurs for same build. |
| 53 | [Tags] Discover_BMC_Pre_And_Post_Firmware_Update_Of_Same_Build |
| 54 | [Template] Discover BMC Pre And Post Firmware Update |
| 55 | |
| 56 | # Service type Service type |
| 57 | _obmc_rest._tcp _obmc_redfish._tcp |
| 58 | |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 59 | *** Keywords *** |
| 60 | |
| 61 | Suite Setup Execution |
| 62 | [Documentation] Do the suite setup. |
| 63 | |
| 64 | Should Not Be Empty ${AVAHI_CLIENT} |
| 65 | Should Not Be Empty ${AVAHI_CLIENT_USERNAME} |
| 66 | Should Not Be Empty ${AVAHI_CLIENT_PASSWORD} |
| 67 | Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD} |
| 68 | Check Avahi Package |
| 69 | |
| 70 | |
| 71 | Check Avahi Package |
| 72 | [Documentation] To check for avahi-tools package. |
| 73 | |
| 74 | # Expected command output as below. |
| 75 | # avahi-tools-0.6.31-19.el7.x86_64 |
| 76 | |
| 77 | ${command}= Set Variable rpm -qa | grep avahi-tools |
| 78 | ${resp_rpm} ${stderr}= Execute Command ${command} return_stderr=True |
| 79 | Should Be Empty ${stderr} |
| 80 | Should Contain ${resp_rpm} avahi-tools ignore_case=True msg=avahi-tools is not available. |
| 81 | |
| 82 | |
| 83 | Discover BMC With Service Type |
| 84 | [Documentation] To get the discoverd BMC list. |
| 85 | [Arguments] ${service_type} |
| 86 | |
| 87 | # Description of argument(s): |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 88 | # service_type BMC service type e.g. |
| 89 | # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). |
Sushil Singh | 8023a8c | 2020-03-16 05:56:39 -0500 | [diff] [blame] | 90 | |
| 91 | # bmc_list: |
| 92 | # [1]: |
| 93 | # [service]: _obmc_XXXX._tcp |
| 94 | # [hostname]: System Name |
| 95 | # [address]: XXX.XXX.XXX.XXX |
| 96 | # [port]: XXX |
| 97 | # [txt]: |
| 98 | # [2]: |
| 99 | # [service]: _obmc_XXXX._tcp |
| 100 | # [hostname]: System Name |
| 101 | # [address]: XXX.XXX.XXX.XXX |
| 102 | # [port]: XXX |
| 103 | # [txt]: |
| 104 | |
| 105 | ${resp_service} ${stderr}= Execute Command avahi-browse -rt ${service_type} return_stderr=True |
| 106 | ${bmc_list} ${exc_msg}= Get BMC Records ${service_type} ${resp_service} |
| 107 | Print Timen Exception message is ${exc_msg} |
| 108 | Should Not Be Empty ${bmc_list} |
| 109 | Rprint Vars bmc_list |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 110 | [Return] ${bmc_list} |
| 111 | |
| 112 | |
| 113 | Verify Existence Of BMC Record From List |
| 114 | [Documentation] Verify the existence of BMC record from list of BMC records. |
| 115 | [Arguments] ${service_type} |
| 116 | |
| 117 | # Description of argument(s): |
| 118 | # service_type BMC service type e.g. |
| 119 | # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). |
| 120 | |
| 121 | ${bmc_list}= Discover BMC With Service Type ${service_type} |
| 122 | ${openbmc_host_name} ${openbmc_ip}= Get Host Name IP host=${OPENBMC_HOST} |
| 123 | ${resp}= Check BMC Record Exists ${bmc_list} ${openbmc_ip} |
| 124 | Should Be True 'True' == '${resp}' |
| 125 | |
| 126 | |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 127 | Set Daemon And Discover BMC After Reboot |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 128 | [Documentation] Discover BMC After reboot. |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 129 | [Arguments] ${service_type} ${skip}=False |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 130 | |
| 131 | # Description of argument(s): |
| 132 | # service_type BMC service type e.g. |
| 133 | # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 134 | # skip Default value set to False. |
| 135 | # If the value is True, Disable the AvahiDaemon. |
| 136 | # If the value is False, skip the step to disable the AvahiDaemon. |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 137 | |
Sushil Singh | e6edfad | 2020-04-13 07:45:03 -0500 | [diff] [blame] | 138 | Verify Existence Of BMC Record From List ${service_type} |
| 139 | Run Keyword If '${skip}' == 'True' Set AvahiDaemon Service command=stop |
Sushil Singh | c5e9ebc | 2020-04-09 03:32:57 -0500 | [diff] [blame] | 140 | Redfish OBMC Reboot (off) |
| 141 | Verify AvahiDaemon Service Status message=start |
| 142 | Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD} |
| 143 | Wait Until Keyword Succeeds 2 min 30 sec |
| 144 | ... Verify Existence Of BMC Record From List ${service_type} |
Sushil Singh | a2bf3f3 | 2020-04-15 05:23:57 -0500 | [diff] [blame^] | 145 | |
| 146 | |
| 147 | Discover BMC Pre And Post Firmware Update |
| 148 | [Documentation] Discover BMC, After code update. |
| 149 | [Arguments] ${service_type1} ${service_type2} |
| 150 | |
| 151 | # Description of argument(s): |
| 152 | # service_type BMC service type e.g. |
| 153 | # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). |
| 154 | |
| 155 | Valid File Path IMAGE_FILE_PATH |
| 156 | Verify Existence Of BMC Record From List ${service_type1} |
| 157 | Verify Existence Of BMC Record From List ${service_type2} |
| 158 | Redfish.Login |
| 159 | Redfish Update Firmware apply_time=Immediate image_type=BMC image |
| 160 | Verify Existence Of BMC Record From List ${service_type1} |
| 161 | Verify Existence Of BMC Record From List ${service_type2} |