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