2 Documentation Test suite to verify inbound-discarding filtering functionality
3 Suite Setup Setup SXP Environment 5
4 Suite Teardown Clean SXP Environment 5
5 Test Teardown Clean Nodes
6 Library RequestsLibrary
8 Library ../../../libraries/Sxp.py
9 Library ../../../libraries/Common.py
10 Resource ../../../libraries/SxpLib.robot
16 [Documentation] Test ACL filter behaviour during filter update
19 ${peers} = Sxp.Add Peers 127.0.0.2 127.0.0.4
20 SxpLib.Add PeerGroup GROUP ${peers}
21 ${entry1} = Sxp.Get Filter Entry 10 permit acl=10.10.10.0,0.0.0.255
22 ${entry2} = Sxp.Get Filter Entry 20 permit acl=10.0.0.0,0.254.0.0
23 ${entries} = Combine Strings ${entry1} ${entry2}
24 SxpLib.Add Filter GROUP inbound-discarding ${entries}
25 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
26 SxpLib.Delete Filter GROUP inbound-discarding
27 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
29 Access List Sgt Filtering
30 [Documentation] Test ACL and SGT filter behaviour during filter update
32 ${peers} = Sxp.Add Peers 127.0.0.3 127.0.0.5
33 SxpLib.Add PeerGroup GROUP ${peers}
34 ${entry1} = Sxp.Get Filter Entry 10 permit sgt=30 acl=10.10.10.0,0.0.0.255
35 ${entry2} = Sxp.Get Filter Entry 20 permit sgt=50 acl=10.0.0.0,0.254.0.0
36 ${entries} = Combine Strings ${entry1} ${entry2}
37 SxpLib.Add Filter GROUP inbound-discarding ${entries}
39 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
40 SxpLib.Delete Filter GROUP inbound-discarding
41 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
44 [Documentation] Test Prefix List filter behaviour during filter update
47 ${peers} = Sxp.Add Peers 127.0.0.2 127.0.0.4
48 SxpLib.Add PeerGroup GROUP ${peers}
49 ${entry1} = Sxp.Get Filter Entry 10 permit pl=10.10.10.0/24
50 ${entry2} = Sxp.Get Filter Entry 20 permit epl=10.0.0.0/8,le,16
51 ${entries} = Combine Strings ${entry1} ${entry2}
52 SxpLib.Add Filter GROUP inbound-discarding ${entries}
53 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
54 SxpLib.Delete Filter GROUP inbound-discarding
55 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
57 Prefix List Sgt Filtering
58 [Documentation] Test Prefix List and SGT filter behaviour during filter update
60 ${peers} = Sxp.Add Peers 127.0.0.3 127.0.0.5
61 SxpLib.Add PeerGroup GROUP ${peers}
62 ${entry1} = Sxp.Get Filter Entry 10 permit sgt=30 pl=10.10.10.0/24
63 ${entry2} = Sxp.Get Filter Entry 20 permit pl=10.50.0.0/16
64 ${entries} = Combine Strings ${entry1} ${entry2}
65 SxpLib.Add Filter GROUP inbound-discarding ${entries}
67 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
68 SxpLib.Delete Filter GROUP inbound-discarding
69 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
71 Access List Filtering Legacy
72 [Documentation] Test ACL filter behaviour during filter update
74 Setup Nodes Legacy Par Two
75 ${peers} = Sxp.Add Peers 127.0.0.2 127.0.0.4
76 SxpLib.Add PeerGroup GROUP ${peers}
77 ${entry1} = Sxp.Get Filter Entry 10 permit acl=10.10.10.0,0.0.0.255
78 ${entry2} = Sxp.Get Filter Entry 20 permit acl=10.0.0.0,0.254.0.0
79 ${entries} = Combine Strings ${entry1} ${entry2}
80 SxpLib.Add Filter GROUP inbound-discarding ${entries}
81 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
82 SxpLib.Delete Filter GROUP inbound-discarding
83 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
85 Access List Sgt Filtering Legacy
86 [Documentation] Test ACL and SGT filter behaviour during filter update
88 ${peers} = Sxp.Add Peers 127.0.0.3 127.0.0.5
89 SxpLib.Add PeerGroup GROUP ${peers}
90 ${entry1} = Sxp.Get Filter Entry 10 permit sgt=30 acl=10.10.10.0,0.0.0.255
91 ${entry2} = Sxp.Get Filter Entry 20 permit sgt=50 acl=10.0.0.0,0.254.0.0
92 ${entries} = Combine Strings ${entry1} ${entry2}
93 SxpLib.Add Filter GROUP inbound-discarding ${entries}
94 Setup Nodes Legacy Par One
95 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
96 SxpLib.Delete Filter GROUP inbound-discarding
97 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
99 Prefix List Filtering Legacy
100 [Documentation] Test Prefix List filter behaviour during filter update
102 Setup Nodes Legacy Par Two
103 ${peers} = Sxp.Add Peers 127.0.0.2 127.0.0.4
104 SxpLib.Add PeerGroup GROUP ${peers}
105 ${entry1} = Sxp.Get Filter Entry 10 permit pl=10.10.10.0/24
106 ${entry2} = Sxp.Get Filter Entry 20 permit epl=10.0.0.0/8,le,16
107 ${entries} = Combine Strings ${entry1} ${entry2}
108 SxpLib.Add Filter GROUP inbound-discarding ${entries}
109 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
110 SxpLib.Delete Filter GROUP inbound-discarding
111 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 4-2
113 Prefix List Sgt Filtering Legacy
114 [Documentation] Test Prefix List and SGT filter behaviour during filter update
116 ${peers} = Sxp.Add Peers 127.0.0.3 127.0.0.5
117 SxpLib.Add PeerGroup GROUP ${peers}
118 ${entry1} = Sxp.Get Filter Entry 10 permit sgt=30 pl=10.10.10.0/24
119 ${entry2} = Sxp.Get Filter Entry 20 permit pl=10.50.0.0/16
120 ${entries} = Combine Strings ${entry1} ${entry2}
121 SxpLib.Add Filter GROUP inbound-discarding ${entries}
122 Setup Nodes Legacy Par One
123 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
124 SxpLib.Delete Filter GROUP inbound-discarding
125 BuiltIn.Wait Until Keyword Succeeds 4 2 Check One Group 5-3
129 [Arguments] ${version}=version4 ${password}=none
130 : FOR ${node} IN RANGE 2 5
131 \ SxpLib.Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node}
133 \ SxpLib.Add Connection ${version} both 127.0.0.${node} 64999 127.0.0.1
135 \ BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both
136 \ ... 127.0.0.${node}
137 \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node}
138 \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node}
139 \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node}
140 \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node}
141 SxpLib.Add Connection ${version} both 127.0.0.5 64999 127.0.0.3 ${password}
142 SxpLib.Add Connection ${version} both 127.0.0.3 64999 127.0.0.5 ${password}
143 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both 127.0.0.5
145 SxpLib.Add Bindings 50 10.10.10.50/32 127.0.0.5
146 SxpLib.Add Bindings 50 10.10.50.0/24 127.0.0.5
147 SxpLib.Add Bindings 50 10.50.0.0/16 127.0.0.5
148 SxpLib.Add Bindings 50 50.0.0.0/8 127.0.0.5
149 SxpLib.Add Bindings 10 10.10.10.10/32 127.0.0.1
150 SxpLib.Add Bindings 10 10.10.10.0/24 127.0.0.1
151 SxpLib.Add Bindings 10 10.10.0.0/16 127.0.0.1
152 SxpLib.Add Bindings 10 10.0.0.0/8 127.0.0.1
154 Setup Nodes Legacy Par One
155 [Arguments] ${version}=version3 ${password}=none
156 : FOR ${node} IN RANGE 1 6
157 \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node}
158 \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node}
159 \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node}
160 \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node}
161 SxpLib.Add Connection ${version} listener 127.0.0.1 64999 127.0.0.2 ${password}
162 SxpLib.Add Connection ${version} speaker 127.0.0.2 64999 127.0.0.1 ${password}
163 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.2
164 SxpLib.Add Connection ${version} listener 127.0.0.1 64999 127.0.0.4 ${password}
165 SxpLib.Add Connection ${version} speaker 127.0.0.4 64999 127.0.0.1 ${password}
166 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.4
167 SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.3 ${password}
168 SxpLib.Add Connection ${version} listener 127.0.0.3 64999 127.0.0.1 ${password}
169 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.3
170 SxpLib.Add Connection ${version} listener 127.0.0.5 64999 127.0.0.3 ${password}
171 SxpLib.Add Connection ${version} speaker 127.0.0.3 64999 127.0.0.5 ${password}
172 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.5
175 Setup Nodes Legacy Par Two
176 [Arguments] ${version}=version3 ${password}=none
177 : FOR ${node} IN RANGE 1 6
178 \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node}
179 \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node}
180 \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node}
181 \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node}
182 SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.2 ${password}
183 SxpLib.Add Connection ${version} listener 127.0.0.2 64999 127.0.0.1 ${password}
184 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.2
185 SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.4 ${password}
186 SxpLib.Add Connection ${version} listener 127.0.0.4 64999 127.0.0.1 ${password}
187 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.4
188 SxpLib.Add Connection ${version} listener 127.0.0.1 64999 127.0.0.3 ${password}
189 SxpLib.Add Connection ${version} speaker 127.0.0.3 64999 127.0.0.1 ${password}
190 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.3
191 SxpLib.Add Connection ${version} speaker 127.0.0.5 64999 127.0.0.3 ${password}
192 SxpLib.Add Connection ${version} listener 127.0.0.3 64999 127.0.0.5 ${password}
193 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.5
197 [Documentation] Check if only bindings matching filter from node 4 and 2 are propagated to SXP-DB of other nodes
198 ... Database should contains only Bindings regarding to these matches:
199 ... permit ACL 10.10.10.0 0.0.0.255
200 ... permit ACL 10.0.0.0 0.254.0.0
201 ... Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
202 ${resp} = SxpLib.Get Bindings 127.0.0.5
203 SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32
204 SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24
205 SxpLib.Should Contain Binding ${resp} 10 10.10.0.0/16
206 SxpLib.Should Contain Binding ${resp} 10 10.0.0.0/8
207 SxpLib.Should Contain Binding ${resp} 20 10.10.10.20/32
208 SxpLib.Should Not Contain Binding ${resp} 20 10.10.20.0/24
209 SxpLib.Should Contain Binding ${resp} 20 10.20.0.0/16
210 SxpLib.Should Not Contain Binding ${resp} 20 20.0.0.0/8
211 SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32
212 SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24
213 SxpLib.Should Contain Binding ${resp} 30 10.30.0.0/16
214 SxpLib.Should Contain Binding ${resp} 30 30.0.0.0/8
215 SxpLib.Should Contain Binding ${resp} 40 10.10.10.40/32
216 SxpLib.Should Not Contain Binding ${resp} 40 10.10.40.0/24
217 SxpLib.Should Contain Binding ${resp} 40 10.40.0.0/16
218 SxpLib.Should Not Contain Binding ${resp} 40 40.0.0.0/8
221 [Documentation] Check if only bindings matching filter from node 5 and 3 are propagated to SXP-DB of other nodes
222 ... Database should contains only Bindings regarding to these matches:
223 ... permit SGT 30 ACL 10.10.10.0 0.0.0.255
224 ... permit SGT 50 ACL 10.0.0.0 0.254.0.0
225 ... Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
226 ${resp} = SxpLib.Get Bindings 127.0.0.4
227 SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32
228 SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24
229 SxpLib.Should Contain Binding ${resp} 10 10.10.0.0/16
230 SxpLib.Should Contain Binding ${resp} 10 10.0.0.0/8
231 SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32
232 SxpLib.Should Not Contain Binding ${resp} 30 10.10.30.0/24
233 SxpLib.Should Not Contain Binding ${resp} 30 10.30.0.0/16
234 SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8
235 SxpLib.Should Not Contain Binding ${resp} 50 10.10.10.50/32
236 SxpLib.Should Not Contain Binding ${resp} 50 10.10.50.0/24
237 SxpLib.Should Contain Binding ${resp} 50 10.50.0.0/16
238 SxpLib.Should Not Contain Binding ${resp} 50 50.0.0.0/8
241 SxpLib.Clean Bindings 127.0.0.1
242 SxpLib.Clean Bindings 127.0.0.2
243 SxpLib.Clean Bindings 127.0.0.3
244 SxpLib.Clean Bindings 127.0.0.4
245 SxpLib.Clean Bindings 127.0.0.5
246 SxpLib.Clean Peer Groups 127.0.0.1
247 SxpLib.Clean Connections 127.0.0.1
248 SxpLib.Clean Connections 127.0.0.2
249 SxpLib.Clean Connections 127.0.0.3
250 SxpLib.Clean Connections 127.0.0.4
251 SxpLib.Clean Connections 127.0.0.5