Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Network interface IPv6 configuration and verification |
| 3 | ... tests. |
| 4 | |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/bmc_ipv6_utils.robot |
| 8 | Library ../../lib/bmc_network_utils.py |
| 9 | Library Collections |
| 10 | |
| 11 | Test Setup Test Setup Execution |
| 12 | Test Teardown Test Teardown Execution |
Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 13 | Suite Setup Suite Setup Execution |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 14 | |
| 15 | |
| 16 | *** Variables *** |
| 17 | ${test_ipv6_addr} 2001:db8:3333:4444:5555:6666:7777:8888 |
| 18 | ${test_ipv6_invalid_addr} 2001:db8:3333:4444:5555:6666:7777:JJJJ |
| 19 | |
| 20 | # Valid prefix length is a intiger ranges from 1 to 128. |
| 21 | ${test_prefix_lenght} 64 |
| 22 | |
| 23 | |
| 24 | *** Test Cases *** |
| 25 | |
| 26 | Get IPv6 Address And Verify |
| 27 | [Documentation] Get IPv6 Address And Verify. |
| 28 | [Tags] Get_IPv6_Address_And_Verify |
| 29 | |
| 30 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 31 | Verify IPv6 On BMC ${ipv6_network_configuration['Address']} |
| 32 | END |
| 33 | |
| 34 | |
Prashanth Katti | 2c73abc | 2021-03-17 07:42:25 -0500 | [diff] [blame] | 35 | Get PrefixLength And Verify |
| 36 | [Documentation] Get IPv6 prefix length and verify. |
| 37 | [Tags] Get_PrefixLength_And_Verify |
| 38 | |
| 39 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 40 | Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']} |
| 41 | END |
| 42 | |
| 43 | |
| 44 | Get IPv6 Default Gateway And Verify |
George Keishing | 9614383 | 2021-03-23 07:55:08 -0500 | [diff] [blame] | 45 | [Documentation] Get IPv6 default gateway and verify. |
George Keishing | ade6ab4 | 2022-07-19 11:41:03 -0500 | [diff] [blame] | 46 | [Tags] Get_IPv6_Default_Gateway_And_Verify |
Prashanth Katti | 2c73abc | 2021-03-17 07:42:25 -0500 | [diff] [blame] | 47 | |
| 48 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 49 | ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway |
| 50 | Verify IPv6 Default Gateway On BMC ${ipv6_gateway} |
| 51 | |
| 52 | |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 53 | *** Keywords *** |
| 54 | |
Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 55 | Suite Setup Execution |
| 56 | [Documentation] Do suite setup execution. |
| 57 | |
| 58 | ${active_channel_config}= Get Active Channel Config |
| 59 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 60 | |
| 61 | Set Suite variable ${ethernet_interface} |
| 62 | |
| 63 | |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 64 | Test Setup Execution |
| 65 | [Documentation] Test setup execution. |
| 66 | |
| 67 | Redfish.Login |
| 68 | |
| 69 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 70 | Set Test Variable @{ipv6_network_configurations} |
| 71 | |
| 72 | # Get BMC IPv6 address and prefix length. |
| 73 | ${ipv6_data}= Get BMC IPv6 Info |
| 74 | Set Test Variable ${ipv6_data} |
| 75 | |
| 76 | |
| 77 | Test Teardown Execution |
| 78 | [Documentation] Test teardown execution. |
| 79 | |
| 80 | FFDC On Test Case Fail |
| 81 | Redfish.Logout |
| 82 | |
| 83 | |
| 84 | Get IPv6 Network Configuration |
| 85 | [Documentation] Get Ipv6 network configuration. |
| 86 | # Sample output: |
| 87 | # { |
| 88 | # "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", |
| 89 | # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface", |
| 90 | # "DHCPv4": { |
| 91 | # "DHCPEnabled": false, |
| 92 | # "UseDNSServers": false, |
| 93 | # "UseDomainName": true, |
| 94 | # "UseNTPServers": false |
| 95 | # }, |
| 96 | # "DHCPv6": { |
| 97 | # "OperatingMode": "Disabled", |
| 98 | # "UseDNSServers": false, |
| 99 | # "UseDomainName": true, |
| 100 | # "UseNTPServers": false |
| 101 | # }, |
| 102 | # "Description": "Management Network Interface", |
| 103 | # "FQDN": "localhost", |
| 104 | # "HostName": "localhost", |
| 105 | # "IPv4Addresses": [ |
| 106 | # { |
| 107 | # "Address": "xx.xx.xx.xx", |
| 108 | # "AddressOrigin": "Static", |
| 109 | # "Gateway": "xx.xx.xx.1", |
| 110 | # "SubnetMask": "xx.xx.xx.0" |
| 111 | # }, |
| 112 | # { |
| 113 | # "Address": "169.254.xx.xx", |
| 114 | # "AddressOrigin": "IPv4LinkLocal", |
| 115 | # "Gateway": "0.0.0.0", |
| 116 | # "SubnetMask": "xx.xx.0.0" |
| 117 | # }, |
| 118 | # ], |
| 119 | # "IPv4StaticAddresses": [ |
| 120 | # { |
| 121 | # "Address": "xx.xx.xx.xx", |
| 122 | # "AddressOrigin": "Static", |
| 123 | # "Gateway": "xx.xx.xx.1", |
| 124 | # "SubnetMask": "xx.xx.0.0" |
| 125 | # } |
| 126 | # } |
| 127 | # ], |
| 128 | # "IPv6AddressPolicyTable": [], |
| 129 | # "IPv6Addresses": [ |
| 130 | # { |
| 131 | # "Address": "fe80::xxxx:xxxx:xxxx:xxxx", |
| 132 | # "AddressOrigin": "LinkLocal", |
| 133 | # "AddressState": null, |
| 134 | # "PrefixLength": xx |
| 135 | # } |
| 136 | # ], |
| 137 | # "IPv6DefaultGateway": "", |
| 138 | # "IPv6StaticAddresses": [ |
| 139 | # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx", |
| 140 | # "AddressOrigin": "Static", |
| 141 | # "AddressState": null, |
| 142 | # "PrefixLength": xxx |
| 143 | # } |
| 144 | # ], |
| 145 | # "Id": "eth0", |
| 146 | # "InterfaceEnabled": true, |
| 147 | # "LinkStatus": "LinkUp", |
| 148 | # "MACAddress": "xx:xx:xx:xx:xx:xx", |
| 149 | # "Name": "Manager Ethernet Interface", |
| 150 | # "NameServers": [], |
| 151 | # "SpeedMbps": 0, |
| 152 | # "StaticNameServers": [], |
| 153 | # "Status": { |
| 154 | # "Health": "OK", |
| 155 | # "HealthRollup": "OK", |
| 156 | # "State": "Enabled" |
| 157 | # }, |
| 158 | # "VLANs": { |
| 159 | # "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/VLANs" |
| 160 | |
| 161 | |
| 162 | ${active_channel_config}= Get Active Channel Config |
| 163 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 164 | |
| 165 | @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses |
| 166 | [Return] @{ipv6_network_configurations} |