18023a8cfSSushil Singh*** Settings *** 2c5e9ebc6SSushil SinghDocumentation Test to discover the BMC. Before running suit, 3c5e9ebc6SSushil Singh... check BMC and Avahi browse machine should be in same subnet. 48023a8cfSSushil Singh 58023a8cfSSushil SinghVariables ../../data/variables.py 68023a8cfSSushil SinghLibrary SSHLibrary 78023a8cfSSushil SinghLibrary ../../lib/external_intf/management_console_utils.py 88023a8cfSSushil SinghLibrary ../../lib/gen_robot_print.py 98023a8cfSSushil SinghLibrary ../../lib/gen_print.py 10c5e9ebc6SSushil SinghLibrary ../../lib/gen_misc.py 11c5e9ebc6SSushil SinghResource ../../lib/external_intf/management_console_utils.robot 12*a2bf3f3cSSushil SinghResource ../../lib/redfish_code_update_utils.robot 13c5e9ebc6SSushil SinghResource ../../lib/boot_utils.robot 148023a8cfSSushil SinghResource ../../syslib/utils_os.robot 158023a8cfSSushil Singh 168023a8cfSSushil SinghSuite Setup Suite Setup Execution 17*a2bf3f3cSSushil SinghTest Teardown FFDC On Test Case Fail 188023a8cfSSushil Singh 198023a8cfSSushil Singh*** Test Cases *** 208023a8cfSSushil Singh 218023a8cfSSushil SinghDiscover BMC With Different Service Type 228023a8cfSSushil Singh [Documentation] Discover all the BMC with different service type support. 238023a8cfSSushil Singh [Tags] Discover_BMC_With_Different_Service_Type 248023a8cfSSushil Singh [Template] Discover BMC With Service Type 258023a8cfSSushil Singh 268023a8cfSSushil Singh # Service type 278023a8cfSSushil Singh _obmc_rest._tcp 288023a8cfSSushil Singh _obmc_redfish._tcp 298023a8cfSSushil Singh 308023a8cfSSushil Singh 31e6edfadbSSushil SinghDiscover BMC Pre And Post Reboot 32e6edfadbSSushil Singh [Documentation] Discover BMC before and after reboot. 33e6edfadbSSushil Singh [Tags] Discover_BMC_Pre_And_Post_Reboot 34e6edfadbSSushil Singh [Template] Set Daemon And Discover BMC After Reboot 35c5e9ebc6SSushil Singh 36c5e9ebc6SSushil Singh # Service type 37c5e9ebc6SSushil Singh _obmc_rest._tcp 38c5e9ebc6SSushil Singh _obmc_redfish._tcp 39c5e9ebc6SSushil Singh 40e6edfadbSSushil Singh 41e6edfadbSSushil SinghDisable AvahiDaemon And Discover BMC After Reboot 42e6edfadbSSushil Singh [Documentation] BMC should be discoverable in next reboot even after disabling Avahi deamon. 43e6edfadbSSushil Singh [Tags] Disable_AvahiDaemon_And_Discover_BMC_After_Reboot 44e6edfadbSSushil Singh [Template] Set Daemon And Discover BMC After Reboot 45e6edfadbSSushil Singh 46e6edfadbSSushil Singh # Service type skip 47e6edfadbSSushil Singh _obmc_rest._tcp True 48e6edfadbSSushil Singh _obmc_redfish._tcp True 49e6edfadbSSushil Singh 50*a2bf3f3cSSushil Singh 51*a2bf3f3cSSushil SinghDiscover BMC Pre And Post Firmware Update Of Same Build 52*a2bf3f3cSSushil Singh [Documentation] Discover BMC, when code update occurs for same build. 53*a2bf3f3cSSushil Singh [Tags] Discover_BMC_Pre_And_Post_Firmware_Update_Of_Same_Build 54*a2bf3f3cSSushil Singh [Template] Discover BMC Pre And Post Firmware Update 55*a2bf3f3cSSushil Singh 56*a2bf3f3cSSushil Singh # Service type Service type 57*a2bf3f3cSSushil Singh _obmc_rest._tcp _obmc_redfish._tcp 58*a2bf3f3cSSushil Singh 598023a8cfSSushil Singh*** Keywords *** 608023a8cfSSushil Singh 618023a8cfSSushil SinghSuite Setup Execution 628023a8cfSSushil Singh [Documentation] Do the suite setup. 638023a8cfSSushil Singh 648023a8cfSSushil Singh Should Not Be Empty ${AVAHI_CLIENT} 658023a8cfSSushil Singh Should Not Be Empty ${AVAHI_CLIENT_USERNAME} 668023a8cfSSushil Singh Should Not Be Empty ${AVAHI_CLIENT_PASSWORD} 678023a8cfSSushil Singh Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD} 688023a8cfSSushil Singh Check Avahi Package 698023a8cfSSushil Singh 708023a8cfSSushil Singh 718023a8cfSSushil SinghCheck Avahi Package 728023a8cfSSushil Singh [Documentation] To check for avahi-tools package. 738023a8cfSSushil Singh 748023a8cfSSushil Singh # Expected command output as below. 758023a8cfSSushil Singh # avahi-tools-0.6.31-19.el7.x86_64 768023a8cfSSushil Singh 778023a8cfSSushil Singh ${command}= Set Variable rpm -qa | grep avahi-tools 788023a8cfSSushil Singh ${resp_rpm} ${stderr}= Execute Command ${command} return_stderr=True 798023a8cfSSushil Singh Should Be Empty ${stderr} 808023a8cfSSushil Singh Should Contain ${resp_rpm} avahi-tools ignore_case=True msg=avahi-tools is not available. 818023a8cfSSushil Singh 828023a8cfSSushil Singh 838023a8cfSSushil SinghDiscover BMC With Service Type 848023a8cfSSushil Singh [Documentation] To get the discoverd BMC list. 858023a8cfSSushil Singh [Arguments] ${service_type} 868023a8cfSSushil Singh 878023a8cfSSushil Singh # Description of argument(s): 888023a8cfSSushil Singh # service_type BMC service type e.g. 898023a8cfSSushil Singh # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). 908023a8cfSSushil Singh 918023a8cfSSushil Singh # bmc_list: 928023a8cfSSushil Singh # [1]: 938023a8cfSSushil Singh # [service]: _obmc_XXXX._tcp 948023a8cfSSushil Singh # [hostname]: System Name 958023a8cfSSushil Singh # [address]: XXX.XXX.XXX.XXX 968023a8cfSSushil Singh # [port]: XXX 978023a8cfSSushil Singh # [txt]: 988023a8cfSSushil Singh # [2]: 998023a8cfSSushil Singh # [service]: _obmc_XXXX._tcp 1008023a8cfSSushil Singh # [hostname]: System Name 1018023a8cfSSushil Singh # [address]: XXX.XXX.XXX.XXX 1028023a8cfSSushil Singh # [port]: XXX 1038023a8cfSSushil Singh # [txt]: 1048023a8cfSSushil Singh 1058023a8cfSSushil Singh ${resp_service} ${stderr}= Execute Command avahi-browse -rt ${service_type} return_stderr=True 1068023a8cfSSushil Singh ${bmc_list} ${exc_msg}= Get BMC Records ${service_type} ${resp_service} 1078023a8cfSSushil Singh Print Timen Exception message is ${exc_msg} 1088023a8cfSSushil Singh Should Not Be Empty ${bmc_list} 1098023a8cfSSushil Singh Rprint Vars bmc_list 110c5e9ebc6SSushil Singh [Return] ${bmc_list} 111c5e9ebc6SSushil Singh 112c5e9ebc6SSushil Singh 113c5e9ebc6SSushil SinghVerify Existence Of BMC Record From List 114c5e9ebc6SSushil Singh [Documentation] Verify the existence of BMC record from list of BMC records. 115c5e9ebc6SSushil Singh [Arguments] ${service_type} 116c5e9ebc6SSushil Singh 117c5e9ebc6SSushil Singh # Description of argument(s): 118c5e9ebc6SSushil Singh # service_type BMC service type e.g. 119c5e9ebc6SSushil Singh # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). 120c5e9ebc6SSushil Singh 121c5e9ebc6SSushil Singh ${bmc_list}= Discover BMC With Service Type ${service_type} 122c5e9ebc6SSushil Singh ${openbmc_host_name} ${openbmc_ip}= Get Host Name IP host=${OPENBMC_HOST} 123c5e9ebc6SSushil Singh ${resp}= Check BMC Record Exists ${bmc_list} ${openbmc_ip} 124c5e9ebc6SSushil Singh Should Be True 'True' == '${resp}' 125c5e9ebc6SSushil Singh 126c5e9ebc6SSushil Singh 127e6edfadbSSushil SinghSet Daemon And Discover BMC After Reboot 128c5e9ebc6SSushil Singh [Documentation] Discover BMC After reboot. 129e6edfadbSSushil Singh [Arguments] ${service_type} ${skip}=False 130c5e9ebc6SSushil Singh 131c5e9ebc6SSushil Singh # Description of argument(s): 132c5e9ebc6SSushil Singh # service_type BMC service type e.g. 133c5e9ebc6SSushil Singh # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). 134e6edfadbSSushil Singh # skip Default value set to False. 135e6edfadbSSushil Singh # If the value is True, Disable the AvahiDaemon. 136e6edfadbSSushil Singh # If the value is False, skip the step to disable the AvahiDaemon. 137c5e9ebc6SSushil Singh 138e6edfadbSSushil Singh Verify Existence Of BMC Record From List ${service_type} 139e6edfadbSSushil Singh Run Keyword If '${skip}' == 'True' Set AvahiDaemon Service command=stop 140c5e9ebc6SSushil Singh Redfish OBMC Reboot (off) 141c5e9ebc6SSushil Singh Verify AvahiDaemon Service Status message=start 142c5e9ebc6SSushil Singh Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD} 143c5e9ebc6SSushil Singh Wait Until Keyword Succeeds 2 min 30 sec 144c5e9ebc6SSushil Singh ... Verify Existence Of BMC Record From List ${service_type} 145*a2bf3f3cSSushil Singh 146*a2bf3f3cSSushil Singh 147*a2bf3f3cSSushil SinghDiscover BMC Pre And Post Firmware Update 148*a2bf3f3cSSushil Singh [Documentation] Discover BMC, After code update. 149*a2bf3f3cSSushil Singh [Arguments] ${service_type1} ${service_type2} 150*a2bf3f3cSSushil Singh 151*a2bf3f3cSSushil Singh # Description of argument(s): 152*a2bf3f3cSSushil Singh # service_type BMC service type e.g. 153*a2bf3f3cSSushil Singh # (REST Service = _obmc_rest._tcp, Redfish Service = _obmc_redfish._tcp). 154*a2bf3f3cSSushil Singh 155*a2bf3f3cSSushil Singh Valid File Path IMAGE_FILE_PATH 156*a2bf3f3cSSushil Singh Verify Existence Of BMC Record From List ${service_type1} 157*a2bf3f3cSSushil Singh Verify Existence Of BMC Record From List ${service_type2} 158*a2bf3f3cSSushil Singh Redfish.Login 159*a2bf3f3cSSushil Singh Redfish Update Firmware apply_time=Immediate image_type=BMC image 160*a2bf3f3cSSushil Singh Verify Existence Of BMC Record From List ${service_type1} 161*a2bf3f3cSSushil Singh Verify Existence Of BMC Record From List ${service_type2} 162