| 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. | 
| Prashanth Katti | 2c73abc | 2021-03-17 07:42:25 -0500 | [diff] [blame] | 46 |  | 
|  | 47 | ${resp}=  Redfish.Get  ${REDFISH_NW_ETH_IFACE}${ethernet_interface} | 
|  | 48 | ${ipv6_gateway}=  Get From Dictionary  ${resp.dict}  IPv6DefaultGateway | 
|  | 49 | Verify IPv6 Default Gateway On BMC  ${ipv6_gateway} | 
|  | 50 |  | 
|  | 51 |  | 
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 52 | *** Keywords *** | 
|  | 53 |  | 
| Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 54 | Suite Setup Execution | 
|  | 55 | [Documentation]  Do suite setup execution. | 
|  | 56 |  | 
|  | 57 | ${active_channel_config}=  Get Active Channel Config | 
|  | 58 | ${ethernet_interface}=  Set Variable  ${active_channel_config['${CHANNEL_NUMBER}']['name']} | 
|  | 59 |  | 
|  | 60 | Set Suite variable  ${ethernet_interface} | 
|  | 61 |  | 
|  | 62 |  | 
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 63 | Test Setup Execution | 
|  | 64 | [Documentation]  Test setup execution. | 
|  | 65 |  | 
|  | 66 | Redfish.Login | 
|  | 67 |  | 
|  | 68 | @{ipv6_network_configurations}=  Get IPv6 Network Configuration | 
|  | 69 | Set Test Variable  @{ipv6_network_configurations} | 
|  | 70 |  | 
|  | 71 | # Get BMC IPv6 address and prefix length. | 
|  | 72 | ${ipv6_data}=  Get BMC IPv6 Info | 
|  | 73 | Set Test Variable  ${ipv6_data} | 
|  | 74 |  | 
|  | 75 |  | 
|  | 76 | Test Teardown Execution | 
|  | 77 | [Documentation]  Test teardown execution. | 
|  | 78 |  | 
|  | 79 | FFDC On Test Case Fail | 
|  | 80 | Redfish.Logout | 
|  | 81 |  | 
|  | 82 |  | 
|  | 83 | Get IPv6 Network Configuration | 
|  | 84 | [Documentation]  Get Ipv6 network configuration. | 
|  | 85 | # Sample output: | 
|  | 86 | # { | 
|  | 87 | #  "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", | 
|  | 88 | #  "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface", | 
|  | 89 | #   "DHCPv4": { | 
|  | 90 | #    "DHCPEnabled": false, | 
|  | 91 | #    "UseDNSServers": false, | 
|  | 92 | #    "UseDomainName": true, | 
|  | 93 | #    "UseNTPServers": false | 
|  | 94 | #  }, | 
|  | 95 | #  "DHCPv6": { | 
|  | 96 | #    "OperatingMode": "Disabled", | 
|  | 97 | #    "UseDNSServers": false, | 
|  | 98 | #    "UseDomainName": true, | 
|  | 99 | #    "UseNTPServers": false | 
|  | 100 | #  }, | 
|  | 101 | #  "Description": "Management Network Interface", | 
|  | 102 | #  "FQDN": "localhost", | 
|  | 103 | #  "HostName": "localhost", | 
|  | 104 | #  "IPv4Addresses": [ | 
|  | 105 | #    { | 
|  | 106 | #      "Address": "xx.xx.xx.xx", | 
|  | 107 | #      "AddressOrigin": "Static", | 
|  | 108 | #      "Gateway": "xx.xx.xx.1", | 
|  | 109 | #      "SubnetMask": "xx.xx.xx.0" | 
|  | 110 | #    }, | 
|  | 111 | #    { | 
|  | 112 | #      "Address": "169.254.xx.xx", | 
|  | 113 | #      "AddressOrigin": "IPv4LinkLocal", | 
|  | 114 | #      "Gateway": "0.0.0.0", | 
|  | 115 | #      "SubnetMask": "xx.xx.0.0" | 
|  | 116 | #    }, | 
|  | 117 | #  ], | 
|  | 118 | #  "IPv4StaticAddresses": [ | 
|  | 119 | #    { | 
|  | 120 | #      "Address": "xx.xx.xx.xx", | 
|  | 121 | #      "AddressOrigin": "Static", | 
|  | 122 | #      "Gateway": "xx.xx.xx.1", | 
|  | 123 | #      "SubnetMask": "xx.xx.0.0" | 
|  | 124 | #    } | 
|  | 125 | # } | 
|  | 126 | #  ], | 
|  | 127 | #  "IPv6AddressPolicyTable": [], | 
|  | 128 | #  "IPv6Addresses": [ | 
|  | 129 | #    { | 
|  | 130 | #      "Address": "fe80::xxxx:xxxx:xxxx:xxxx", | 
|  | 131 | #      "AddressOrigin": "LinkLocal", | 
|  | 132 | #      "AddressState": null, | 
|  | 133 | #      "PrefixLength": xx | 
|  | 134 | #    } | 
|  | 135 | #  ], | 
|  | 136 | #  "IPv6DefaultGateway": "", | 
|  | 137 | #  "IPv6StaticAddresses": [ | 
|  | 138 | #    { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx", | 
|  | 139 | #      "AddressOrigin": "Static", | 
|  | 140 | #      "AddressState": null, | 
|  | 141 | #      "PrefixLength": xxx | 
|  | 142 | #    } | 
|  | 143 | #  ], | 
|  | 144 | #  "Id": "eth0", | 
|  | 145 | #  "InterfaceEnabled": true, | 
|  | 146 | #  "LinkStatus": "LinkUp", | 
|  | 147 | #  "MACAddress": "xx:xx:xx:xx:xx:xx", | 
|  | 148 | #  "Name": "Manager Ethernet Interface", | 
|  | 149 | #  "NameServers": [], | 
|  | 150 | #  "SpeedMbps": 0, | 
|  | 151 | #  "StaticNameServers": [], | 
|  | 152 | #  "Status": { | 
|  | 153 | #    "Health": "OK", | 
|  | 154 | #    "HealthRollup": "OK", | 
|  | 155 | #    "State": "Enabled" | 
|  | 156 | #  }, | 
|  | 157 | #  "VLANs": { | 
|  | 158 | #    "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/VLANs" | 
|  | 159 |  | 
|  | 160 |  | 
|  | 161 | ${active_channel_config}=  Get Active Channel Config | 
|  | 162 | ${resp}=  Redfish.Get  ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']} | 
|  | 163 |  | 
|  | 164 | @{ipv6_network_configurations}=  Get From Dictionary  ${resp.dict}  IPv6StaticAddresses | 
|  | 165 | [Return]  @{ipv6_network_configurations} |