CSIT-532 HC Test: IPv6 Neighbor Discovery proxy
[csit.git] / resources / libraries / robot / honeycomb / proxyarp.robot
1 # Copyright (c) 2017 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | resources.libraries.python.honeycomb.proxyARP.IPv6NDProxyKeywords
16 | Documentation | Keywords used to test Honeycomb ARP proxy and IPv6ND proxy.
17
18 *** Keywords ***
19 | Honeycomb configures proxyARP
20 | | [Documentation] | Uses Honeycomb API to configure proxyARP for a specific\
21 | | ... | destination IP range.
22 | | ...
23 | | ... | *Arguments:*
24 | | ... | - node - information about a DUT node. Type: dictionary
25 | | ... | - data - Configuration to use. Type: dictionary
26 | | ...
27 | | ... | *Example:*
28 | | ...
29 | | ... | \| Honeycomb configures proxyARP \| ${nodes['DUT1']} \| ${data} \|
30 | | [Arguments] | ${node} | ${data}
31 | | Configure proxyARP | ${node} | ${data}
32
33 | Honeycomb removes proxyARP configuration
34 | | [Documentation] | Uses Honeycomb API to remove existing proxyARP\
35 | | ... | IP range configuration.
36 | | ...
37 | | ... | *Arguments:*
38 | | ... | - node - information about a DUT node. Type: dictionary
39 | | ...
40 | | ... | *Example:*
41 | | ...
42 | | ... | \| Honeycomb removes proxyARP configuration \| ${nodes['DUT1']} \|
43 | | [Arguments] | ${node}
44 | | Remove proxyARP configuration | ${node}
45
46 | Honeycomb enables proxyARP on interface
47 | | [Documentation] | Uses Honeycomb API to enable the proxyARP\
48 | | ... | feature on an interface.
49 | | ...
50 | | ... | *Arguments:*
51 | | ... | - node - information about a DUT node. Type: dictionary
52 | | ... | - interface - name of an interface on the node. Type: string
53 | | ...
54 | | ... | *Example:*
55 | | ...
56 | | ... | \| Honeycomb enables proxyARP on interface \| ${nodes['DUT1']} \
57 | | ... | \| GigabitEthernet0/8/0 \|
58 | | ...
59 | | [Arguments] | ${node} | ${interface}
60 | | Set proxyARP interface config | ${node} | ${interface} | enable
61
62 | Honeycomb disables proxyARP on interface
63 | | [Documentation] | Uses Honeycomb API to disable the proxyARP\
64 | | ... | feature on an interface.
65 | | ...
66 | | ... | *Arguments:*
67 | | ... | - node - information about a DUT node. Type: dictionary
68 | | ... | - interface - name of an interface on the node. Type: string
69 | | ...
70 | | ... | *Example:*
71 | | ...
72 | | ... | \| Honeycomb disables proxyARP on interface \| ${nodes['DUT1']} \
73 | | ... | \| GigabitEthernet0/8/0 \|
74 | | [Arguments] | ${node} | ${interface}
75 | | Set proxyARP interface config | ${node} | ${interface} | disable
76
77 | Honeycomb configures IPv6 ND proxy on interface
78 | | [Documentation] | Uses Honeycomb API to enable the IPv6 ND proxy\
79 | | ... | feature on an interface.
80 | | ...
81 | | ... | *Arguments:*
82 | | ... | - node - information about a DUT node. Type: dictionary
83 | | ... | - interface - name of an interface on the node. Type: string
84 | | ... | - addresses - one or more addresses to configure ND proxy with.\
85 | | ... | Type: string
86 | | ...
87 | | ... | *Example:*
88 | | ...
89 | | ... | \| Honeycomb configures IPv6 ND proxy on interface \
90 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 10::10 \| 10::11 \|
91 | | ...
92 | | [Arguments] | ${node} | ${interface} | @{addresses}
93 | | Configure IPv6ND | ${node} | ${interface} | ${addresses}
94
95 | Honeycomb disables IPv6 ND proxy on interface
96 | | [Documentation] | Uses Honeycomb API to disable the IPv6 ND proxy\
97 | | ... | feature on an interface.
98 | | ...
99 | | ... | *Arguments:*
100 | | ... | - node - information about a DUT node. Type: dictionary
101 | | ... | - interface - name of an interface on the node. Type: string
102 | | ...
103 | | ... | *Example:*
104 | | ...
105 | | ... | \| Honeycomb disables IPv6 ND proxy on interface \| ${nodes['DUT1']} \
106 | | ... | \| GigabitEthernet0/8/0 \|
107 | | [Arguments] | ${node} | ${interface}
108 | | Configure IPv6ND | ${node} | ${interface}
109
110 | IPv6 ND proxy from Honeycomb should be
111 | | [Documentation] | Retrieves IPv6 ND proxy operational data and compares\
112 | | ... | with expected values.
113 | | ...
114 | | ... | *Arguments:*
115 | | ... | - node - information about a DUT node. Type: dictionary
116 | | ... | - interface - name of an interface on the node. Type: string
117 | | ... | - addresses - one or more addresses to expect. Type: string
118 | | ...
119 | | ... | *Example:*
120 | | ...
121 | | ... | \| IPv6 ND proxy from Honeycomb should be \| ${nodes['DUT1']} \
122 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 10::11 \|
123 | | ...
124 | | [Arguments] | ${node} | ${interface} | @{addresses}
125 | | ${oper_data}= | Get interface oper data | ${node} | ${interface}
126 | | ${oper_data}= | Set Variable
127 | | ... | ${oper_data['ietf-ip:ipv6']['nd-proxy:nd-proxies']['nd-proxy']}
128 | | ${data}= | Evaluate | [{"address":x} for x in $addresses]
129 | | Sort List | ${oper_data}
130 | | Sort List | ${data}
131 | | Should be equal | ${oper_data} | ${data}
132
133 | IPv6 ND proxy from Honeycomb should be empty
134 | | [Documentation] | Retrieves IPv6 ND proxy operational data and expects\
135 | | ... | to fail due to no data present.
136 | | ...
137 | | ... | *Arguments:*
138 | | ... | - node - information about a DUT node. Type: dictionary
139 | | ... | - interface - name of an interface on the node. Type: string
140 | | ...
141 | | ... | *Example:*
142 | | ...
143 | | ... | \|IPv6 ND proxy from Honeycomb should be empty \| ${nodes['DUT1']} \
144 | | ... | \| GigabitEthernet0/8/0 \|
145 | | ...
146 | | [Arguments] | ${node} | ${interface}
147 | | ${oper_data}= | Get interface oper data | ${node} | ${interface}
148 | | Variable Should Not Exist
149 | | ... | ${oper_data['ietf-ip:ipv6']['nd-proxy:nd-proxies']['nd-proxy']}
150
151 | Verify IPv6ND Proxy
152 | | [Documentation] | Send and receive ICMPv6 messages between TG interfaces
153 | | ... | through Neighbor Discovery proxy.
154 | | ...
155 | | ... | *Arguments:*
156 | | ... | - tg_node - TG node. Type: dictionary
157 | | ... | - tg_interface1 - TG interface. Type: string
158 | | ... | - tg_interface2 - TG interface. Type: string
159 | | ... | - src_ip - Source IPv6 address to use. Type: string
160 | | ... | - dst_ip - Destination IPv6 address to use. Type: string
161 | | ... | - src_mac - MAC address of source interface. Type: string
162 | | ... | - dst_mac - MAC address of destination interface. Type: string
163 | | ... | - proxy_to_src_mac - MAC address of DUT interface on link to source\
164 | | ... | TG interface. Type: string
165 | | ... | - proxy_to_dst_mac - MAC address of DUT interface on link to dest\
166 | | ... | TG interface. Type: string
167 | | ...
168 | | ... | *Return:*
169 | | ... | - No value returned.
170 | | ...
171 | | ... | *Example:*
172 | | ...
173 | | ... | \| Verify IPv6ND Proxy \| ${nodes['TG']} \
174 | | ... | \| eth3 \| eth4 \| 3ffe:62::1 \| 3ffe:63::2 \
175 | | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:64:18:d2 \
176 | | ... | \| 08:00:27:c9:6a:d5 \| 08:00:27:c4:75:3a \|
177 | | ...
178 | | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2}
179 | | ... | ${src_ip} | ${dst_ip} | ${src_mac} | ${dst_mac}
180 | | ... | ${proxy_to_src_mac} | ${proxy_to_dst_mac}
181 | | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1}
182 | | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2}
183 | | ${args}= | Catenate | --tx_if | ${tg_interface_name1}
184 | | ...                 | --rx_if | ${tg_interface_name2}
185 | | ...                 | --src_ip | ${src_ip}
186 | | ...                 | --dst_ip | ${dst_ip}
187 | | ...                 | --src_mac | ${src_mac}
188 | | ...                 | --dst_mac | ${dst_mac}
189 | | ...                 | --proxy_to_src_mac | ${proxy_to_src_mac}
190 | | ...                 | --proxy_to_dst_mac | ${proxy_to_dst_mac}
191 | | Run Traffic Script On Node | ipv6_nd_proxy_check.py
192 | | ... | ${tg_node} | ${args}