Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Network interface configuration and verification |
| 3 | ... tests. |
| 4 | |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/bmc_network_utils.robot |
| 7 | Resource ../../lib/openbmc_ffdc.robot |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 8 | Library ../../lib/bmc_network_utils.py |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 9 | Library Collections |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 10 | |
| 11 | Test Setup Test Setup Execution |
| 12 | Test Teardown Test Teardown Execution |
Prashanth Katti | b478d90 | 2020-05-08 10:05:32 -0500 | [diff] [blame] | 13 | Suite Setup Suite Setup Execution |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 14 | |
Prashanth Katti | f34fafa | 2019-06-20 05:04:40 -0500 | [diff] [blame] | 15 | Force Tags Network_Conf_Test |
| 16 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 17 | *** Variables *** |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 18 | ${test_hostname} openbmc |
| 19 | ${test_ipv4_addr} 10.7.7.7 |
| 20 | ${test_ipv4_invalid_addr} 0.0.1.a |
| 21 | ${test_subnet_mask} 255.255.0.0 |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 22 | ${broadcast_ip} 10.7.7.255 |
| 23 | ${loopback_ip} 127.0.0.2 |
| 24 | ${multicast_ip} 224.6.6.6 |
| 25 | ${out_of_range_ip} 10.7.7.256 |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 26 | ${test_ipv4_addr2} 10.7.7.8 |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 27 | |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 28 | # Valid netmask is 4 bytes long and has continuous block of 1s. |
Prashanth Katti | 040c8c1 | 2019-05-31 04:42:05 -0500 | [diff] [blame] | 29 | # Maximum valid value in each octet is 255 and least value is 0. |
| 30 | # 253 is not valid, as binary value is 11111101. |
| 31 | ${invalid_netmask} 255.255.253.0 |
| 32 | ${alpha_netmask} ff.ff.ff.ff |
| 33 | # Maximum value of octet in netmask is 255. |
| 34 | ${out_of_range_netmask} 255.256.255.0 |
| 35 | ${more_byte_netmask} 255.255.255.0.0 |
| 36 | ${less_byte_netmask} 255.255.255 |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 37 | ${threshold_netmask} 255.255.255.255 |
| 38 | ${lowest_netmask} 128.0.0.0 |
| 39 | |
| 40 | # There will be 4 octets in IP address (e.g. xx.xx.xx.xx) |
| 41 | # but trying to configure xx.xx.xx |
| 42 | ${less_octet_ip} 10.3.36 |
| 43 | |
| 44 | # For the address 10.6.6.6, the 10.6.6.0 portion describes the |
| 45 | # network ID and the 6 describe the host. |
| 46 | |
| 47 | ${network_id} 10.7.7.0 |
| 48 | ${hex_ip} 0xa.0xb.0xc.0xd |
| 49 | ${negative_ip} 10.-7.-7.7 |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 50 | @{static_name_servers} 10.5.5.5 |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 51 | @{null_value} null |
Prashanth Katti | afe16b7 | 2019-08-02 00:29:45 -0500 | [diff] [blame] | 52 | @{empty_dictionary} {} |
| 53 | @{string_value} aa.bb.cc.dd |
| 54 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 55 | *** Test Cases *** |
| 56 | |
| 57 | Get IP Address And Verify |
| 58 | [Documentation] Get IP Address And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 59 | [Tags] Get_IP_Address_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 60 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 61 | FOR ${network_configuration} IN @{network_configurations} |
| 62 | Verify IP On BMC ${network_configuration['Address']} |
| 63 | END |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 64 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 65 | Get Netmask And Verify |
| 66 | [Documentation] Get Netmask And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 67 | [Tags] Get_Netmask_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 68 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 69 | FOR ${network_configuration} IN @{network_configurations} |
| 70 | Verify Netmask On BMC ${network_configuration['SubnetMask']} |
| 71 | END |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 72 | |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 73 | Get Gateway And Verify |
| 74 | [Documentation] Get gateway and verify it's existence on the BMC. |
| 75 | [Tags] Get_Gateway_And_Verify |
| 76 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 77 | FOR ${network_configuration} IN @{network_configurations} |
| 78 | Verify Gateway On BMC ${network_configuration['Gateway']} |
| 79 | END |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 80 | |
| 81 | Get MAC Address And Verify |
| 82 | [Documentation] Get MAC address and verify it's existence on the BMC. |
| 83 | [Tags] Get_MAC_Address_And_Verify |
| 84 | |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 85 | ${active_channel_config}= Get Active Channel Config |
| 86 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 87 | |
| 88 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 89 | ${macaddr}= Get From Dictionary ${resp.dict} MACAddress |
| 90 | Validate MAC On BMC ${macaddr} |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 91 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 92 | Verify All Configured IP And Netmask |
| 93 | [Documentation] Verify all configured IP and netmask on BMC. |
| 94 | [Tags] Verify_All_Configured_IP_And_Netmask |
| 95 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 96 | FOR ${network_configuration} IN @{network_configurations} |
| 97 | Verify IP And Netmask On BMC ${network_configuration['Address']} |
| 98 | ... ${network_configuration['SubnetMask']} |
| 99 | END |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 100 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 101 | Get Hostname And Verify |
| 102 | [Documentation] Get hostname via Redfish and verify. |
| 103 | [Tags] Get_Hostname_And_Verify |
| 104 | |
| 105 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 106 | |
| 107 | Validate Hostname On BMC ${hostname} |
| 108 | |
| 109 | Configure Hostname And Verify |
| 110 | [Documentation] Configure hostname via Redfish and verify. |
| 111 | [Tags] Configure_Hostname_And_Verify |
shrsuman123 | 578276c | 2020-08-04 04:28:58 -0500 | [diff] [blame] | 112 | [Teardown] Run Keywords |
| 113 | ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname} |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 114 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 115 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 116 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 117 | Configure Hostname ${test_hostname} |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 118 | Validate Hostname On BMC ${test_hostname} |
| 119 | |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 120 | # Verify configured hostname via redfish. |
| 121 | ${new_hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 122 | Should Be Equal ${new_hostname} ${test_hostname} |
| 123 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 124 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 125 | Add Valid IPv4 Address And Verify |
| 126 | [Documentation] Add IPv4 Address via Redfish and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 127 | [Tags] Add_Valid_IPv4_Address_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 128 | [Teardown] Run Keywords |
| 129 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 130 | |
| 131 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 132 | |
| 133 | Add Invalid IPv4 Address And Verify |
| 134 | [Documentation] Add Invalid IPv4 Address via Redfish and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 135 | [Tags] Add_Invalid_IPv4_Address_And_Verify |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 136 | |
| 137 | Add IP Address ${test_ipv4_invalid_addr} ${test_subnet_mask} |
| 138 | ... ${test_gateway} valid_status_codes=${HTTP_BAD_REQUEST} |
| 139 | |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 140 | Configure Out Of Range IP |
| 141 | [Documentation] Configure out-of-range IP address. |
| 142 | [Tags] Configure_Out_Of_Range_IP |
| 143 | [Template] Add IP Address |
| 144 | |
| 145 | # ip subnet_mask gateway valid_status_codes |
| 146 | ${out_of_range_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 147 | |
| 148 | Configure Broadcast IP |
| 149 | [Documentation] Configure broadcast IP address. |
| 150 | [Tags] Configure_Broadcast_IP |
| 151 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 152 | [Teardown] Clear IP Settings On Fail ${broadcast_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 153 | |
| 154 | # ip subnet_mask gateway valid_status_codes |
| 155 | ${broadcast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 156 | |
| 157 | Configure Multicast IP |
| 158 | [Documentation] Configure multicast IP address. |
| 159 | [Tags] Configure_Multicast_IP |
| 160 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 161 | [Teardown] Clear IP Settings On Fail ${multicast_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 162 | |
| 163 | # ip subnet_mask gateway valid_status_codes |
| 164 | ${multicast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 165 | |
| 166 | Configure Loopback IP |
| 167 | [Documentation] Configure loopback IP address. |
| 168 | [Tags] Configure_Loopback_IP |
| 169 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 170 | [Teardown] Clear IP Settings On Fail ${loopback_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 171 | |
| 172 | # ip subnet_mask gateway valid_status_codes |
| 173 | ${loopback_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 174 | |
| 175 | Add Valid IPv4 Address And Check Persistency |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 176 | [Documentation] Add IPv4 address and check persistency. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 177 | [Tags] Add_Valid_IPv4_Address_And_Check_Persistency |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 178 | [Teardown] Run Keywords |
| 179 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 180 | |
| 181 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 182 | |
| 183 | # Reboot BMC and verify persistency. |
| 184 | OBMC Reboot (off) |
George Keishing | 5c49874 | 2019-08-09 02:14:44 -0500 | [diff] [blame] | 185 | Redfish.Login |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 186 | Verify IP On BMC ${test_ipv4_addr} |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 187 | Verify IP On Redfish URI ${test_ipv4_addr} |
| 188 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 189 | |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 190 | Add Fourth Octet Threshold IP And Verify |
| 191 | [Documentation] Add fourth octet threshold IP and verify. |
| 192 | [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 193 | [Teardown] Run Keywords |
| 194 | ... Delete IP Address 10.7.7.254 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 195 | |
| 196 | Add IP Address 10.7.7.254 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 197 | |
| 198 | Add Fourth Octet Lowest IP And Verify |
| 199 | [Documentation] Add fourth octet lowest IP and verify. |
| 200 | [Tags] Add_Fourth_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 201 | [Teardown] Run Keywords |
| 202 | ... Delete IP Address 10.7.7.1 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 203 | |
| 204 | Add IP Address 10.7.7.1 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 205 | |
| 206 | Add Third Octet Threshold IP And Verify |
| 207 | [Documentation] Add third octet threshold IP and verify. |
| 208 | [Tags] Add_Third_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 209 | [Teardown] Run Keywords |
| 210 | ... Delete IP Address 10.7.255.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 211 | |
| 212 | Add IP Address 10.7.255.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 213 | |
| 214 | Add Third Octet Lowest IP And Verify |
| 215 | [Documentation] Add third octet lowest IP and verify. |
| 216 | [Tags] Add_Third_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 217 | [Teardown] Run Keywords |
| 218 | ... Delete IP Address 10.7.0.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 219 | |
| 220 | Add IP Address 10.7.0.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 221 | |
| 222 | Add Second Octet Threshold IP And Verify |
| 223 | [Documentation] Add second octet threshold IP and verify. |
| 224 | [Tags] Add_Second_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 225 | [Teardown] Run Keywords |
| 226 | ... Delete IP Address 10.255.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 227 | |
| 228 | Add IP Address 10.255.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 229 | |
| 230 | Add Second Octet Lowest IP And Verify |
| 231 | [Documentation] Add second octet lowest IP and verify. |
| 232 | [Tags] Add_Second_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 233 | [Teardown] Run Keywords |
| 234 | ... Delete IP Address 10.0.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 235 | |
| 236 | Add IP Address 10.0.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 237 | |
| 238 | Add First Octet Threshold IP And Verify |
| 239 | [Documentation] Add first octet threshold IP and verify. |
| 240 | [Tags] Add_First_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 241 | [Teardown] Run Keywords |
Anves Kumar rayankula | f757b10 | 2020-07-27 20:41:36 -0500 | [diff] [blame] | 242 | ... Delete IP Address 223.7.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 243 | |
| 244 | Add IP Address 223.7.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 245 | |
| 246 | Add First Octet Lowest IP And Verify |
| 247 | [Documentation] Add first octet lowest IP and verify. |
| 248 | [Tags] Add_First_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 249 | [Teardown] Run Keywords |
| 250 | ... Delete IP Address 1.7.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 251 | |
| 252 | Add IP Address 1.7.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 253 | |
Prashanth Katti | 040c8c1 | 2019-05-31 04:42:05 -0500 | [diff] [blame] | 254 | Configure Invalid Netmask |
| 255 | [Documentation] Verify error while setting invalid netmask. |
| 256 | [Tags] Configure_Invalid_Netmask |
| 257 | [Template] Add IP Address |
| 258 | |
| 259 | # ip subnet_mask gateway valid_status_codes |
| 260 | ${test_ipv4_addr} ${invalid_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 261 | |
| 262 | Configure Out Of Range Netmask |
| 263 | [Documentation] Verify error while setting out of range netmask. |
| 264 | [Tags] Configure_Out_Of_Range_Netmask |
| 265 | [Template] Add IP Address |
| 266 | |
| 267 | # ip subnet_mask gateway valid_status_codes |
| 268 | ${test_ipv4_addr} ${out_of_range_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 269 | |
| 270 | Configure Alpha Netmask |
| 271 | [Documentation] Verify error while setting alpha netmask. |
| 272 | [Tags] Configure_Alpha_Netmask |
| 273 | [Template] Add IP Address |
| 274 | |
| 275 | # ip subnet_mask gateway valid_status_codes |
| 276 | ${test_ipv4_addr} ${alpha_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 277 | |
| 278 | Configure More Byte Netmask |
| 279 | [Documentation] Verify error while setting more byte netmask. |
| 280 | [Tags] Configure_More_Byte_Netmask |
| 281 | [Template] Add IP Address |
| 282 | |
| 283 | # ip subnet_mask gateway valid_status_codes |
| 284 | ${test_ipv4_addr} ${more_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 285 | |
| 286 | Configure Less Byte Netmask |
| 287 | [Documentation] Verify error while setting less byte netmask. |
| 288 | [Tags] Configure_Less_Byte_Netmask |
| 289 | [Template] Add IP Address |
| 290 | |
| 291 | # ip subnet_mask gateway valid_status_codes |
| 292 | ${test_ipv4_addr} ${less_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 293 | |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 294 | Configure Threshold Netmask And Verify |
| 295 | [Documentation] Configure threshold netmask and verify. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 296 | [Tags] Configure_Threshold_Netmask_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 297 | [Teardown] Run Keywords |
| 298 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 299 | |
| 300 | Add IP Address ${test_ipv4_addr} ${threshold_netmask} ${test_gateway} |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 301 | |
| 302 | Configure Lowest Netmask And Verify |
| 303 | [Documentation] Configure lowest netmask and verify. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 304 | [Tags] Configure_Lowest_Netmask_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 305 | [Teardown] Run Keywords |
| 306 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 307 | |
| 308 | Add IP Address ${test_ipv4_addr} ${lowest_netmask} ${test_gateway} |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 309 | |
| 310 | Configure Network ID |
| 311 | [Documentation] Verify error while configuring network ID. |
| 312 | [Tags] Configure_Network_ID |
| 313 | [Template] Add IP Address |
| 314 | [Teardown] Clear IP Settings On Fail ${network_id} |
| 315 | |
| 316 | # ip subnet_mask gateway valid_status_codes |
| 317 | ${network_id} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 318 | |
| 319 | Configure Less Octet IP |
| 320 | [Documentation] Verify error while Configuring less octet IP address. |
| 321 | [Tags] Configure_Less_Octet_IP |
| 322 | [Template] Add IP Address |
| 323 | |
| 324 | # ip subnet_mask gateway valid_status_codes |
| 325 | ${less_octet_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 326 | |
| 327 | Configure Empty IP |
| 328 | [Documentation] Verify error while Configuring empty IP address. |
| 329 | [Tags] Configure_Empty_IP |
| 330 | [Template] Add IP Address |
| 331 | |
| 332 | # ip subnet_mask gateway valid_status_codes |
| 333 | ${EMPTY} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 334 | |
| 335 | Configure Special Char IP |
| 336 | [Documentation] Configure invalid IP address containing special chars. |
| 337 | [Tags] Configure_Special_Char_IP |
| 338 | [Template] Add IP Address |
| 339 | |
| 340 | # ip subnet_mask gateway valid_status_codes |
| 341 | @@@.%%.44.11 ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 342 | |
| 343 | Configure Hexadecimal IP |
| 344 | [Documentation] Configure invalid IP address containing hex value. |
| 345 | [Tags] Configure_Hexadecimal_IP |
| 346 | [Template] Add IP Address |
| 347 | |
| 348 | # ip subnet_mask gateway valid_status_codes |
| 349 | ${hex_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 350 | |
| 351 | Configure Negative Octet IP |
| 352 | [Documentation] Configure invalid IP address containing negative octet. |
| 353 | [Tags] Configure_Negative_Octet_IP |
| 354 | [Template] Add IP Address |
| 355 | |
| 356 | # ip subnet_mask gateway valid_status_codes |
| 357 | ${negative_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 358 | |
Prashanth Katti | 5cad5a0 | 2019-06-20 07:27:10 -0500 | [diff] [blame] | 359 | Configure Incomplete IP For Gateway |
| 360 | [Documentation] Configure incomplete IP for gateway and expect an error. |
| 361 | [Tags] Configure_Incomplete_IP_For_Gateway |
| 362 | [Template] Add IP Address |
| 363 | |
| 364 | # ip subnet_mask gateway valid_status_codes |
| 365 | ${test_ipv4_addr} ${test_subnet_mask} ${less_octet_ip} ${HTTP_BAD_REQUEST} |
| 366 | |
| 367 | Configure Special Char IP For Gateway |
| 368 | [Documentation] Configure special char IP for gateway and expect an error. |
| 369 | [Tags] Configure_Special_Char_IP_For_Gateway |
| 370 | [Template] Add IP Address |
| 371 | |
| 372 | # ip subnet_mask gateway valid_status_codes |
| 373 | ${test_ipv4_addr} ${test_subnet_mask} @@@.%%.44.11 ${HTTP_BAD_REQUEST} |
| 374 | |
| 375 | Configure Hexadecimal IP For Gateway |
| 376 | [Documentation] Configure hexadecimal IP for gateway and expect an error. |
| 377 | [Tags] Configure_Hexadecimal_IP_For_Gateway |
| 378 | [Template] Add IP Address |
| 379 | |
| 380 | # ip subnet_mask gateway valid_status_codes |
| 381 | ${test_ipv4_addr} ${test_subnet_mask} ${hex_ip} ${HTTP_BAD_REQUEST} |
| 382 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 383 | Get DNS Server And Verify |
| 384 | [Documentation] Get DNS server via Redfish and verify. |
| 385 | [Tags] Get_DNS_Server_And_Verify |
| 386 | |
| 387 | Verify CLI and Redfish Nameservers |
| 388 | |
| 389 | Configure DNS Server And Verify |
| 390 | [Documentation] Configure DNS server and verify. |
| 391 | [Tags] Configure_DNS_Server_And_Verify |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 392 | [Setup] DNS Test Setup Execution |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 393 | [Teardown] Run Keywords |
| 394 | ... Configure Static Name Servers AND Test Teardown Execution |
| 395 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 396 | Configure Static Name Servers ${static_name_servers} |
| 397 | Verify CLI and Redfish Nameservers |
| 398 | |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 399 | Delete DNS Server And Verify |
| 400 | [Documentation] Delete DNS server and verify. |
| 401 | [Tags] Delete_DNS_Server_And_Verify |
| 402 | [Setup] DNS Test Setup Execution |
| 403 | [Teardown] Run Keywords |
| 404 | ... Configure Static Name Servers AND Test Teardown Execution |
| 405 | |
| 406 | Delete Static Name Servers |
| 407 | Verify CLI and Redfish Nameservers |
| 408 | |
| 409 | Configure DNS Server And Check Persistency |
| 410 | [Documentation] Configure DNS server and check persistency on reboot. |
| 411 | [Tags] Configure_DNS_Server_And_Check_Persistency |
| 412 | [Setup] DNS Test Setup Execution |
| 413 | [Teardown] Run Keywords |
| 414 | ... Configure Static Name Servers AND Test Teardown Execution |
| 415 | |
| 416 | Configure Static Name Servers ${static_name_servers} |
| 417 | # Reboot BMC and verify persistency. |
| 418 | OBMC Reboot (off) |
Anves Kumar rayankula | 8c628b7 | 2021-02-05 05:03:45 -0600 | [diff] [blame] | 419 | Redfish.Login |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 420 | Verify CLI and Redfish Nameservers |
| 421 | |
Prashanth Katti | 3063ffe | 2019-07-25 04:35:25 -0500 | [diff] [blame] | 422 | Configure Loopback IP For Gateway |
| 423 | [Documentation] Configure loopback IP for gateway and expect an error. |
| 424 | [Tags] Configure_Loopback_IP_For_Gateway |
| 425 | [Template] Add IP Address |
| 426 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 427 | |
| 428 | # ip subnet_mask gateway valid_status_codes |
| 429 | ${test_ipv4_addr} ${test_subnet_mask} ${loopback_ip} ${HTTP_BAD_REQUEST} |
| 430 | |
| 431 | Configure Network ID For Gateway |
| 432 | [Documentation] Configure network ID for gateway and expect an error. |
| 433 | [Tags] Configure_Network_ID_For_Gateway |
| 434 | [Template] Add IP Address |
| 435 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 436 | |
| 437 | # ip subnet_mask gateway valid_status_codes |
| 438 | ${test_ipv4_addr} ${test_subnet_mask} ${network_id} ${HTTP_BAD_REQUEST} |
| 439 | |
| 440 | Configure Multicast IP For Gateway |
| 441 | [Documentation] Configure multicast IP for gateway and expect an error. |
| 442 | [Tags] Configure_Multicast_IP_For_Gateway |
| 443 | [Template] Add IP Address |
| 444 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 445 | |
| 446 | # ip subnet_mask gateway valid_status_codes |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 447 | ${test_ipv4_addr} ${test_subnet_mask} ${multicast_ip} ${HTTP_BAD_REQUEST} |
Prashanth Katti | 3063ffe | 2019-07-25 04:35:25 -0500 | [diff] [blame] | 448 | |
| 449 | Configure Broadcast IP For Gateway |
| 450 | [Documentation] Configure broadcast IP for gateway and expect an error. |
| 451 | [Tags] Configure_Broadcast_IP_For_Gateway |
| 452 | [Template] Add IP Address |
| 453 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 454 | |
| 455 | # ip subnet_mask gateway valid_status_codes |
| 456 | ${test_ipv4_addr} ${test_subnet_mask} ${broadcast_ip} ${HTTP_BAD_REQUEST} |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 457 | |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 458 | Configure Null Value For DNS Server |
| 459 | [Documentation] Configure null value for DNS server and expect an error. |
| 460 | [Tags] Configure_Null_Value_For_DNS_Server |
| 461 | [Setup] DNS Test Setup Execution |
| 462 | [Teardown] Run Keywords |
| 463 | ... Configure Static Name Servers AND Test Teardown Execution |
| 464 | |
| 465 | Configure Static Name Servers ${null_value} ${HTTP_BAD_REQUEST} |
| 466 | |
Prashanth Katti | afe16b7 | 2019-08-02 00:29:45 -0500 | [diff] [blame] | 467 | Configure Empty Value For DNS Server |
| 468 | [Documentation] Configure empty value for DNS server and expect an error. |
| 469 | [Tags] Configure_Empty_Value_For_DNS_Server |
| 470 | [Setup] DNS Test Setup Execution |
| 471 | [Teardown] Run Keywords |
| 472 | ... Configure Static Name Servers AND Test Teardown Execution |
| 473 | |
| 474 | Configure Static Name Servers ${empty_dictionary} ${HTTP_BAD_REQUEST} |
| 475 | |
| 476 | Configure String Value For DNS Server |
| 477 | [Documentation] Configure string value for DNS server and expect an error. |
| 478 | [Tags] Configure_String_Value_For_DNS_Server |
| 479 | [Setup] DNS Test Setup Execution |
| 480 | [Teardown] Run Keywords |
| 481 | ... Configure Static Name Servers AND Test Teardown Execution |
| 482 | |
| 483 | Configure Static Name Servers ${string_value} ${HTTP_BAD_REQUEST} |
| 484 | |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 485 | Modify IPv4 Address And Verify |
| 486 | [Documentation] Modify IP address via Redfish and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 487 | [Tags] Modify_IPv4_Address_And_Verify |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 488 | [Teardown] Run Keywords |
Anves Kumar rayankula | 045814b | 2020-10-09 09:17:05 -0500 | [diff] [blame] | 489 | ... Delete IP Address ${test_ipv4_addr2} AND Test Teardown Execution |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 490 | |
| 491 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 492 | |
| 493 | Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway} |
| 494 | |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 495 | |
Anves Kumar rayankula | 6b9fcd1 | 2020-12-18 01:03:19 -0600 | [diff] [blame] | 496 | Configure Invalid Values For DNS Server |
| 497 | [Documentation] Configure invalid values for DNS server and expect an error. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 498 | [Tags] Configure_Invalid_Values_For_DNS_Server |
Anves Kumar rayankula | 6b9fcd1 | 2020-12-18 01:03:19 -0600 | [diff] [blame] | 499 | [Setup] DNS Test Setup Execution |
| 500 | [Template] Configure Static Name Servers |
| 501 | [Teardown] Run Keywords |
| 502 | ... Configure Static Name Servers AND Test Teardown Execution |
| 503 | |
| 504 | # static_name_servers valid_status_codes |
| 505 | 0xa.0xb.0xc.0xd ${HTTP_BAD_REQUEST} |
| 506 | 10.-7.-7.-7 ${HTTP_BAD_REQUEST} |
| 507 | 10.3.36 ${HTTP_BAD_REQUEST} |
| 508 | @@@.%%.44.11 ${HTTP_BAD_REQUEST} |
| 509 | |
| 510 | |
| 511 | Config Multiple DNS Servers And Verify |
| 512 | [Documentation] Config multiple DNS servers and verify. |
| 513 | [Tags] Config_Multiple_DNS_Servers_And_Verify |
| 514 | [Setup] DNS Test Setup Execution |
| 515 | [Teardown] Run Keywords |
| 516 | ... Configure Static Name Servers AND Test Teardown Execution |
| 517 | |
| 518 | @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7 |
| 519 | Configure Static Name Servers ${list_name_servers} |
| 520 | Verify CLI and Redfish Nameservers |
| 521 | |
| 522 | |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 523 | Configure And Verify Multiple Static IPv4 Addresses |
| 524 | [Documentation] Configure multiple static ipv4 address via Redfish and verify. |
| 525 | [Tags] Configure_And_Verify_Multiple_Static_IPv4_Addresses |
| 526 | [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses} |
| 527 | ... AND Test Teardown Execution |
| 528 | |
| 529 | ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2} |
| 530 | Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway} |
| 531 | |
| 532 | |
| 533 | Configure Multiple Static IPv4 Addresses And Check Persistency |
| 534 | [Documentation] Configure multiple static ipv4 address via Redfish and check persistency. |
| 535 | [Tags] Configure_Multiple_Static_IPv4_Addresses_And_Check_Persistency |
| 536 | [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses} |
| 537 | ... AND Test Teardown Execution |
| 538 | |
| 539 | ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2} |
| 540 | Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway} |
| 541 | |
| 542 | # Reboot BMC and verify persistency. |
| 543 | OBMC Reboot (off) |
Anves Kumar rayankula | 8c628b7 | 2021-02-05 05:03:45 -0600 | [diff] [blame] | 544 | Redfish.Login |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 545 | FOR ${ip} IN @{test_ipv4_addresses} |
| 546 | Verify IP And Netmask On BMC ${ip} ${test_subnet_mask} |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 547 | Verify IP On Redfish URI ${ip} |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 548 | END |
| 549 | |
| 550 | |
Anves Kumar rayankula | 43e93e1 | 2021-01-27 03:52:37 -0600 | [diff] [blame] | 551 | Configure And Verify Multiple IPv4 Addresses |
| 552 | [Documentation] Configure multiple IPv4 addresses and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 553 | [Tags] Configure_And_Verify_Multiple_IPv4_Addresses |
Anves Kumar rayankula | 43e93e1 | 2021-01-27 03:52:37 -0600 | [diff] [blame] | 554 | [Teardown] Run Keywords |
| 555 | ... Delete IP Address ${test_ipv4_addr} AND Delete IP Address ${test_ipv4_addr2} |
| 556 | ... AND Test Teardown Execution |
| 557 | |
| 558 | ${ip1}= Create dictionary Address=${test_ipv4_addr} |
| 559 | ... SubnetMask=255.255.0.0 Gateway=${test_gateway} |
| 560 | ${ip2}= Create dictionary Address=${test_ipv4_addr2} |
| 561 | ... SubnetMask=255.255.252.0 Gateway=${test_gateway} |
| 562 | |
| 563 | ${empty_dict}= Create Dictionary |
| 564 | ${patch_list}= Create List |
| 565 | ${network_configurations}= Get Network Configuration |
| 566 | ${num_entries}= Get Length ${network_configurations} |
| 567 | |
| 568 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 569 | Append To List ${patch_list} ${empty_dict} |
| 570 | END |
| 571 | |
| 572 | # We need not check for existence of IP on BMC while adding. |
| 573 | Append To List ${patch_list} ${ip1} ${ip2} |
| 574 | ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list} |
| 575 | ${active_channel_config}= Get Active Channel Config |
| 576 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 577 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{payload} |
Anves Kumar rayankula | 53b8030 | 2021-05-21 01:50:03 -0500 | [diff] [blame] | 578 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
Anves Kumar rayankula | 43e93e1 | 2021-01-27 03:52:37 -0600 | [diff] [blame] | 579 | |
| 580 | # Note: Network restart takes around 15-18s after patch request processing. |
| 581 | Sleep ${NETWORK_TIMEOUT}s |
| 582 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 583 | Verify IP On BMC ${test_ipv4_addr} |
| 584 | Verify IP On BMC ${test_ipv4_addr2} |
| 585 | |
| 586 | |
Anves Kumar rayankula | eefdb56 | 2021-02-08 07:54:11 -0600 | [diff] [blame] | 587 | Config Multiple DNS Servers And Check Persistency |
| 588 | [Documentation] Config multiple DNS and check persistency. |
| 589 | [Tags] Config_Multiple_DNS_Servers_And_Check_Persistency |
| 590 | [Setup] DNS Test Setup Execution |
| 591 | [Teardown] Run Keywords |
| 592 | ... Configure Static Name Servers AND Test Teardown Execution |
| 593 | |
| 594 | @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7 |
| 595 | Configure Static Name Servers ${list_name_servers} |
| 596 | |
| 597 | # Reboot BMC and verify persistency. |
| 598 | OBMC Reboot (off) |
| 599 | Redfish.Login |
| 600 | Verify CLI and Redfish Nameservers |
| 601 | |
Anves Kumar rayankula | 2f137eb | 2021-03-29 01:12:01 -0500 | [diff] [blame] | 602 | |
| 603 | Configure Static IP Without Using Gateway And Verify |
| 604 | [Documentation] Configure static IP without using gateway and verify error. |
| 605 | [Tags] Configure_Static_IP_Without_Using_Gateway_And_Verify |
| 606 | |
| 607 | ${ip}= Create dictionary Address=${test_ipv4_addr} |
| 608 | ... SubnetMask=${test_subnet_mask} |
| 609 | ${empty_dict}= Create Dictionary |
| 610 | ${patch_list}= Create List |
| 611 | ${network_configurations}= Get Network Configuration |
| 612 | |
| 613 | ${num_entries}= Get Length ${network_configurations} |
| 614 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 615 | Append To List ${patch_list} ${empty_dict} |
| 616 | END |
| 617 | |
| 618 | # We need not check for existence of IP on BMC while adding. |
| 619 | Append To List ${patch_list} ${ip} |
| 620 | ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list} |
| 621 | ${active_channel_config}= Get Active Channel Config |
| 622 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 623 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 624 | ... body=&{payload} valid_status_codes=[${HTTP_BAD_REQUEST}] |
| 625 | |
Anves Kumar rayankula | ac0a7ba | 2021-03-09 08:10:20 -0600 | [diff] [blame] | 626 | |
| 627 | Test Network Response On Specified Host State |
| 628 | [Documentation] Verifying the BMC network response when host is on and off. |
| 629 | [Tags] Test_Network_Response_On_Specified_Host_State |
| 630 | [Template] Verify Network Response On Specified Host State |
| 631 | |
| 632 | # host_state |
| 633 | on |
| 634 | off |
| 635 | |
Sweta Potthuri | fb00136 | 2022-03-14 02:21:14 -0500 | [diff] [blame] | 636 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 637 | *** Keywords *** |
| 638 | |
| 639 | Test Setup Execution |
| 640 | [Documentation] Test setup execution. |
| 641 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 642 | Redfish.Login |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 643 | |
| 644 | @{network_configurations}= Get Network Configuration |
| 645 | Set Test Variable @{network_configurations} |
| 646 | |
| 647 | # Get BMC IP address and prefix length. |
| 648 | ${ip_data}= Get BMC IP Info |
| 649 | Set Test Variable ${ip_data} |
| 650 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 651 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 652 | Verify Netmask On BMC |
| 653 | [Documentation] Verify netmask on BMC. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 654 | [Arguments] ${netmask} |
| 655 | |
| 656 | # Description of the argument(s): |
| 657 | # netmask netmask value to be verified. |
| 658 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 659 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 660 | |
| 661 | Should Contain Match ${ip_data} */${prefix_length} |
| 662 | ... msg=Prefix length does not exist. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 663 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 664 | Verify IP And Netmask On BMC |
| 665 | [Documentation] Verify IP and netmask on BMC. |
| 666 | [Arguments] ${ip} ${netmask} |
| 667 | |
| 668 | # Description of the argument(s): |
| 669 | # ip IP address to be verified. |
| 670 | # netmask netmask value to be verified. |
| 671 | |
| 672 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 673 | @{ip_data}= Get BMC IP Info |
| 674 | |
| 675 | ${ip_with_netmask}= Catenate ${ip}/${prefix_length} |
| 676 | Should Contain ${ip_data} ${ip_with_netmask} |
| 677 | ... msg=IP and netmask pair does not exist. |
| 678 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 679 | Test Teardown Execution |
| 680 | [Documentation] Test teardown execution. |
| 681 | |
| 682 | FFDC On Test Case Fail |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 683 | Redfish.Logout |
Prashanth Katti | a844251 | 2019-06-07 06:47:09 -0500 | [diff] [blame] | 684 | |
| 685 | Clear IP Settings On Fail |
| 686 | [Documentation] Clear IP settings on fail. |
| 687 | [Arguments] ${ip} |
| 688 | |
| 689 | # Description of argument(s): |
| 690 | # ip IP address to be deleted. |
| 691 | |
| 692 | Run Keyword If '${TEST STATUS}' == 'FAIL' |
| 693 | ... Delete IP Address ${ip} |
| 694 | |
| 695 | Test Teardown Execution |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 696 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 697 | Verify CLI and Redfish Nameservers |
| 698 | [Documentation] Verify that nameservers obtained via Redfish do not |
| 699 | ... match those found in /etc/resolv.conf. |
| 700 | |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 701 | ${active_channel_config}= Get Active Channel Config |
| 702 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 703 | |
Anves Kumar rayankula | 91548ea | 2020-06-18 00:28:13 -0500 | [diff] [blame] | 704 | ${redfish_nameservers}= Redfish.Get Attribute |
| 705 | ... ${REDFISH_NW_ETH_IFACE}${ethernet_interface} StaticNameServers |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 706 | ${resolve_conf_nameservers}= CLI Get Nameservers |
Michael Walsh | 39c0051 | 2019-07-17 10:54:06 -0500 | [diff] [blame] | 707 | Rqprint Vars redfish_nameservers resolve_conf_nameservers |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 708 | |
Sweta Potthuri | d77ea98 | 2021-07-01 04:30:38 -0500 | [diff] [blame] | 709 | List Should Contain Sub List ${resolve_conf_nameservers} ${redfish_nameservers} |
| 710 | ... msg=The nameservers obtained via Redfish do not match those found in /etc/resolv.conf. |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 711 | |
| 712 | Configure Static Name Servers |
| 713 | [Documentation] Configure DNS server on BMC. |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 714 | [Arguments] ${static_name_servers}=${original_nameservers} |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 715 | ... ${valid_status_codes}=${HTTP_OK} |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 716 | |
George Keishing | 9cb2e59 | 2019-07-12 09:37:33 -0500 | [diff] [blame] | 717 | # Description of the argument(s): |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 718 | # static_name_servers A list of static name server IPs to be |
| 719 | # configured on the BMC. |
| 720 | |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 721 | ${active_channel_config}= Get Active Channel Config |
| 722 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 723 | |
Anves Kumar rayankula | 6b9fcd1 | 2020-12-18 01:03:19 -0600 | [diff] [blame] | 724 | ${type} = Evaluate type($static_name_servers).__name__ |
| 725 | ${static_name_servers}= Set Variable If '${type}'=='str' |
| 726 | ... '${static_name_servers}' ${static_name_servers} |
| 727 | |
Prashanth Katti | 9d995fc | 2019-09-24 01:29:06 -0500 | [diff] [blame] | 728 | # Currently BMC is sending 500 response code instead of 400 for invalid scenarios. |
Anves Kumar rayankula | 91548ea | 2020-06-18 00:28:13 -0500 | [diff] [blame] | 729 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 730 | ... body={'StaticNameServers': ${static_name_servers}} |
Prashanth Katti | 9d995fc | 2019-09-24 01:29:06 -0500 | [diff] [blame] | 731 | ... valid_status_codes=[${valid_status_codes}, ${HTTP_INTERNAL_SERVER_ERROR}] |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 732 | |
Prashanth Katti | f247be3 | 2019-10-07 04:40:43 -0500 | [diff] [blame] | 733 | # Patch operation takes 1 to 3 seconds to set new value. |
| 734 | Sleep 3s |
| 735 | |
Prashanth Katti | 7f9e60f | 2019-07-26 01:18:41 -0500 | [diff] [blame] | 736 | # Check if newly added DNS server is configured on BMC. |
| 737 | ${cli_nameservers}= CLI Get Nameservers |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 738 | ${cmd_status}= Run Keyword And Return Status |
| 739 | ... List Should Contain Sub List ${cli_nameservers} ${static_name_servers} |
| 740 | |
| 741 | Run Keyword If '${valid_status_codes}' == '${HTTP_OK}' |
| 742 | ... Should Be True ${cmd_status} == ${True} |
| 743 | ... ELSE Should Be True ${cmd_status} == ${False} |
Prashanth Katti | 7f9e60f | 2019-07-26 01:18:41 -0500 | [diff] [blame] | 744 | |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 745 | Delete Static Name Servers |
| 746 | [Documentation] Delete static name servers. |
| 747 | |
Sweta Potthuri | dc32593 | 2022-06-15 12:51:27 -0500 | [diff] [blame] | 748 | DNS Test Setup Execution |
Anves Kumar rayankula | 045814b | 2020-10-09 09:17:05 -0500 | [diff] [blame] | 749 | Configure Static Name Servers static_name_servers=@{EMPTY} |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 750 | |
| 751 | # Check if all name servers deleted on BMC. |
| 752 | ${nameservers}= CLI Get Nameservers |
Sweta Potthuri | dc32593 | 2022-06-15 12:51:27 -0500 | [diff] [blame] | 753 | Should Not Contain ${nameservers} ${original_nameservers} |
| 754 | |
| 755 | DNS Test Setup Execution |
| 756 | |
| 757 | Should Be Empty ${original_nameservers} |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 758 | |
| 759 | DNS Test Setup Execution |
| 760 | [Documentation] Do DNS test setup execution. |
| 761 | |
| 762 | Redfish.Login |
| 763 | |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 764 | ${active_channel_config}= Get Active Channel Config |
| 765 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 766 | |
Anves Kumar rayankula | 91548ea | 2020-06-18 00:28:13 -0500 | [diff] [blame] | 767 | ${original_nameservers}= Redfish.Get Attribute |
| 768 | ... ${REDFISH_NW_ETH_IFACE}${ethernet_interface} StaticNameServers |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 769 | |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 770 | Rprint Vars original_nameservers |
| 771 | # Set suite variables to trigger restoration during teardown. |
| 772 | Set Suite Variable ${original_nameservers} |
Prashanth Katti | b478d90 | 2020-05-08 10:05:32 -0500 | [diff] [blame] | 773 | |
| 774 | Suite Setup Execution |
| 775 | [Documentation] Do suite setup execution. |
| 776 | |
| 777 | ${test_gateway}= Get BMC Default Gateway |
| 778 | Set Suite Variable ${test_gateway} |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 779 | |
| 780 | Update IP Address |
| 781 | [Documentation] Update IP address of BMC. |
Anves Kumar rayankula | 53b8030 | 2021-05-21 01:50:03 -0500 | [diff] [blame] | 782 | [Arguments] ${ip} ${new_ip} ${netmask} ${gw_ip} |
| 783 | ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 784 | |
| 785 | # Description of argument(s): |
| 786 | # ip IP address to be replaced (e.g. "10.7.7.7"). |
| 787 | # new_ip New IP address to be configured. |
| 788 | # netmask Netmask value. |
| 789 | # gw_ip Gateway IP address. |
| 790 | # valid_status_codes Expected return code from patch operation |
| 791 | # (e.g. "200"). See prolog of rest_request |
| 792 | # method in redfish_plus.py for details. |
| 793 | |
| 794 | ${empty_dict}= Create Dictionary |
| 795 | ${patch_list}= Create List |
| 796 | ${ip_data}= Create Dictionary Address=${new_ip} SubnetMask=${netmask} Gateway=${gw_ip} |
| 797 | |
| 798 | # Find the position of IP address to be modified. |
| 799 | @{network_configurations}= Get Network Configuration |
| 800 | FOR ${network_configuration} IN @{network_configurations} |
| 801 | Run Keyword If '${network_configuration['Address']}' == '${ip}' |
| 802 | ... Append To List ${patch_list} ${ip_data} |
| 803 | ... ELSE Append To List ${patch_list} ${empty_dict} |
| 804 | END |
| 805 | |
| 806 | ${ip_found}= Run Keyword And Return Status List Should Contain Value |
| 807 | ... ${patch_list} ${ip_data} msg=${ip} does not exist on BMC |
| 808 | Pass Execution If ${ip_found} == ${False} ${ip} does not exist on BMC |
| 809 | |
| 810 | # Run patch command only if given IP is found on BMC |
| 811 | ${data}= Create Dictionary IPv4StaticAddresses=${patch_list} |
| 812 | |
Anves Kumar rayankula | abf6854 | 2021-06-23 00:14:54 -0500 | [diff] [blame] | 813 | ${active_channel_config}= Get Active Channel Config |
| 814 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 815 | |
| 816 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 817 | ... body=&{data} valid_status_codes=${valid_status_codes} |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 818 | |
| 819 | # Note: Network restart takes around 15-18s after patch request processing. |
| 820 | Sleep ${NETWORK_TIMEOUT}s |
| 821 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 822 | |
| 823 | Verify IP On BMC ${new_ip} |
| 824 | Validate Network Config On BMC |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 825 | |
| 826 | Configure Multiple Static IPv4 Addresses |
| 827 | [Documentation] Configure multiple static ipv4 address via Redfish and verify. |
| 828 | [Arguments] ${ip_addreses} ${subnet_mask} ${gateway} |
| 829 | |
| 830 | # Description of argument(s): |
| 831 | # ip_addreses A list of IP addresses to be added (e.g.["10.7.7.7"]). |
| 832 | # subnet_mask Subnet mask for the IP to be added (e.g. "255.255.0.0"). |
| 833 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 834 | |
| 835 | FOR ${ip} IN @{ip_addreses} |
| 836 | Add IP Address ${ip} ${subnet_mask} ${gateway} |
| 837 | END |
| 838 | Validate Network Config On BMC |
| 839 | |
| 840 | |
| 841 | Delete Multiple Static IPv4 Addresses |
| 842 | [Documentation] Delete multiple static ipv4 address via Redfish. |
| 843 | [Arguments] ${ip_addreses} |
| 844 | |
| 845 | # Description of argument(s): |
| 846 | # ip_addreses A list of IP addresses to be deleted (e.g.["10.7.7.7"]). |
| 847 | |
| 848 | FOR ${ip} IN @{ip_addreses} |
| 849 | Delete IP Address ${ip} |
| 850 | END |
| 851 | Validate Network Config On BMC |
Anves Kumar rayankula | ac0a7ba | 2021-03-09 08:10:20 -0600 | [diff] [blame] | 852 | |
| 853 | Verify Network Response On Specified Host State |
| 854 | [Documentation] Verifying the BMC network response when host is on and off. |
| 855 | [Arguments] ${host_state} |
| 856 | |
| 857 | # Description of argument(s): |
| 858 | # host_state if host_state is on then host is booted to operating system. |
| 859 | # if host_state is off then host is power off. |
| 860 | # (eg. on, off). |
| 861 | |
| 862 | ${active_channel_config}= Get Active Channel Config |
| 863 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 864 | |
| 865 | Run Keyword If '${host_state}' == 'on' |
| 866 | ... Redfish Power On stack_mode=skip |
| 867 | ... ELSE |
| 868 | ... Redfish Power off stack_mode=skip |
| 869 | |
| 870 | Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 871 | Ping Host ${OPENBMC_HOST} |
| 872 | |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 873 | |
| 874 | Verify IP On Redfish URI |
| 875 | [Documentation] Verify given IP on redfish URI. |
| 876 | [Arguments] ${ip_address} |
| 877 | |
| 878 | # Description of argument(s): |
| 879 | # ip_address Configured IP address which need to verified. |
| 880 | |
| 881 | ${network_configurations}= Get Network Configuration |
| 882 | |
| 883 | FOR ${network_configuration} IN @{network_configurations} |
| 884 | ${ip_found}= Set Variable If '${network_configuration['Address']}' == '${ip_address}' ${True} |
| 885 | ... ${False} |
| 886 | Exit For Loop If ${ip_found} |
| 887 | END |
| 888 | Run Keyword If '${ip_found}' == '${False}' |
| 889 | ... Fail msg=Configured IP address not found on EthernetInterface URI. |