SXP filtering policy update
[integration/test.git] / csit / libraries / SXP / FilteringResources.robot
1 *** Settings ***
2 Documentation     Library containing Keywords used for SXP filtering test checks
3 Resource          ../SxpLib.robot
4
5 *** Keywords ***
6 Setup Nodes
7     [Arguments]    ${version}=version4    ${password}=none
8     : FOR    ${node}    IN RANGE    1    5
9     \    Add Binding    ${node}0    10.10.10.${node}0/32    127.0.0.${node}
10     \    Add Binding    ${node}0    10.10.${node}0.0/24    127.0.0.${node}
11     \    Add Binding    ${node}0    10.${node}0.0.0/16    127.0.0.${node}
12     \    Add Binding    ${node}0    ${node}0.0.0.0/8    127.0.0.${node}
13     Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.2    ${password}
14     Add Connection    ${version}    both    127.0.0.2    64999    127.0.0.1    ${password}
15     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.2
16     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3    ${password}
17     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1    ${password}
18     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
19     Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.4    ${password}
20     Add Connection    ${version}    both    127.0.0.4    64999    127.0.0.1    ${password}
21     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.4
22     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.5    ${password}
23     Add Connection    ${version}    speaker    127.0.0.5    64999    127.0.0.1    ${password}
24     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.5
25
26 Clean Nodes
27     Clean Bindings    127.0.0.1
28     Clean Bindings    127.0.0.2
29     Clean Bindings    127.0.0.3
30     Clean Bindings    127.0.0.4
31     Clean Bindings    127.0.0.5
32     Clean Peer Groups    127.0.0.1
33     Clean Connections    127.0.0.1
34     Clean Connections    127.0.0.2
35     Clean Connections    127.0.0.3
36     Clean Connections    127.0.0.4
37     Clean Connections    127.0.0.5
38
39 Check One Group 4-5
40     [Documentation]    Check if only bindings matching filter nodes 4 and 5
41     ...    Database should contains only Bindings regarding to these matches:
42     ...    permit ACL 10.10.10.0 0.0.0.255
43     ...    deny ACL 10.10.0.0 0.0.255.0
44     ...    permit ACL 10.0.0.0 0.255.255.0
45     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
46     : FOR    ${node}    IN RANGE    4    6
47     \    ${resp}    Get Bindings    127.0.0.${node}
48     \    Log    ${resp}
49     \    Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
50     \    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
51     \    Should Not Contain Binding    ${resp}    10    10.10.0.0/16    sxp
52     \    Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
53     \    Should Contain Binding    ${resp}    20    10.10.10.20/32    sxp
54     \    Should Not Contain Binding    ${resp}    20    10.10.20.0/24    sxp
55     \    Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
56     \    Should Not Contain Binding    ${resp}    20    20.0.0.0/8    sxp
57     \    Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
58     \    Should Not Contain Binding    ${resp}    30    10.10.30.0/24    sxp
59     \    Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
60     \    Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
61     ${resp}    Get Bindings    127.0.0.2
62     Log    ${resp}
63     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
64     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
65     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
66     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
67     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
68     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
69     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
70     Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
71     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
72     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
73     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
74     Should Contain Binding    ${resp}    40    40.0.0.0/8    sxp
75
76 Check Two Group 4-5
77     [Documentation]    Check if only bindings matching filter nodes 4 and 5
78     ...    Database should contains only Bindings regarding to these matches:
79     ...    permit ACL 10.20.0.0 0.0.255.255
80     ...    permit ACL 10.10.0.0 0.0.255.0
81     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
82     : FOR    ${node}    IN RANGE    4    6
83     \    ${resp}    Get Bindings    127.0.0.${node}
84     \    Log    ${resp}
85     \    Should Not Contain Binding    ${resp}    10    10.10.10.10/32    sxp
86     \    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
87     \    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
88     \    Should Not Contain Binding    ${resp}    10    10.0.0.0/8    sxp
89     \    Should Not Contain Binding    ${resp}    20    10.10.10.20/32    sxp
90     \    Should Contain Binding    ${resp}    20    10.10.20.0/24    sxp
91     \    Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
92     \    Should Not Contain Binding    ${resp}    20    20.0.0.0/8    sxp
93     \    Should Not Contain Binding    ${resp}    30    10.10.10.30/32    sxp
94     \    Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
95     \    Should Not Contain Binding    ${resp}    30    10.30.0.0/16    sxp
96     \    Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
97     ${resp}    Get Bindings    127.0.0.2
98     Log    ${resp}
99     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
100     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
101     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
102     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
103     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
104     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
105     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
106     Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
107     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
108     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
109     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
110     Should Contain Binding    ${resp}    40    40.0.0.0/8    sxp
111
112 Check One Group 2-5
113     [Documentation]    Check if only bindings matching filter nodes 2 and 5
114     ...    Database should contains only Bindings regarding to these matches:
115     ...    deny ACL 10.10.20.0 0.0.0.255
116     ...    permit ACL 10.10.0.0 0.0.255.0
117     ...    permit SGT 30 ACL 10.10.10.0 0.0.0.255
118     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
119     @{list}    Create List    127.0.0.2    127.0.0.5
120     : FOR    ${node}    IN    @{list}
121     \    ${resp}    Get Bindings    ${node}
122     \    Log    ${resp}
123     \    Should Not Contain Binding    ${resp}    10    10.10.10.10/32    sxp
124     \    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
125     \    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
126     \    Should Not Contain Binding    ${resp}    10    10.0.0.0/8    sxp
127     \    Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
128     \    Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
129     \    Should Not Contain Binding    ${resp}    30    10.30.0.0/16    sxp
130     \    Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
131     \    Should Not Contain Binding    ${resp}    40    10.10.10.40/32    sxp
132     \    Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
133     \    Should Not Contain Binding    ${resp}    40    10.40.0.0/16    sxp
134     \    Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
135     ${resp}    Get Bindings    127.0.0.4
136     Log    ${resp}
137     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
138     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
139     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
140     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
141     Should Contain Binding    ${resp}    20    10.10.10.20/32    sxp
142     Should Contain Binding    ${resp}    20    10.10.20.0/24    sxp
143     Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
144     Should Contain Binding    ${resp}    20    20.0.0.0/8    sxp
145     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
146     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
147     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
148     Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
149
150 Check Two Group 2-5
151     [Documentation]    Check if only bindings matching filter nodes 2 and 5
152     ...    Database should contains only Bindings regarding to these matches:
153     ...    permit SGT 20,40 ACL 10.10.0.0 0.0.255.255
154     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
155     @{list}    Create List    127.0.0.2    127.0.0.5
156     : FOR    ${node}    IN    @{list}
157     \    ${resp}    Get Bindings    ${node}
158     \    Log    ${resp}
159     \    Should Not Contain Binding    ${resp}    10    10.10.10.10/32    sxp
160     \    Should Not Contain Binding    ${resp}    10    10.10.10.0/24    sxp
161     \    Should Not Contain Binding    ${resp}    10    10.10.0.0/16    sxp
162     \    Should Not Contain Binding    ${resp}    10    10.0.0.0/8    sxp
163     \    Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
164     \    Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
165     \    Should Not Contain Binding    ${resp}    30    10.30.0.0/16    sxp
166     \    Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
167     \    Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
168     \    Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
169     \    Should Not Contain Binding    ${resp}    40    10.40.0.0/16    sxp
170     \    Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
171     ${resp}    Get Bindings    127.0.0.4
172     Log    ${resp}
173     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
174     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
175     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
176     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
177     Should Contain Binding    ${resp}    20    10.10.10.20/32    sxp
178     Should Contain Binding    ${resp}    20    10.10.20.0/24    sxp
179     Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
180     Should Contain Binding    ${resp}    20    20.0.0.0/8    sxp
181     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
182     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
183     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
184     Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
185
186 Check One Group 4-2
187     [Documentation]    Check if only bindings matching filter from node 4 and 2 are propagated to SXP-DB other nodes
188     ...    Database should contains only Bindings regarding to these matches:
189     ...    permit ACL 10.10.10.0 0.0.0.255
190     ...    permit ACL 10.0.0.0 0.254.0.0
191     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
192     ${resp}    Get Bindings    127.0.0.5
193     Log    ${resp}
194     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
195     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
196     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
197     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
198     Should Contain Binding    ${resp}    20    10.10.10.20/32    sxp
199     Should Not Contain Binding    ${resp}    20    10.10.20.0/24    sxp
200     Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
201     Should Not Contain Binding    ${resp}    20    20.0.0.0/8    sxp
202     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
203     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
204     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
205     Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
206     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
207     Should Not Contain Binding    ${resp}    40    10.10.40.0/24    sxp
208     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
209     Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
210     ${resp}    Get Bindings    127.0.0.3
211     Log    ${resp}
212     Should Contain Binding    ${resp}    50    10.10.10.50/32    sxp
213     Should Contain Binding    ${resp}    50    10.10.50.0/24    sxp
214     Should Contain Binding    ${resp}    50    10.50.0.0/16    sxp
215     Should Contain Binding    ${resp}    50    50.0.0.0/8    sxp
216
217 Check Two Group 4-2
218     [Documentation]    Check if only bindings matching filter from node 4 and 2 are propagated to SXP-DB of other nodes
219     ...    Database should contains only Bindings regarding to these matches:
220     ...    permit ACL 10.0.0.0 0.255.255.255
221     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
222     ${resp}    Get Bindings    127.0.0.5
223     Log    ${resp}
224     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
225     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
226     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
227     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
228     Should Contain Binding    ${resp}    20    10.10.10.20/32    sxp
229     Should Contain Binding    ${resp}    20    10.10.20.0/24    sxp
230     Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
231     Should Not Contain Binding    ${resp}    20    20.0.0.0/8    sxp
232     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
233     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
234     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
235     Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
236     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
237     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
238     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
239     Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
240     ${resp}    Get Bindings    127.0.0.3
241     Log    ${resp}
242     Should Contain Binding    ${resp}    50    10.10.10.50/32    sxp
243     Should Contain Binding    ${resp}    50    10.10.50.0/24    sxp
244     Should Contain Binding    ${resp}    50    10.50.0.0/16    sxp
245     Should Contain Binding    ${resp}    50    50.0.0.0/8    sxp
246
247 Check Three Group 4-2
248     [Documentation]    Check if only bindings matching filter from node 4 and 2 are propagated to SXP-DB of other nodes
249     ...    Database should contains only Bindings regarding to these matches:
250     ...    deny ACL 10.0.0.0 0.255.255.255
251     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
252     ${resp}    Get Bindings    127.0.0.5
253     Log    ${resp}
254     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
255     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
256     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
257     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
258     Should Not Contain Binding    ${resp}    20    10.10.10.20/32    sxp
259     Should Not Contain Binding    ${resp}    20    10.10.20.0/24    sxp
260     Should Not Contain Binding    ${resp}    20    10.20.0.0/16    sxp
261     Should Not Contain Binding    ${resp}    20    20.0.0.0/8    sxp
262     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
263     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
264     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
265     Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
266     Should Not Contain Binding    ${resp}    40    10.10.10.40/32    sxp
267     Should Not Contain Binding    ${resp}    40    10.10.40.0/24    sxp
268     Should Not Contain Binding    ${resp}    40    10.40.0.0/16    sxp
269     Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
270
271 Check One Group 5-3
272     [Documentation]    Check if only bindings matching filter from node 5 and 3 are propagated to SXP-DB of other nodes
273     ...    Database should contains only Bindings regarding to these matches:
274     ...    permit SGT 30 ACL 10.10.10.0 0.0.0.255
275     ...    permit SGT 50 ACL 10.0.0.0 0.254.0.0
276     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
277     ${resp}    Get Bindings    127.0.0.4
278     Log    ${resp}
279     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
280     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
281     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
282     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
283     Should Contain Binding    ${resp}    20    10.10.10.20/32    sxp
284     Should Contain Binding    ${resp}    20    10.10.20.0/24    sxp
285     Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
286     Should Contain Binding    ${resp}    20    20.0.0.0/8    sxp
287     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
288     Should Not Contain Binding    ${resp}    30    10.10.30.0/24    sxp
289     Should Not Contain Binding    ${resp}    30    10.30.0.0/16    sxp
290     Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
291     Should Not Contain Binding    ${resp}    50    10.10.10.50/32    sxp
292     Should Not Contain Binding    ${resp}    50    10.10.50.0/24    sxp
293     Should Contain Binding    ${resp}    50    10.50.0.0/16    sxp
294     Should Not Contain Binding    ${resp}    50    50.0.0.0/8    sxp
295     ${resp}    Get Bindings    127.0.0.2
296     Log    ${resp}
297     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
298     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
299     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
300     Should Contain Binding    ${resp}    40    40.0.0.0/8    sxp
301
302 Check Two Group 5-3
303     [Documentation]    Check if only bindings matching filter from node 5 and 3 are propagated to SXP-DB of other nodes
304     ...    Database should contains only Bindings regarding to these matches:
305     ...    permit ESGT 20,40 ACL 10.0.0.0 0.255.255.255
306     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
307     ${resp}    Get Bindings    127.0.0.4
308     Log    ${resp}
309     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
310     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
311     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
312     Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
313     Should Contain Binding    ${resp}    20    10.10.10.20/32    sxp
314     Should Contain Binding    ${resp}    20    10.10.20.0/24    sxp
315     Should Contain Binding    ${resp}    20    10.20.0.0/16    sxp
316     Should Contain Binding    ${resp}    20    20.0.0.0/8    sxp
317     Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
318     Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
319     Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
320     Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
321     Should Not Contain Binding    ${resp}    50    10.10.10.50/32    sxp
322     Should Not Contain Binding    ${resp}    50    10.10.50.0/24    sxp
323     Should Not Contain Binding    ${resp}    50    10.50.0.0/16    sxp
324     Should Not Contain Binding    ${resp}    50    50.0.0.0/8    sxp
325     ${resp}    Get Bindings    127.0.0.2
326     Log    ${resp}
327     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
328     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
329     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
330     Should Contain Binding    ${resp}    40    40.0.0.0/8    sxp