blob: 9759a670b2d208a96cb55bd303134b8cb81217e8 [file] [log] [blame]
Prashanth Katti8abbb4d2021-01-29 02:17:45 -06001*** Settings ***
2Documentation Network interface IPv6 configuration and verification
3 ... tests.
4
5Resource ../../lib/bmc_redfish_resource.robot
6Resource ../../lib/openbmc_ffdc.robot
7Resource ../../lib/bmc_ipv6_utils.robot
8Library ../../lib/bmc_network_utils.py
9Library Collections
10
11Test Setup Test Setup Execution
12Test Teardown Test Teardown Execution
Prashanth Katti3270fd02021-06-11 08:02:22 -050013Suite Setup Suite Setup Execution
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060014
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
26Get 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 Katti2c73abc2021-03-17 07:42:25 -050035Get 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
44Get IPv6 Default Gateway And Verify
George Keishing96143832021-03-23 07:55:08 -050045 [Documentation] Get IPv6 default gateway and verify.
George Keishingade6ab42022-07-19 11:41:03 -050046 [Tags] Get_IPv6_Default_Gateway_And_Verify
Prashanth Katti2c73abc2021-03-17 07:42:25 -050047
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 Katti8abbb4d2021-01-29 02:17:45 -060053*** Keywords ***
54
Prashanth Katti3270fd02021-06-11 08:02:22 -050055Suite 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 Katti8abbb4d2021-01-29 02:17:45 -060064Test 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
77Test Teardown Execution
78 [Documentation] Test teardown execution.
79
80 FFDC On Test Case Fail
81 Redfish.Logout
82
83
84Get 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}