2 Documentation Test suite to verify PeerSequence filtering functionality
3 Suite Setup Setup SXP Environment 6
4 Suite Teardown Clean SXP Environment 6
5 Test Teardown Clean Nodes
6 Library RequestsLibrary
8 Library ../../../libraries/Sxp.py
9 Library ../../../libraries/Common.py
10 Resource ../../../libraries/SxpLib.robot
11 Resource ../../../variables/Variables.py
16 Peer Sequence Filtering
17 [Documentation] Test PeerSequence filter behaviour
19 ${peers} Add Peers 127.0.0.2
20 Add PeerGroup GROUP ${peers}
21 ${entry1} Get Filter Entry 10 permit ps=le,0
22 ${entries} Combine Strings ${entry1}
23 Add Filter GROUP outbound ${entries}
25 Wait Until Keyword Succeeds 4 1 Check PeerSequence One
26 Delete Filter GROUP outbound
27 ${peers} Add Peers 127.0.0.2
28 Add PeerGroup GROUP ${peers}
29 ${entry1} Get Filter Entry 10 permit ps=le,1
30 ${entries} Combine Strings ${entry1}
31 Add Filter GROUP outbound ${entries}
32 Wait Until Keyword Succeeds 4 1 Check PeerSequence Two
33 Delete Filter GROUP outbound
34 ${peers} Add Peers 127.0.0.2
35 Add PeerGroup GROUP ${peers}
36 ${entry1} Get Filter Entry 10 permit ps=le,2
37 ${entries} Combine Strings ${entry1}
38 Add Filter GROUP outbound ${entries}
39 Wait Until Keyword Succeeds 4 1 Check PeerSequence Three
40 Delete Filter GROUP outbound
41 ${peers} Add Peers 127.0.0.2
42 Add PeerGroup GROUP ${peers}
43 ${entry1} Get Filter Entry 10 deny ps=eq,1
44 ${entry2} Get Filter Entry 20 permit ps=ge,0
45 ${entries} Combine Strings ${entry1} ${entry2}
46 Add Filter GROUP outbound ${entries}
47 Wait Until Keyword Succeeds 4 1 Check PeerSequence Mix
48 Delete Filter GROUP outbound
50 Inbound PL Combinations Filtering
51 [Documentation] Test PeerSequence filter combined with PrefixList filter
53 @{scopes} Create List inbound inbound-discarding
54 : FOR ${scope} IN @{scopes}
56 \ ${entry1} Get Filter Entry 10 permit ps=le,1
57 \ ${entries} Combine Strings ${entry1}
58 \ Add Filter GROUP ${scope} ${entries}
59 \ Setup Nodes Inbound Test
60 \ ${peers} Add Peers 127.0.0.2
61 \ Add PeerGroup GROUP2 ${peers}
62 \ ${entry1} Get Filter Entry 10 permit pl=1.1.0.0/16
63 \ ${entries} Combine Strings ${entry1}
64 \ Add Filter GROUP2 ${scope} ${entries}
65 \ Wait Until Keyword Succeeds 4 1 Check Inbound PL Combinations Filtering
68 Inbound ACL Combinations Filtering
69 [Documentation] Test PeerSequence filter combined with ACL filter
71 @{scopes} Create List inbound inbound-discarding
72 : FOR ${scope} IN @{scopes}
73 \ ${peers} Add Peers 127.0.0.2
74 \ Add PeerGroup GROUP2 ${peers}
75 \ ${entry1} Get Filter Entry 10 permit ps=le,2
76 \ ${entries} Combine Strings ${entry1}
77 \ Add Filter GROUP2 ${scope} ${entries}
78 \ Setup Nodes Inbound Test
79 \ ${entry1} Get Filter Entry 10 permit acl=1.1.1.0,0.0.0.255
80 \ ${entries} Combine Strings ${entry1}
81 \ Add Filter GROUP2 ${scope} ${entries}
82 \ ${peers} Add Peers 127.0.0.5
83 \ Add PeerGroup GROUP5 ${peers}
84 \ ${entry1} Get Filter Entry 10 permit sgt=40
85 \ ${entries} Combine Strings ${entry1}
86 \ Add Filter GROUP5 ${scope} ${entries}
87 \ Wait Until Keyword Succeeds 4 1 Check Inbound ACL Combinations Filtering
90 Outbound PL Combinations Filtering
91 [Documentation] Test PeerSequence filter combined with PrefixList filter
94 ${entry1} Get Filter Entry 10 permit pl=1.1.1.0/24
95 ${entries} Combine Strings ${entry1}
96 Add Filter GROUP outbound ${entries}
97 Setup Nodes Outbound Test
98 ${peers} Add Peers 127.0.0.2
99 Add PeerGroup GROUP2 ${peers}
100 ${entry1} Get Filter Entry 10 permit ps=le,1
101 ${entries} Combine Strings ${entry1}
102 Add Filter GROUP2 outbound ${entries}
103 Wait Until Keyword Succeeds 4 1 Check Outbound PL Combinations Filtering
105 Outbound ACL Combinations Filtering
106 [Documentation] Test PeerSequence filter combined with ACL filter
109 ${entry1} Get Filter Entry 10 permit ps=eq,0
110 ${entry2} Get Filter Entry 20 permit ps=ge,2
111 ${entries} Combine Strings ${entry1} ${entry2}
112 Add Filter GROUP outbound ${entries}
113 Setup Nodes Outbound Test
114 ${peers} Add Peers 127.0.0.2
115 Add PeerGroup GROUP2 ${peers}
116 ${entry1} Get Filter Entry 10 permit acl=1.1.0.0,0.0.255.255
117 ${entries} Combine Strings ${entry1}
118 Add Filter GROUP2 outbound ${entries}
119 Wait Until Keyword Succeeds 4 1 Check Outbound ACL Combinations Filtering
123 [Arguments] ${version}=version4 ${password}=none
124 [Documentation] Setup Topology for PeerSequence tests
125 Add Binding 10 10.10.10.10/32 127.0.0.1
126 Add Binding 10 10.10.10.0/24 127.0.0.1
127 Add Binding 10 10.10.0.0/16 127.0.0.1
128 Add Binding 10 10.0.0.0/8 127.0.0.1
129 : FOR ${node} IN RANGE 2 6
130 \ Add Binding ${node}0 10.10.10.${node}0/32 127.0.0.${node}
131 \ Add Binding ${node}0 10.10.${node}0.0/24 127.0.0.${node}
132 \ Add Binding ${node}0 10.${node}0.0.0/16 127.0.0.${node}
133 \ Add Binding ${node}0 ${node}0.0.0.0/8 127.0.0.${node}
134 Add Connection ${version} listener 127.0.0.1 64999 127.0.0.2 ${password}
135 Add Connection ${version} speaker 127.0.0.2 64999 127.0.0.1 ${password}
136 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.2
137 Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.3 ${password}
138 Add Connection ${version} listener 127.0.0.3 64999 127.0.0.1 ${password}
139 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.3
140 Add Connection ${version} speaker 127.0.0.3 64999 127.0.0.4 ${password}
141 Add Connection ${version} listener 127.0.0.4 64999 127.0.0.3 ${password}
142 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.4
144 Add Connection ${version} speaker 127.0.0.4 64999 127.0.0.5 ${password}
145 Add Connection ${version} listener 127.0.0.5 64999 127.0.0.4 ${password}
146 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.5
149 Setup Nodes Inbound Test
150 [Arguments] ${version}=version4 ${password}=none
151 [Documentation] Setup Topology for inbound PeerSequence and other filters tests
152 : FOR ${node} IN RANGE 2 6
153 \ Add Binding ${node}0 1.1.1.${node}/32 127.0.0.${node}
154 \ Add Binding ${node}0 1.1.${node}.0/24 127.0.0.${node}
155 \ Add Binding ${node}0 1.${node}.0.0/16 127.0.0.${node}
156 \ Add Binding ${node}0 ${node}.0.0.0/8 127.0.0.${node}
157 Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.2 ${password}
158 Add Connection ${version} listener 127.0.0.2 64999 127.0.0.1 ${password}
159 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.2
160 Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.5 ${password}
161 Add Connection ${version} listener 127.0.0.5 64999 127.0.0.1 ${password}
162 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.5
163 Add Connection ${version} both 127.0.0.3 64999 127.0.0.2 ${password}
164 Add Connection ${version} both 127.0.0.2 64999 127.0.0.3 ${password}
165 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both 127.0.0.2
167 Add Connection ${version} both 127.0.0.3 64999 127.0.0.4 ${password}
168 Add Connection ${version} both 127.0.0.4 64999 127.0.0.3 ${password}
169 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both 127.0.0.4
171 Add Connection ${version} both 127.0.0.4 64999 127.0.0.5 ${password}
172 Add Connection ${version} both 127.0.0.5 64999 127.0.0.4 ${password}
173 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both 127.0.0.5
176 Setup Nodes Outbound Test
177 [Arguments] ${version}=version4 ${password}=none
178 [Documentation] Setup Topology for outbound PeerSequence and other filters tests
179 Add Binding 10 1.1.1.1/32 127.0.0.1
180 Add Binding 10 1.1.1.0/24 127.0.0.1
181 Add Binding 10 1.1.0.0/16 127.0.0.1
182 Add Binding 10 1.0.0.0/8 127.0.0.1
183 : FOR ${node} IN RANGE 3 6
184 \ Add Binding ${node}0 1.1.1.${node}/32 127.0.0.${node}
185 \ Add Binding ${node}0 1.1.${node}.0/24 127.0.0.${node}
186 \ Add Binding ${node}0 1.${node}.0.0/16 127.0.0.${node}
187 \ Add Binding ${node}0 ${node}.0.0.0/8 127.0.0.${node}
188 Add Connection ${version} listener 127.0.0.1 64999 127.0.0.2 ${password}
189 Add Connection ${version} speaker 127.0.0.2 64999 127.0.0.1 ${password}
190 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.2
191 Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.3 ${password}
192 Add Connection ${version} listener 127.0.0.3 64999 127.0.0.1 ${password}
193 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.3
194 Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.4 ${password}
195 Add Connection ${version} listener 127.0.0.4 64999 127.0.0.1 ${password}
196 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.4
197 Add Connection ${version} both 127.0.0.4 64999 127.0.0.5 ${password}
198 Add Connection ${version} both 127.0.0.5 64999 127.0.0.4 ${password}
199 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both 127.0.0.5
202 Check PeerSequence One
203 [Documentation] Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 1
204 ${resp} Get Bindings 127.0.0.2
205 Should Contain Binding ${resp} 10 10.10.10.10/32 sxp
206 Should Contain Binding ${resp} 10 10.10.10.0/24 sxp
207 Should Contain Binding ${resp} 10 10.10.0.0/16 sxp
208 Should Contain Binding ${resp} 10 10.0.0.0/8 sxp
209 : FOR ${node} IN RANGE 3 6
210 \ Should Not Contain Binding ${resp} ${node}0 10.10.10.${node}0/32
211 \ Should Not Contain Binding ${resp} ${node}0 10.10.${node}0.0/24
212 \ Should Not Contain Binding ${resp} ${node}0 10.${node}0.0.0/16
213 \ Should Not Contain Binding ${resp} ${node}0 ${node}0.0.0.0/8
215 Check PeerSequence Two
216 [Documentation] Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 2
217 ${resp} Get Bindings 127.0.0.2
218 Should Contain Binding ${resp} 10 10.10.10.10/32 sxp
219 Should Contain Binding ${resp} 10 10.10.10.0/24 sxp
220 Should Contain Binding ${resp} 10 10.10.0.0/16 sxp
221 Should Contain Binding ${resp} 10 10.0.0.0/8 sxp
222 Should Contain Binding ${resp} 30 10.10.10.30/32 sxp
223 Should Contain Binding ${resp} 30 10.10.30.0/24 sxp
224 Should Contain Binding ${resp} 30 10.30.0.0/16 sxp
225 Should Contain Binding ${resp} 30 30.0.0.0/8 sxp
226 : FOR ${node} IN RANGE 4 6
227 \ Should Not Contain Binding ${resp} ${node}0 10.10.10.${node}0/32
228 \ Should Not Contain Binding ${resp} ${node}0 10.10.${node}0.0/24
229 \ Should Not Contain Binding ${resp} ${node}0 10.${node}0.0.0/16
230 \ Should Not Contain Binding ${resp} ${node}0 ${node}0.0.0.0/8
232 Check PeerSequence Three
233 [Documentation] Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 3
234 ${resp} Get Bindings 127.0.0.2
235 Should Contain Binding ${resp} 10 10.10.10.10/32 sxp
236 Should Contain Binding ${resp} 10 10.10.10.0/24 sxp
237 Should Contain Binding ${resp} 10 10.10.0.0/16 sxp
238 Should Contain Binding ${resp} 10 10.0.0.0/8 sxp
239 Should Contain Binding ${resp} 30 10.10.10.30/32 sxp
240 Should Contain Binding ${resp} 30 10.10.30.0/24 sxp
241 Should Contain Binding ${resp} 30 10.30.0.0/16 sxp
242 Should Contain Binding ${resp} 30 30.0.0.0/8 sxp
243 Should Contain Binding ${resp} 40 10.10.10.40/32 sxp
244 Should Contain Binding ${resp} 40 10.10.40.0/24 sxp
245 Should Contain Binding ${resp} 40 10.40.0.0/16 sxp
246 Should Contain Binding ${resp} 40 40.0.0.0/8 sxp
247 Should Not Contain Binding ${resp} 50 10.10.10.50/32
248 Should Not Contain Binding ${resp} 50 10.10.50.0/24
249 Should Not Contain Binding ${resp} 50 10.50.0.0/16
250 Should Not Contain Binding ${resp} 50 50.0.0.0/8
252 Check PeerSequence Mix
253 [Documentation] Node 127.0.0.2 should not contain bindings with peer sequence 1
254 ${resp} Get Bindings 127.0.0.2
255 Should Contain Binding ${resp} 10 10.10.10.10/32 sxp
256 Should Contain Binding ${resp} 10 10.10.10.0/24 sxp
257 Should Contain Binding ${resp} 10 10.10.0.0/16 sxp
258 Should Contain Binding ${resp} 10 10.0.0.0/8 sxp
259 Should Not Contain Binding ${resp} 30 10.10.10.30/32 sxp
260 Should Not Contain Binding ${resp} 30 10.10.30.0/24 sxp
261 Should Not Contain Binding ${resp} 30 10.30.0.0/16 sxp
262 Should Not Contain Binding ${resp} 30 30.0.0.0/8 sxp
263 Should Contain Binding ${resp} 40 10.10.10.40/32 sxp
264 Should Contain Binding ${resp} 40 10.10.40.0/24 sxp
265 Should Contain Binding ${resp} 40 10.40.0.0/16 sxp
266 Should Contain Binding ${resp} 40 40.0.0.0/8 sxp
267 Should Contain Binding ${resp} 50 10.10.10.50/32
268 Should Contain Binding ${resp} 50 10.10.50.0/24
269 Should Contain Binding ${resp} 50 10.50.0.0/16
270 Should Contain Binding ${resp} 50 50.0.0.0/8
272 Check Inbound PL Combinations Filtering
273 [Documentation] Node 127.0.0.1 should containt bindings with peer sequence lower than 1 and pl 1.1.0.0/16
274 ${resp} Get Bindings 127.0.0.1
275 Should Contain Binding ${resp} 20 1.1.1.2/32 sxp
276 Should Contain Binding ${resp} 20 1.1.2.0/24 sxp
277 Should Not Contain Binding ${resp} 20 1.2.0.0/16 sxp
278 Should Not Contain Binding ${resp} 20 2.0.0.0/8 sxp
279 Should Not Contain Binding ${resp} 30 1.1.1.3/32 sxp
280 Should Not Contain Binding ${resp} 30 1.1.3.0/24 sxp
281 Should Not Contain Binding ${resp} 30 1.3.0.0/16 sxp
282 Should Not Contain Binding ${resp} 30 3.0.0.0/8 sxp
283 Should Not Contain Binding ${resp} 40 1.1.1.4/32 sxp
284 Should Not Contain Binding ${resp} 40 1.1.4.0/24 sxp
285 Should Not Contain Binding ${resp} 40 1.4.0.0/16 sxp
286 Should Not Contain Binding ${resp} 40 4.0.0.0/8 sxp
287 Should Contain Binding ${resp} 50 1.1.1.5/32 sxp
288 Should Contain Binding ${resp} 50 1.1.5.0/24 sxp
289 Should Contain Binding ${resp} 50 1.5.0.0/16 sxp
290 Should Contain Binding ${resp} 50 5.0.0.0/8 sxp
292 Check Inbound ACL Combinations Filtering
293 [Documentation] Node 127.0.0.1 should containt bindings with peer sequence lower than 2 and acl 1.1.1.0 0.0.0.255
294 ${resp} Get Bindings 127.0.0.1
295 Should Contain Binding ${resp} 20 1.1.1.2/32 sxp
296 Should Not Contain Binding ${resp} 20 1.1.2.0/24 sxp
297 Should Not Contain Binding ${resp} 20 1.2.0.0/16 sxp
298 Should Not Contain Binding ${resp} 20 2.0.0.0/8 sxp
299 Should Contain Binding ${resp} 30 1.1.1.3/32 sxp
300 Should Not Contain Binding ${resp} 30 1.1.3.0/24 sxp
301 Should Not Contain Binding ${resp} 30 1.3.0.0/16 sxp
302 Should Not Contain Binding ${resp} 30 3.0.0.0/8 sxp
303 Should Contain Binding ${resp} 40 1.1.1.4/32 sxp
304 Should Contain Binding ${resp} 40 1.1.4.0/24 sxp
305 Should Contain Binding ${resp} 40 1.4.0.0/16 sxp
306 Should Contain Binding ${resp} 40 4.0.0.0/8 sxp
307 Should Not Contain Binding ${resp} 50 1.1.1.5/32 sxp
308 Should Not Contain Binding ${resp} 50 1.1.5.0/24 sxp
309 Should Not Contain Binding ${resp} 50 1.5.0.0/16 sxp
310 Should Not Contain Binding ${resp} 50 5.0.0.0/8 sxp
312 Check Outbound PL Combinations Filtering
313 [Documentation] Node 127.0.0.2 should containt bindings with peer sequence lower than 1 and pl 1.1.1.0/24
314 ${resp} Get Bindings 127.0.0.2
315 Should Contain Binding ${resp} 10 1.1.1.1/32 sxp
316 Should Contain Binding ${resp} 10 1.1.1.0/24 sxp
317 Should Not Contain Binding ${resp} 10 1.1.0.0/16 sxp
318 Should Not Contain Binding ${resp} 10 1.0.0.0/8 sxp
319 Should Contain Binding ${resp} 30 1.1.1.3/32 sxp
320 Should Not Contain Binding ${resp} 30 1.1.3.0/24 sxp
321 Should Not Contain Binding ${resp} 30 1.3.0.0/16 sxp
322 Should Not Contain Binding ${resp} 30 3.0.0.0/8 sxp
323 Should Contain Binding ${resp} 40 1.1.1.4/32 sxp
324 Should Not Contain Binding ${resp} 40 1.1.4.0/24 sxp
325 Should Not Contain Binding ${resp} 40 1.4.0.0/16 sxp
326 Should Not Contain Binding ${resp} 40 4.0.0.0/8 sxp
327 Should Not Contain Binding ${resp} 50 1.1.1.5/32 sxp
328 Should Not Contain Binding ${resp} 50 1.1.5.0/24 sxp
329 Should Not Contain Binding ${resp} 50 1.5.0.0/16 sxp
330 Should Not Contain Binding ${resp} 50 5.0.0.0/8 sxp
332 Check Outbound ACL Combinations Filtering
333 [Documentation] Node 127.0.0.2 should containt bindings with peer sequence equals to 0 or greter than 2 and acl 1.1.0.0 0.0.255.255
334 ${resp} Get Bindings 127.0.0.2
335 Should Contain Binding ${resp} 10 1.1.1.1/32 sxp
336 Should Contain Binding ${resp} 10 1.1.1.0/24 sxp
337 Should Contain Binding ${resp} 10 1.1.0.0/16 sxp
338 Should Not Contain Binding ${resp} 10 1.0.0.0/8 sxp
339 Should Not Contain Binding ${resp} 30 1.1.1.3/32 sxp
340 Should Not Contain Binding ${resp} 30 1.1.3.0/24 sxp
341 Should Not Contain Binding ${resp} 30 1.3.0.0/16 sxp
342 Should Not Contain Binding ${resp} 30 3.0.0.0/8 sxp
343 Should Not Contain Binding ${resp} 40 1.1.1.4/32 sxp
344 Should Not Contain Binding ${resp} 40 1.1.4.0/24 sxp
345 Should Not Contain Binding ${resp} 40 1.4.0.0/16 sxp
346 Should Not Contain Binding ${resp} 40 4.0.0.0/8 sxp
347 Should Contain Binding ${resp} 50 1.1.1.5/32 sxp
348 Should Contain Binding ${resp} 50 1.1.5.0/24 sxp
349 Should Not Contain Binding ${resp} 50 1.5.0.0/16 sxp
350 Should Not Contain Binding ${resp} 50 5.0.0.0/8 sxp
353 Clean Bindings 127.0.0.1
354 Clean Bindings 127.0.0.2
355 Clean Bindings 127.0.0.3
356 Clean Bindings 127.0.0.4
357 Clean Bindings 127.0.0.5
358 Clean Peer Groups 127.0.0.1
359 Clean Connections 127.0.0.1
360 Clean Connections 127.0.0.2
361 Clean Connections 127.0.0.3
362 Clean Connections 127.0.0.4
363 Clean Connections 127.0.0.5