HC Test: Fix expected error when ACL table should be empty
[csit.git] / resources / libraries / robot / honeycomb / routing.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.Routing.RoutingKeywords
16 | Documentation | Keywords used to test Honeycomb routing.
17
18 *** Keywords ***
19 | Honeycomb configures routing table
20 | | [Documentation] | Uses Honeycomb API to configure a routing table.
21 | | ...
22 | | ... | *Arguments:*
23 | | ... | - node - information about a DUT node. Type: dictionary
24 | | ... | - name - name for the new routing table. Type: string
25 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type:string
26 | | ... | - data - Settings for the new routing table. Type: dictionary
27 | | ... | - vrf - vrf-id the new table will belong to. Type: integer
28 | | ... | - special - Does the table contain special rules. Type: boolean
29 | | ...
30 | | ... | *Example:*
31 | | ...
32 | | ... | \| Honeycomb configures routing table \| ${nodes['DUT1']} \
33 | | ... | \| table1 \| ipv4 \| ${data} \| ${1} \| ${TRUE} \|
34 | | [Arguments] | ${node} | ${name} | ${ip_version} | ${data} | ${vrf}=${1}
35 | | ... | ${special}=${EMPTY}
36 | | Configure routing table | ${node} | ${name} | ${ip_version} | ${data}
37 | | ... | ${vrf} | ${special}
38
39 | Routing data from Honeycomb should contain
40 | | [Documentation] | Uses Honeycomb API to retrieve operational data about\
41 | | ... | a routing table, and compares with the data provided.
42 | | ...
43 | | ... | *Arguments:*
44 | | ... | - node - information about a DUT node. Type: dictionary
45 | | ... | - name - name of the routing table. Type: string
46 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type:string
47 | | ... | - expected_data - Data to compare against. Type: dictionary
48 | | ...
49 | | ... | *Example:*
50 | | ...
51 | | ... | \| Routing data from Honeycomb should contain \| ${nodes['DUT1']} \
52 | | ... | \| table1 \| ipv4 \| ${data} \|
53 | | [Arguments] | ${node} | ${name} | ${ip_version} | ${expected_data}
54 | | ${data}= | Get Routing Table Oper | ${node} | ${name} | ${ip_version}
55 | | Should Contain | ${data} | ${expected_data}
56
57 | Log routing configuration from VAT
58 | | [Documentation] | Uses test API to read routing configuration from VPP\
59 | | ... | and prints received response into robot log.
60 | | ...
61 | | ... | *Arguments:*
62 | | ... | - node - information about a DUT node. Type: dictionary
63 | | ...
64 | | ... | *Example:*
65 | | ...
66 | | ... | \| Log routing configuration from VAT \| ${nodes['DUT1']} \|
67 | | [Arguments] | ${node}
68 | | Log routing configuration | ${node}
69
70 | Honeycomb removes routing configuration
71 | | [Documentation] | Uses Honeycomb API to remove Honeycomb-created\
72 | | ... | routing configuration from the node. Entries configured automatically\
73 | | ... | by VPP will not be removed.
74 | | ...
75 | | ... | *Arguments:*
76 | | ... | - node - information about a DUT node. Type: dictionary
77 | | ... | - name - name of the routing table to remove. Type: string
78 | | ...
79 | | ... | *Example:*
80 | | ...
81 | | ... | \| Honeycomb removes routing configuration \| ${nodes['DUT1']} \
82 | | ... | \| table1 \|
83 | | [Arguments] | ${node} | ${name}
84 | | Delete routing table | ${node} | ${name}
85
86 | Verify route IPv4
87 | | [Documentation] | Send an ICMP packet from one TG interface and receive\
88 | | ... | it on the other TG interface.
89 | | ...
90 | | ... | *Arguments:*
91 | | ...
92 | | ... | _NOTE:_ Arguments are based on topology:
93 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
94 | | ...
95 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
96 | | ... | - src_ip - IP of source interface (TG-if1). Type: integer
97 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer
98 | | ... | - tx_port - Source interface (TG-if1). Type: string
99 | | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string
100 | | ... | - rx_port - Destionation interface (TG-if2). Type: string
101 | | ... | - rx_mac - MAC address of DUT interface (DUT-if1). Type: string
102 | | ...
103 | | ... | *Example:*
104 | | ...
105 | | ... | \| Verify route IPv4 \| ${nodes['TG']} \
106 | | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth1 \| 08:00:27:cc:4f:54 \
107 | | ... | \| eth2 \| 08:00:27:c9:6a:d5 \|
108 | | ...
109 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port}
110 | | ... | ${tx_mac} | ${rx_port} | ${rx_mac}
111 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
112 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
113 | | ${args}= | Catenate | --src_mac | ${tx_mac}
114 | | ...                 | --dst_mac | ${rx_mac}
115 | | ...                 | --src_ip | ${src_ip}
116 | | ...                 | --dst_ip | ${dst_ip}
117 | | ...                 | --tx_if | ${tx_port_name}
118 | | ...                 | --rx_if | ${rx_port_name}
119 | | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args}
120
121 | Verify route IPv6
122 | | [Documentation] | Send an ICMPv6 packet from one TG interface and receive\
123 | | ... | it on the other TG interface.
124 | | ...
125 | | ... | *Arguments:*
126 | | ...
127 | | ... | _NOTE:_ Arguments are based on topology:
128 | | ...             | TG(if1)->(if1)DUT(if2)->TG(if2)
129 | | ...
130 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
131 | | ... | - src_ip - IP of source interface (TG-if1). Type: integer
132 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer
133 | | ... | - tx_port - Source interface (TG-if1). Type: string
134 | | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string
135 | | ... | - rx_port - Destionation interface (TG-if2). Type: string
136 | | ... | - rx_mac - MAC address of DUT interface (DUT-if1). Type: string
137 | | ...
138 | | ... | *Example:*
139 | | ...
140 | | ... | \| Verify route IPv6 \| ${nodes['TG']} \
141 | | ... | \| 10::1 \| 11::1 \| eth2 \| 08:00:27:cc:4f:54 \
142 | | ... | \| eth4 \| 08:00:27:c9:6a:d5 \|
143 | | ...
144 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port}
145 | | ... | ${tx_mac} | ${rx_port} | ${rx_mac}
146 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
147 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
148 | | ${args}= | Catenate | --src_mac | ${tx_mac}
149 | | ...                 | --dst_mac | ${rx_mac}
150 | | ...                 | --src_ip | ${src_ip}
151 | | ...                 | --dst_ip | ${dst_ip}
152 | | ...                 | --tx_if | ${tx_port_name}
153 | | ...                 | --rx_if | ${rx_port_name}
154 | | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args}
155
156 | Verify multipath route
157 | | [Documentation] | Send 100 ICMP or ICMPv6 packets from one TG interface\
158 | | ... | and receive them on the other TG interface. Verify destination MAC\
159 | | ... | addresses of the packets so that exactly 50 of them use the first\
160 | | ... | address and the other 50 use the second address.
161 | | ...
162 | | ... | *Arguments:*
163 | | ...
164 | | ... | _NOTE:_ Arguments are based on topology:
165 | | ...             | TG(if1)->(if1)DUT(if2)->TG(if2)
166 | | ...
167 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
168 | | ... | - src_ip - IP of source interface (TG-if1). Type: integer
169 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer
170 | | ... | - tx_port - Source interface (TG-if1). Type: string
171 | | ... | - tx_src_mac - MAC address of source interface (TG-if1). Type: string
172 | | ... | - rx_port - Destionation interface (TG-if2). Type: string
173 | | ... | - tx_dst_mac - MAC address of DUT ingress interface (DUT-if1).\
174 | | ... | Type: string
175 | | ... | - rx_src_mac - MAC address of DUT egress interface (DUT-if2).\
176 | | ... | Type: string
177 | | ... | - rx_dst_mac1 - MAC address of first next-hop option. Type: string
178 | | ... | - rx_dst_mac2 - MAC address of second next-hop option. Type: string
179 | | ... |
180 | | ...
181 | | ... | *Example:*
182 | | ...
183 | | ... | \| Verify multipath route \| ${nodes['TG']} \
184 | | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \
185 | | ... | \| eth4 \| 08:00:27:c9:6a:d5 \|
186 | | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \|
187 | | ...
188 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port}
189 | | ... | ${tx_src_mac} | ${rx_port} | ${tx_dst_mac} | ${rx_src_mac}
190 | | ... | ${rx_dst_mac1} | ${rx_dst_mac2}
191 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
192 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
193 | | ${args}= | Catenate | --tg_if1_mac | ${tx_src_mac}
194 | | ...                 | --dut_if1_mac | ${tx_dst_mac}
195 | | ...                 | --src_ip | ${src_ip}
196 | | ...                 | --dst_ip | ${dst_ip}
197 | | ...                 | --tx_if | ${tx_port_name}
198 | | ...                 | --rx_if | ${rx_port_name}
199 | | ...                 | --dut_if2_mac | ${rx_src_mac}
200 | | ...                 | --path_1_mac | ${rx_dst_mac_1}
201 | | ...                 | --path_2_mac | ${rx_dst_mac_2}
202 | | Run Traffic Script On Node | send_icmp_check_multipath.py | ${tg_node}
203 | | ... | ${args}