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