CSIT-158: Tap interface tests
[csit.git] / tests / suites / honeycomb / 021_l2_fib.robot
1 # Copyright (c) 2016 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 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
17 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
18 | Resource | resources/libraries/robot/honeycomb/l2_fib.robot
19 | Variables | resources/test_data/honeycomb/l2_fib.py
20 | Documentation | *Honeycomb L2 FIB management test suite.*
21 | Suite Setup | Run keywords
22 | ... | Set test interface down
23 | ... | AND
24 | ... | Honeycomb removes all bridge domains | ${node}
25 | Suite Teardown | Honeycomb removes all bridge domains | ${node}
26 | Force tags | honeycomb_sanity
27
28 *** Variables ***
29 # Interface to run tests on.
30 | ${interface}= | ${node['interfaces']['port1']['name']}
31
32 *** Test Cases ***
33 | Honeycomb adds L2 FIB entry (forward)
34 | | [Documentation] | Honeycomb creates a bridge domain and assignes an \
35 | | ... | interface to it. Then adds an L2 FIB entry (forward) to the bridge \
36 | | ... | domain.
37 | | ...
38 | | [Teardown] | Honeycomb removes L2 FIB entry
39 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']}
40 | | ...
41 | | Given Interface state from Honeycomb should be
42 | | ... | ${node} | ${interface} | down
43 | | When Honeycomb sets interface state
44 | | ... | ${node} | ${interface} | up
45 | | Then Interface state from Honeycomb should be
46 | | ... | ${node} | ${interface} | up
47 | | When Honeycomb creates first l2 bridge domain
48 | | ... | ${node} | ${bd_name} | ${bd_settings}
49 | | Then Bridge domain configuration from Honeycomb should be
50 | | ... | ${node} | ${bd_name} | ${bd_settings}
51 | | Given Bridge domain configuration in interface operational data should be empty
52 | | ... | ${node} | ${interface}
53 | | When Honeycomb adds interface to bridge domain
54 | | ... | ${node} | ${interface} | ${bd_name} | ${if_bd_settings}
55 | | Then Bridge domain configuration in interface operational data should be
56 | | ... | ${node} | ${interface} | ${if_bd_settings}
57 | | Given L2 FIB Table from Honeycomb should be empty
58 | | ... | ${node} | ${bd_name}
59 | | And L2 FIB Table from VAT should be empty
60 | | ... | ${node} | ${bd_index}
61 | | When Honeycomb adds L2 FIB entry to bridge domain
62 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg}
63 | | Then L2 FIB Entry from Honeycomb should be
64 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper}
65 | | And L2 FIB entry from VAT should be
66 | | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat}
67
68 | Honeycomb adds L2 FIB entry (static, forward)
69 | | [Documentation] | Honeycomb adds an L2 FIB entry (static, forward) to the \
70 | | ... | bridge domain.
71 | | ...
72 | | [Teardown] | Honeycomb removes L2 FIB entry
73 | | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_oper['phys-address']}
74 | | ...
75 | | Given Bridge domain configuration in interface operational data should be
76 | | ... | ${node} | ${interface} | ${if_bd_settings}
77 | | And L2 FIB Table from Honeycomb should be empty
78 | | ... | ${node} | ${bd_name}
79 | | And L2 FIB Table from VAT should be empty
80 | | ... | ${node} | ${bd_index}
81 | | When Honeycomb adds L2 FIB entry to bridge domain
82 | | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_cfg}
83 | | Then L2 FIB Entry from Honeycomb should be
84 | | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_oper}
85 | | And L2 FIB entry from VAT should be
86 | | ... | ${node} | ${bd_index} | ${l2_fib_static_forward_vat}
87
88 | Honeycomb adds L2 FIB entry (static, filter)
89 | | [Documentation] | Honeycomb adds an L2 FIB entry (static, filter) to the \
90 | | ... | bridge domain.
91 | | ...
92 | | [Teardown] | Honeycomb removes L2 FIB entry
93 | | ... | ${node} | ${bd_name} | ${l2_fib_filter_oper['phys-address']}
94 | | ...
95 | | Given Bridge domain configuration in interface operational data should be
96 | | ... | ${node} | ${interface} | ${if_bd_settings}
97 | | And L2 FIB Table from Honeycomb should be empty
98 | | ... | ${node} | ${bd_name}
99 | | And L2 FIB Table from VAT should be empty
100 | | ... | ${node} | ${bd_index}
101 | | When Honeycomb adds L2 FIB entry to bridge domain
102 | | ... | ${node} | ${bd_name} | ${l2_fib_filter_cfg}
103 | | Then L2 FIB Entry from Honeycomb should be
104 | | ... | ${node} | ${bd_name} | ${l2_fib_filter_oper}
105 | | And L2 FIB entry from VAT should be
106 | | ... | ${node} | ${bd_index} | ${l2_fib_filter_vat}
107
108 | Honeycomb adds and removes L2 FIB entry (forward)
109 | | [Documentation] | Honeycomb adds an L2 FIB entry (forward) to the bridge \
110 | | ... | domain and then Honeycomb removes it from the bridge domain.
111 | | ...
112 | | [Teardown] | Honeycomb removes L2 FIB entry
113 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']}
114 | | ...
115 | | Given Bridge domain configuration in interface operational data should be
116 | | ... | ${node} | ${interface} | ${if_bd_settings}
117 | | And L2 FIB Table from Honeycomb should be empty
118 | | ... | ${node} | ${bd_name}
119 | | And L2 FIB Table from VAT should be empty
120 | | ... | ${node} | ${bd_index}
121 | | When Honeycomb adds L2 FIB entry to bridge domain
122 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg}
123 | | Then L2 FIB Entry from Honeycomb should be
124 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper}
125 | | And L2 FIB entry from VAT should be
126 | | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat}
127 | | When Honeycomb removes L2 FIB entry
128 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']}
129 | | Then L2 FIB Table from Honeycomb should be empty
130 | | ... | ${node} | ${bd_name}
131 | | And L2 FIB Table from VAT should be empty
132 | | ... | ${node} | ${bd_index}
133
134 | Honeycomb adds more than one L2 FIB entry
135 | | [Documentation] | Honeycomb adds three L2 FIB entries to the bridge domain.
136 | | ...
137 | | [Teardown] | Honeycomb removes all L2 FIB entries
138 | | ... | ${node} | ${bd_name}
139 | | ...
140 | | Given Bridge domain configuration in interface operational data should be
141 | | ... | ${node} | ${interface} | ${if_bd_settings}
142 | | And L2 FIB Table from Honeycomb should be empty
143 | | ... | ${node} | ${bd_name}
144 | | And L2 FIB Table from VAT should be empty
145 | | ... | ${node} | ${bd_index}
146 | | When Honeycomb adds L2 FIB entry to bridge domain
147 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg}
148 | | And Honeycomb adds L2 FIB entry to bridge domain
149 | | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_cfg}
150 | | And Honeycomb adds L2 FIB entry to bridge domain
151 | | ... | ${node} | ${bd_name} | ${l2_fib_filter_cfg}
152 | | Then L2 FIB Entry from Honeycomb should be
153 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper}
154 | | And L2 FIB Entry from Honeycomb should be
155 | | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_oper}
156 | | And L2 FIB Entry from Honeycomb should be
157 | | ... | ${node} | ${bd_name} | ${l2_fib_filter_oper}
158 | | And L2 FIB entry from VAT should be
159 | | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat}
160 | | And L2 FIB entry from VAT should be
161 | | ... | ${node} | ${bd_index} | ${l2_fib_static_forward_vat}
162 | | And L2 FIB entry from VAT should be
163 | | ... | ${node} | ${bd_index} | ${l2_fib_filter_vat}
164
165 | Honeycomb fails to set wrong L2 FIB entry
166 | | [Documentation] | Honeycomb tries to add an L2 FIB entry with wrong \
167 | | ... | parameters to the bridge domain. It must fail.
168 | | ...
169 | | [Teardown] | Honeycomb removes all L2 FIB entries
170 | | ... | ${node} | ${bd_name}
171 | | ...
172 | | Given Bridge domain configuration in interface operational data should be
173 | | ... | ${node} | ${interface} | ${if_bd_settings}
174 | | And L2 FIB Table from Honeycomb should be empty
175 | | ... | ${node} | ${bd_name}
176 | | And L2 FIB Table from VAT should be empty
177 | | ... | ${node} | ${bd_index}
178 | | When Honeycomb fails to add wrong L2 FIB entry
179 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg_wrong_mac}
180 | | Then L2 FIB Table from Honeycomb should be empty
181 | | ... | ${node} | ${bd_name}
182 | | And L2 FIB Table from VAT should be empty
183 | | ... | ${node} | ${bd_index}
184 | | When Honeycomb fails to add wrong L2 FIB entry
185 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg_wrong_if}
186 | | Then L2 FIB Table from Honeycomb should be empty
187 | | ... | ${node} | ${bd_name}
188 | | And L2 FIB Table from VAT should be empty
189 | | ... | ${node} | ${bd_index}
190 | | When Honeycomb fails to add wrong L2 FIB entry
191 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg_wrong_action}
192 | | Then L2 FIB Table from Honeycomb should be empty
193 | | ... | ${node} | ${bd_name}
194 | | And L2 FIB Table from VAT should be empty
195 | | ... | ${node} | ${bd_index}
196
197 | Honeycomb fails to modify existing L2 FIB entry
198 | | [Documentation] | Honeycomb tries to modify an existing L2 FIB entry. It \
199 | | ... | must fail.
200 | | ...
201 | | [Teardown] | Honeycomb removes all L2 FIB entries
202 | | ... | ${node} | ${bd_name}
203 | | ...
204 | | Given Bridge domain configuration in interface operational data should be
205 | | ... | ${node} | ${interface} | ${if_bd_settings}
206 | | And L2 FIB Table from Honeycomb should be empty
207 | | ... | ${node} | ${bd_name}
208 | | And L2 FIB Table from VAT should be empty
209 | | ... | ${node} | ${bd_index}
210 | | When Honeycomb adds L2 FIB entry to bridge domain
211 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg}
212 | | Then L2 FIB Entry from Honeycomb should be
213 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper}
214 | | When Honeycomb fails to modify L2 FIB entry
215 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']}
216 | | ... | outgoing-interface
217 | | ... | ${l2_fib_forward_modified_cfg['outgoing-interface']}
218 | | Then L2 FIB Entry from Honeycomb should be
219 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper}
220 | | And L2 FIB entry from VAT should be
221 | | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat}
222
223 *** Keywords ***
224 | Set test interface down
225 | | [Documentation] | Set the interface used in tests down.
226 | | ...
227 | | Honeycomb sets interface state
228 | | ... | ${node} | ${interface} | down