blob: 8a8abb3ce10aee3dab02778879c853e759d9953b [file] [log] [blame]
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -05001*** Settings ***
2Documentation 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.
6Library ../../lib/bmc_redfish.py https://${OPENBMC_HOST_1}:${HTTPS_PORT}
7... ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} WITH NAME Redfish1
8
9Resource ../../lib/resource.robot
10Resource ../../lib/common_utils.robot
11Resource ../../lib/connection_client.robot
12Resource ../../lib/bmc_network_utils.robot
13Resource ../../lib/openbmc_ffdc.robot
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050014Resource ../../lib/bmc_ldap_utils.robot
Anves Kumar rayankula2f9632f2021-07-05 04:37:45 -050015Resource ../../lib/snmp/resource.robot
16Resource ../../lib/snmp/redfish_snmp_utils.robot
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050017
18Suite Setup Suite Setup Execution
19Test Teardown FFDC On Test Case Fail
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050020Suite Teardown Run Keywords Redfish1.Logout AND Redfish.Logout
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050021
22*** Test Cases ***
23
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050024Verify Both Interfaces BMC IP Addresses Accessible Via SSH
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050025 [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 rayankula55d51922021-07-01 06:37:00 -050033Verify 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 rayankula4fa52d72021-07-04 02:37:30 -050053
54Verify 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 rayankula2f9632f2021-07-05 04:37:45 -050067Verify 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 rayankulad2e98ff2021-06-29 05:03:02 -050078*** Keywords ***
79
80Get 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
95Suite 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 rayankula4fa52d72021-07-04 02:37:30 -0500103
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