Anves Kumar rayankula | d2e98ff | 2021-06-29 05:03:02 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test BMC multiple network interface functionalities. |
| 3 | |
| 4 | # User input BMC IP for the eth1. |
| 5 | # Use can input as -v OPENBMC_HOST_1:xx.xxx.xx from command line. |
| 6 | Library ../../lib/bmc_redfish.py https://${OPENBMC_HOST_1}:${HTTPS_PORT} |
| 7 | ... ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} WITH NAME Redfish1 |
| 8 | |
| 9 | Resource ../../lib/resource.robot |
| 10 | Resource ../../lib/common_utils.robot |
| 11 | Resource ../../lib/connection_client.robot |
| 12 | Resource ../../lib/bmc_network_utils.robot |
| 13 | Resource ../../lib/openbmc_ffdc.robot |
Anves Kumar rayankula | 4fa52d7 | 2021-07-04 02:37:30 -0500 | [diff] [blame] | 14 | Resource ../../lib/bmc_ldap_utils.robot |
Anves Kumar rayankula | 2f9632f | 2021-07-05 04:37:45 -0500 | [diff] [blame] | 15 | Resource ../../lib/snmp/resource.robot |
| 16 | Resource ../../lib/snmp/redfish_snmp_utils.robot |
Anves Kumar rayankula | d2e98ff | 2021-06-29 05:03:02 -0500 | [diff] [blame] | 17 | |
| 18 | Suite Setup Suite Setup Execution |
| 19 | Test Teardown FFDC On Test Case Fail |
Anves Kumar rayankula | 4fa52d7 | 2021-07-04 02:37:30 -0500 | [diff] [blame] | 20 | Suite Teardown Run Keywords Redfish1.Logout AND Redfish.Logout |
Anves Kumar rayankula | d2e98ff | 2021-06-29 05:03:02 -0500 | [diff] [blame] | 21 | |
| 22 | *** Test Cases *** |
| 23 | |
Anves Kumar rayankula | 4fa52d7 | 2021-07-04 02:37:30 -0500 | [diff] [blame] | 24 | Verify Both Interfaces BMC IP Addresses Accessible Via SSH |
Anves Kumar rayankula | d2e98ff | 2021-06-29 05:03:02 -0500 | [diff] [blame] | 25 | [Documentation] Verify both interfaces (eth0, eth1) BMC IP addresses accessible via SSH. |
| 26 | [Tags] Verify_Both_Interfaces_BMC_IP_Addresses_Accessible_Via_SSH |
| 27 | |
| 28 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} host=${OPENBMC_HOST} |
| 29 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} host=${OPENBMC_HOST_1} |
| 30 | Close All Connections |
| 31 | |
| 32 | |
Anves Kumar rayankula | 55d5192 | 2021-07-01 06:37:00 -0500 | [diff] [blame] | 33 | Verify Redfish Works On Both Interfaces |
| 34 | [Documentation] Verify access BMC with both interfaces (eth0, eth1) IP addresses via Redfish. |
| 35 | [Tags] Verify_Redfish_Works_On_Both_Interfaces |
| 36 | [Teardown] Run Keywords |
| 37 | ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname} |
| 38 | |
| 39 | Redfish1.Login |
| 40 | Redfish.Login |
| 41 | |
| 42 | ${hostname}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 43 | ${data}= Create Dictionary HostName=openbmc |
| 44 | Redfish1.patch ${REDFISH_NW_ETH_IFACE}eth1 body=&{data} |
| 45 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 46 | |
| 47 | Validate Hostname On BMC openbmc |
| 48 | |
| 49 | ${resp1}= Redfish.Get ${REDFISH_NW_ETH_IFACE}eth0 |
| 50 | ${resp2}= Redfish1.Get ${REDFISH_NW_ETH_IFACE}eth1 |
| 51 | Should Be Equal ${resp1.dict['HostName']} ${resp2.dict['HostName']} |
| 52 | |
Anves Kumar rayankula | 4fa52d7 | 2021-07-04 02:37:30 -0500 | [diff] [blame] | 53 | |
| 54 | Verify LDAP Login Works When Eth1 IP Is Not Configured |
| 55 | [Documentation] Verify LDAP login works when eth1 IP is erased. |
| 56 | [Tags] Verify_LDAP_Login_Works_When_Eth1_IP_Is_Not_Configured |
| 57 | [Setup] Run Keywords Set Test Variable ${CHANNEL_NUMBER} ${2} |
| 58 | ... AND Delete IP Address ${OPENBMC_HOST_1} |
| 59 | [Teardown] Run Keywords Redfish.Login AND |
| 60 | ... Add IP Address ${OPENBMC_HOST_1} ${eth1_subnet_mask} ${eth1_gateway} |
| 61 | |
| 62 | Create LDAP Configuration |
| 63 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 64 | Redfish.Logout |
| 65 | |
| 66 | |
Anves Kumar rayankula | 2f9632f | 2021-07-05 04:37:45 -0500 | [diff] [blame] | 67 | Verify SNMP Works When Eth1 IP Is Not Configured |
| 68 | [Documentation] Verify SNMP works when eth1 IP is not configured. |
| 69 | [Tags] Verify_SNMP_Works_When_Eth1_IP_Is_Not_Configured |
| 70 | [Setup] Run Keywords Set Test Variable ${CHANNEL_NUMBER} ${2} |
| 71 | ... AND Delete IP Address ${OPENBMC_HOST_1} |
| 72 | [Teardown] Run Keywords Redfish.Login AND |
| 73 | ... Add IP Address ${OPENBMC_HOST_1} ${eth1_subnet_mask} ${eth1_gateway} |
| 74 | |
| 75 | Create Error On BMC And Verify Trap |
| 76 | |
| 77 | |
Anves Kumar rayankula | d2e98ff | 2021-06-29 05:03:02 -0500 | [diff] [blame] | 78 | *** Keywords *** |
| 79 | |
| 80 | Get Network Configuration Using Channel Number |
| 81 | [Documentation] Get ethernet interface. |
| 82 | [Arguments] ${channel_number} |
| 83 | |
| 84 | # Description of argument(s): |
| 85 | # channel_number Ethernet channel number, 1 is for eth0 and 2 is for eth1 (e.g. "1"). |
| 86 | |
| 87 | ${active_channel_config}= Get Active Channel Config |
| 88 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| 89 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 90 | |
| 91 | @{network_configurations}= Get From Dictionary ${resp.dict} IPv4StaticAddresses |
| 92 | [Return] @{network_configurations} |
| 93 | |
| 94 | |
| 95 | Suite Setup Execution |
| 96 | [Documentation] Do suite setup task. |
| 97 | |
| 98 | Valid Value OPENBMC_HOST_1 |
| 99 | |
| 100 | # Check both interfaces are configured and reachable. |
| 101 | Ping Host ${OPENBMC_HOST} |
| 102 | Ping Host ${OPENBMC_HOST_1} |
Anves Kumar rayankula | 4fa52d7 | 2021-07-04 02:37:30 -0500 | [diff] [blame] | 103 | |
| 104 | ${network_configurations}= Get Network Configuration Using Channel Number ${2} |
| 105 | FOR ${network_configuration} IN @{network_configurations} |
| 106 | |
| 107 | Run Keyword If '${network_configuration['Address']}' == '${OPENBMC_HOST_1}' |
| 108 | ... Run Keywords Set Suite Variable ${eth1_subnet_mask} ${network_configuration['SubnetMask']} |
| 109 | ... AND Set Suite Variable ${eth1_gateway} ${network_configuration['Gateway']} |
| 110 | ... AND Exit For Loop |
| 111 | |
| 112 | END |