Total Complexity | 50 |
Total Lines | 512 |
Duplicated Lines | 8.59 % |
Changes | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like build.tests.unit.test_search_results2 often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
1 | """Module to test the KytosGraph in graph.py.""" |
||
2 | from itertools import combinations |
||
3 | |||
4 | # Core modules to import |
||
5 | from kytos.core.link import Link |
||
6 | |||
7 | # module under test |
||
8 | from tests.unit.test_search_results import TestSearchResults |
||
9 | |||
10 | |||
11 | class TestSearchResults2(TestSearchResults): |
||
12 | """Tests for the graph class.""" |
||
13 | |||
14 | def test_path1(self): |
||
15 | """Tests paths between all users using unconstrained path alogrithm.""" |
||
16 | self.setup() |
||
17 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
18 | for point_a, point_b in combos: |
||
19 | results = self.get_path(point_a, point_b) |
||
20 | self.assertNotEqual(results, []) |
||
21 | |||
22 | def test_path2(self): |
||
23 | """Tests paths between all users using constrained path algorithm, |
||
24 | with no constraints set.""" |
||
25 | self.setup() |
||
26 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
27 | for point_a, point_b in combos: |
||
28 | results = self.get_path_constrained(point_a, point_b) |
||
29 | self.assertNotEqual(results, []) |
||
30 | |||
31 | def test_path3(self): |
||
32 | """Tests paths between all users using constrained path algorithm, |
||
33 | with the ownership constraint set to B.""" |
||
34 | self.setup() |
||
35 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
36 | for point_a, point_b in combos: |
||
37 | results = self.get_path_constrained( |
||
38 | point_a, point_b, 0, ownership="B") |
||
39 | for result in results: |
||
40 | for path in result["paths"]: |
||
41 | self.assertNotIn("S4:1", path) |
||
42 | self.assertNotIn("S5:2", path) |
||
43 | self.assertNotIn("S4:2", path) |
||
44 | self.assertNotIn("User1:2", path) |
||
45 | self.assertNotIn("S5:4", path) |
||
46 | self.assertNotIn("S6:2", path) |
||
47 | self.assertNotIn("S6:5", path) |
||
48 | self.assertNotIn("S10:1", path) |
||
49 | self.assertNotIn("S8:6", path) |
||
50 | self.assertNotIn("S10:2", path) |
||
51 | self.assertNotIn("S10:3", path) |
||
52 | self.assertNotIn("User2:1", path) |
||
53 | |||
54 | def test_path4(self): |
||
55 | """Tests paths between all users using constrained path algorithm, |
||
56 | with the reliability constraint set to 3.""" |
||
57 | self.setup() |
||
58 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
59 | for point_a, point_b in combos: |
||
60 | results = self.get_path_constrained( |
||
61 | point_a, point_b, 0, reliability=3) |
||
62 | for result in results: |
||
63 | for path in result["paths"]: |
||
64 | self.assertNotIn("S4:1", path) |
||
65 | self.assertNotIn("S5:2", path) |
||
66 | self.assertNotIn("S5:3", path) |
||
67 | self.assertNotIn("S6:1", path) |
||
68 | |||
69 | def test_path5(self): |
||
70 | """Tests paths between all users using constrained path algorithm, |
||
71 | with the bandwidth contraint set to 100.""" |
||
72 | self.setup() |
||
73 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
74 | for point_a, point_b in combos: |
||
75 | results = self.get_path_constrained( |
||
76 | point_a, point_b, 0, bandwidth=100) |
||
77 | for result in results: |
||
78 | for path in result["paths"]: |
||
79 | self.assertNotIn("S3:1", path) |
||
80 | self.assertNotIn("S5:1", path) |
||
81 | self.assertNotIn("User1:4", path) |
||
82 | self.assertNotIn("User4:3", path) |
||
83 | |||
84 | def test_path6(self): |
||
85 | """Tests paths between all users using constrained path algorithm, |
||
86 | with the delay constraint set to 50.""" |
||
87 | self.setup() |
||
88 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
89 | for point_a, point_b in combos: |
||
90 | results = self.get_path_constrained(point_a, point_b, 0, delay=50) |
||
91 | for result in results: |
||
92 | for path in result["paths"]: |
||
93 | self.assertNotIn("S1:1", path) |
||
94 | self.assertNotIn("S2:1", path) |
||
95 | self.assertNotIn("S3:1", path) |
||
96 | self.assertNotIn("S5:1", path) |
||
97 | self.assertNotIn("S4:2", path) |
||
98 | self.assertNotIn("User1:2", path) |
||
99 | self.assertNotIn("S5:5", path) |
||
100 | self.assertNotIn("S8:2", path) |
||
101 | self.assertNotIn("S5:6", path) |
||
102 | self.assertNotIn("User1:3", path) |
||
103 | self.assertNotIn("S6:3", path) |
||
104 | self.assertNotIn("S9:1", path) |
||
105 | self.assertNotIn("S6:4", path) |
||
106 | self.assertNotIn("S9:2", path) |
||
107 | self.assertNotIn("S6:5", path) |
||
108 | self.assertNotIn("S10:1", path) |
||
109 | self.assertNotIn("S8:5", path) |
||
110 | self.assertNotIn("S9:4", path) |
||
111 | self.assertNotIn("User1:4", path) |
||
112 | self.assertNotIn("User4:3", path) |
||
113 | |||
114 | def test_path7(self): |
||
115 | """Tests paths between all users using constrained path algorithm, |
||
116 | with the delay constraint set to 50, the bandwidth constraint set |
||
117 | to 100, the reliability contraint set to 3, and the ownership |
||
118 | constraint set to 'B' """ |
||
119 | self.setup() |
||
120 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
121 | for point_a, point_b in combos: |
||
122 | results = self.get_path_constrained( |
||
123 | point_a, point_b, 0, delay=50, bandwidth=100, reliability=3, |
||
124 | ownership="B") |
||
125 | for result in results: |
||
126 | for path in result["paths"]: |
||
127 | # delay = 50 checks |
||
128 | self.assertNotIn("S1:1", path) |
||
129 | self.assertNotIn("S2:1", path) |
||
130 | self.assertNotIn("S3:1", path) |
||
131 | self.assertNotIn("S5:1", path) |
||
132 | self.assertNotIn("S4:2", path) |
||
133 | self.assertNotIn("User1:2", path) |
||
134 | self.assertNotIn("S5:5", path) |
||
135 | self.assertNotIn("S8:2", path) |
||
136 | self.assertNotIn("S5:6", path) |
||
137 | self.assertNotIn("User1:3", path) |
||
138 | self.assertNotIn("S6:3", path) |
||
139 | self.assertNotIn("S9:1", path) |
||
140 | self.assertNotIn("S6:4", path) |
||
141 | self.assertNotIn("S9:2", path) |
||
142 | self.assertNotIn("S6:5", path) |
||
143 | self.assertNotIn("S10:1", path) |
||
144 | self.assertNotIn("S8:5", path) |
||
145 | self.assertNotIn("S9:4", path) |
||
146 | self.assertNotIn("User1:4", path) |
||
147 | self.assertNotIn("User4:3", path) |
||
148 | |||
149 | # bandwidth = 100 checks |
||
150 | |||
151 | self.assertNotIn("S3:1", path) |
||
152 | self.assertNotIn("S5:1", path) |
||
153 | self.assertNotIn("User1:4", path) |
||
154 | self.assertNotIn("User4:3", path) |
||
155 | |||
156 | # reliability = 3 checks |
||
157 | |||
158 | self.assertNotIn("S4:1", path) |
||
159 | self.assertNotIn("S5:2", path) |
||
160 | self.assertNotIn("S5:3", path) |
||
161 | self.assertNotIn("S6:1", path) |
||
162 | |||
163 | # ownership = "B" checks |
||
164 | |||
165 | self.assertNotIn("S4:1", path) |
||
166 | self.assertNotIn("S5:2", path) |
||
167 | self.assertNotIn("S4:2", path) |
||
168 | self.assertNotIn("User1:2", path) |
||
169 | self.assertNotIn("S5:4", path) |
||
170 | self.assertNotIn("S6:2", path) |
||
171 | self.assertNotIn("S6:5", path) |
||
172 | self.assertNotIn("S10:1", path) |
||
173 | self.assertNotIn("S8:6", path) |
||
174 | self.assertNotIn("S10:2", path) |
||
175 | self.assertNotIn("S10:3", path) |
||
176 | self.assertNotIn("User2:1", path) |
||
177 | |||
178 | def test_path8(self): |
||
179 | """Tests paths between all users using constrained path algorithm, |
||
180 | with the delay constraint set to 50, the bandwidth constraint |
||
181 | set to 100, the reliability contraint set to 3, and the ownership |
||
182 | constraint set to 'B' |
||
183 | |||
184 | Tests conducted with flexibility enabled""" |
||
185 | self.setup() |
||
186 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
187 | for point_a, point_b in combos: |
||
188 | results = self.get_path_constrained( |
||
189 | point_a, point_b, 4, delay=50, bandwidth=100, reliability=3, |
||
190 | ownership="B") |
||
191 | for result in results: |
||
192 | # delay = 50 checks |
||
193 | View Code Duplication | if "delay" in result["metrics"]: |
|
|
|||
194 | for path in result["paths"]: |
||
195 | self.assertNotIn("S1:1", path) |
||
196 | self.assertNotIn("S2:1", path) |
||
197 | self.assertNotIn("S3:1", path) |
||
198 | self.assertNotIn("S5:1", path) |
||
199 | self.assertNotIn("S4:2", path) |
||
200 | self.assertNotIn("User1:2", path) |
||
201 | self.assertNotIn("S5:5", path) |
||
202 | self.assertNotIn("S8:2", path) |
||
203 | self.assertNotIn("S5:6", path) |
||
204 | self.assertNotIn("User1:3", path) |
||
205 | self.assertNotIn("S6:3", path) |
||
206 | self.assertNotIn("S9:1", path) |
||
207 | self.assertNotIn("S6:4", path) |
||
208 | self.assertNotIn("S9:2", path) |
||
209 | self.assertNotIn("S6:5", path) |
||
210 | self.assertNotIn("S10:1", path) |
||
211 | self.assertNotIn("S8:5", path) |
||
212 | self.assertNotIn("S9:4", path) |
||
213 | self.assertNotIn("User1:4", path) |
||
214 | self.assertNotIn("User4:3", path) |
||
215 | |||
216 | # bandwidth = 100 checks |
||
217 | if "bandwidth" in result["metrics"]: |
||
218 | for path in result["paths"]: |
||
219 | self.assertNotIn("S3:1", path) |
||
220 | self.assertNotIn("S5:1", path) |
||
221 | self.assertNotIn("User1:4", path) |
||
222 | self.assertNotIn("User4:3", path) |
||
223 | |||
224 | # reliability = 3 checks |
||
225 | if "reliability" in result["metrics"]: |
||
226 | for path in result["paths"]: |
||
227 | self.assertNotIn("S4:1", path) |
||
228 | self.assertNotIn("S5:2", path) |
||
229 | self.assertNotIn("S5:3", path) |
||
230 | self.assertNotIn("S6:1", path) |
||
231 | |||
232 | # ownership = "B" checks |
||
233 | if "ownership" in result["metrics"]: |
||
234 | for path in result["paths"]: |
||
235 | self.assertNotIn("S4:1", path) |
||
236 | self.assertNotIn("S5:2", path) |
||
237 | self.assertNotIn("S4:2", path) |
||
238 | self.assertNotIn("User1:2", path) |
||
239 | self.assertNotIn("S5:4", path) |
||
240 | self.assertNotIn("S6:2", path) |
||
241 | self.assertNotIn("S6:5", path) |
||
242 | self.assertNotIn("S10:1", path) |
||
243 | self.assertNotIn("S8:6", path) |
||
244 | self.assertNotIn("S10:2", path) |
||
245 | self.assertNotIn("S10:3", path) |
||
246 | self.assertNotIn("User2:1", path) |
||
247 | |||
248 | def test_path9(self): |
||
249 | """Tests paths between all users using constrained path algorithm, |
||
250 | with the delay constraint set to 50, the bandwidth constraint |
||
251 | set to 100, the reliability contraint set to 3, and the ownership |
||
252 | constraint set to 'B' |
||
253 | |||
254 | Tests conducted with all but ownership flexible""" |
||
255 | self.setup() |
||
256 | combos = combinations(["User1", "User2", "User3", "User4"], 2) |
||
257 | for point_a, point_b in combos: |
||
258 | results = self.get_path_constrained2(point_a, point_b, |
||
259 | {"ownership": "B"}, { |
||
260 | "delay": 50, |
||
261 | "bandwidth": 100, |
||
262 | "reliability": 3}) |
||
263 | for result in results: |
||
264 | # delay = 50 checks |
||
265 | View Code Duplication | if "delay" in result["metrics"]: |
|
266 | for path in result["paths"]: |
||
267 | self.assertNotIn("S1:1", path) |
||
268 | self.assertNotIn("S2:1", path) |
||
269 | self.assertNotIn("S3:1", path) |
||
270 | self.assertNotIn("S5:1", path) |
||
271 | self.assertNotIn("S4:2", path) |
||
272 | self.assertNotIn("User1:2", path) |
||
273 | self.assertNotIn("S5:5", path) |
||
274 | self.assertNotIn("S8:2", path) |
||
275 | self.assertNotIn("S5:6", path) |
||
276 | self.assertNotIn("User1:3", path) |
||
277 | self.assertNotIn("S6:3", path) |
||
278 | self.assertNotIn("S9:1", path) |
||
279 | self.assertNotIn("S6:4", path) |
||
280 | self.assertNotIn("S9:2", path) |
||
281 | self.assertNotIn("S6:5", path) |
||
282 | self.assertNotIn("S10:1", path) |
||
283 | self.assertNotIn("S8:5", path) |
||
284 | self.assertNotIn("S9:4", path) |
||
285 | self.assertNotIn("User1:4", path) |
||
286 | self.assertNotIn("User4:3", path) |
||
287 | |||
288 | # bandwidth = 100 checks |
||
289 | if "bandwidth" in result["metrics"]: |
||
290 | for path in result["paths"]: |
||
291 | self.assertNotIn("S3:1", path) |
||
292 | self.assertNotIn("S5:1", path) |
||
293 | self.assertNotIn("User1:4", path) |
||
294 | self.assertNotIn("User4:3", path) |
||
295 | |||
296 | # reliability = 3 checks |
||
297 | if "reliability" in result["metrics"]: |
||
298 | for path in result["paths"]: |
||
299 | self.assertNotIn("S4:1", path) |
||
300 | self.assertNotIn("S5:2", path) |
||
301 | self.assertNotIn("S5:3", path) |
||
302 | self.assertNotIn("S6:1", path) |
||
303 | |||
304 | # ownership = "B" checks |
||
305 | self.assertIn("ownership", result["metrics"]) |
||
306 | for path in result["paths"]: |
||
307 | self.assertNotIn("S4:1", path) |
||
308 | self.assertNotIn("S5:2", path) |
||
309 | self.assertNotIn("S4:2", path) |
||
310 | self.assertNotIn("User1:2", path) |
||
311 | self.assertNotIn("S5:4", path) |
||
312 | self.assertNotIn("S6:2", path) |
||
313 | self.assertNotIn("S6:5", path) |
||
314 | self.assertNotIn("S10:1", path) |
||
315 | self.assertNotIn("S8:6", path) |
||
316 | self.assertNotIn("S10:2", path) |
||
317 | self.assertNotIn("S10:3", path) |
||
318 | self.assertNotIn("User2:1", path) |
||
319 | |||
320 | def test_path10(self): |
||
321 | """Tests that TypeError is generated by get_path_constrained |
||
322 | |||
323 | Tests with ownership using an int type rather than string""" |
||
324 | self.setup() |
||
325 | with self.assertRaises(TypeError): |
||
326 | self.get_path_constrained2( |
||
327 | "User1", "User2", {"ownership": 1}, None) |
||
328 | |||
329 | @staticmethod |
||
330 | def generate_topology(): |
||
331 | """Generates a predetermined topology""" |
||
332 | switches = {} |
||
333 | interfaces = {} |
||
334 | links = {} |
||
335 | |||
336 | TestSearchResults.create_switch("S1", switches) |
||
337 | TestSearchResults.add_interfaces(2, switches["S1"], interfaces) |
||
338 | |||
339 | TestSearchResults.create_switch("S2", switches) |
||
340 | TestSearchResults.add_interfaces(2, switches["S2"], interfaces) |
||
341 | |||
342 | TestSearchResults.create_switch("S3", switches) |
||
343 | TestSearchResults.add_interfaces(6, switches["S3"], interfaces) |
||
344 | |||
345 | TestSearchResults.create_switch("S4", switches) |
||
346 | TestSearchResults.add_interfaces(2, switches["S4"], interfaces) |
||
347 | |||
348 | TestSearchResults.create_switch("S5", switches) |
||
349 | TestSearchResults.add_interfaces(6, switches["S5"], interfaces) |
||
350 | |||
351 | TestSearchResults.create_switch("S6", switches) |
||
352 | TestSearchResults.add_interfaces(5, switches["S6"], interfaces) |
||
353 | |||
354 | TestSearchResults.create_switch("S7", switches) |
||
355 | TestSearchResults.add_interfaces(2, switches["S7"], interfaces) |
||
356 | |||
357 | TestSearchResults.create_switch("S8", switches) |
||
358 | TestSearchResults.add_interfaces(8, switches["S8"], interfaces) |
||
359 | |||
360 | TestSearchResults.create_switch("S9", switches) |
||
361 | TestSearchResults.add_interfaces(4, switches["S9"], interfaces) |
||
362 | |||
363 | TestSearchResults.create_switch("S10", switches) |
||
364 | TestSearchResults.add_interfaces(3, switches["S10"], interfaces) |
||
365 | |||
366 | TestSearchResults.create_switch("S11", switches) |
||
367 | TestSearchResults.add_interfaces(3, switches["S11"], interfaces) |
||
368 | |||
369 | TestSearchResults.create_switch("User1", switches) |
||
370 | TestSearchResults.add_interfaces(4, switches["User1"], interfaces) |
||
371 | |||
372 | TestSearchResults.create_switch("User2", switches) |
||
373 | TestSearchResults.add_interfaces(2, switches["User2"], interfaces) |
||
374 | |||
375 | TestSearchResults.create_switch("User3", switches) |
||
376 | TestSearchResults.add_interfaces(2, switches["User3"], interfaces) |
||
377 | |||
378 | TestSearchResults.create_switch("User4", switches) |
||
379 | TestSearchResults.add_interfaces(3, switches["User4"], interfaces) |
||
380 | |||
381 | TestSearchResults2._fill_links(links, interfaces) |
||
382 | TestSearchResults2._add_metadata_to_links(links) |
||
383 | |||
384 | return (switches, links) |
||
385 | |||
386 | @staticmethod |
||
387 | def _add_metadata_to_links(links): |
||
388 | links["S1:1<->S2:1"].extend_metadata( |
||
389 | {"reliability": 5, "bandwidth": 100, "delay": 105}) |
||
390 | links["S1:2<->User1:1"].extend_metadata( |
||
391 | {"reliability": 5, "bandwidth": 100, "delay": 1}) |
||
392 | links["S2:2<->User4:1"].extend_metadata( |
||
393 | {"reliability": 5, "bandwidth": 100, "delay": 10}) |
||
394 | links["S3:1<->S5:1"].extend_metadata( |
||
395 | {"reliability": 5, "bandwidth": 10, "delay": 112}) |
||
396 | links["S3:2<->S7:1"].extend_metadata( |
||
397 | {"reliability": 5, "bandwidth": 100, "delay": 1}) |
||
398 | links["S3:3<->S8:1"].extend_metadata( |
||
399 | {"reliability": 5, "bandwidth": 100, "delay": 1}) |
||
400 | links["S3:4<->S11:1"].extend_metadata( |
||
401 | {"reliability": 3, "bandwidth": 100, "delay": 6}) |
||
402 | links["S3:5<->User3:1"].extend_metadata( |
||
403 | {"reliability": 5, "bandwidth": 100, "delay": 1}) |
||
404 | links["S3:6<->User4:2"].extend_metadata( |
||
405 | {"reliability": 5, "bandwidth": 100, "delay": 10}) |
||
406 | links["S4:1<->S5:2"].extend_metadata( |
||
407 | {"reliability": 1, "bandwidth": 100, "delay": 30, |
||
408 | "ownership": "A"}) |
||
409 | links["S4:2<->User1:2"].extend_metadata( |
||
410 | {"reliability": 3, "bandwidth": 100, "delay": 110, |
||
411 | "ownership": "A"}) |
||
412 | links["S5:3<->S6:1"].extend_metadata( |
||
413 | {"reliability": 1, "bandwidth": 100, "delay": 40}) |
||
414 | links["S5:4<->S6:2"].extend_metadata( |
||
415 | {"reliability": 3, "bandwidth": 100, "delay": 40, |
||
416 | "ownership": "A"}) |
||
417 | links["S5:5<->S8:2"].extend_metadata( |
||
418 | {"reliability": 5, "bandwidth": 100, "delay": 112}) |
||
419 | links["S5:6<->User1:3"].extend_metadata( |
||
420 | {"reliability": 3, "bandwidth": 100, "delay": 60}) |
||
421 | links["S6:3<->S9:1"].extend_metadata( |
||
422 | {"reliability": 3, "bandwidth": 100, "delay": 60}) |
||
423 | links["S6:4<->S9:2"].extend_metadata( |
||
424 | {"reliability": 5, "bandwidth": 100, "delay": 62}) |
||
425 | links["S6:5<->S10:1"].extend_metadata( |
||
426 | {"bandwidth": 100, "delay": 108, "ownership": "A"}) |
||
427 | links["S7:2<->S8:3"].extend_metadata( |
||
428 | {"reliability": 5, "bandwidth": 100, "delay": 1}) |
||
429 | links["S8:4<->S9:3"].extend_metadata( |
||
430 | {"reliability": 3, "bandwidth": 100, "delay": 32}) |
||
431 | links["S8:5<->S9:4"].extend_metadata( |
||
432 | {"reliability": 3, "bandwidth": 100, "delay": 110}) |
||
433 | links["S8:6<->S10:2"].extend_metadata( |
||
434 | {"reliability": 5, "bandwidth": 100, "ownership": "A"}) |
||
435 | links["S8:7<->S11:2"].extend_metadata( |
||
436 | {"reliability": 3, "bandwidth": 100, "delay": 7}) |
||
437 | links["S8:8<->User3:2"].extend_metadata( |
||
438 | {"reliability": 5, "bandwidth": 100, "delay": 1}) |
||
439 | links["S10:3<->User2:1"].extend_metadata( |
||
440 | {"reliability": 3, "bandwidth": 100, "delay": 10, |
||
441 | "ownership": "A"}) |
||
442 | links["S11:3<->User2:2"].extend_metadata( |
||
443 | {"reliability": 3, "bandwidth": 100, "delay": 6}) |
||
444 | links["User1:4<->User4:3"].extend_metadata( |
||
445 | {"reliability": 5, "bandwidth": 10, "delay": 105}) |
||
446 | |||
447 | @staticmethod |
||
448 | def _fill_links(links, interfaces): |
||
449 | links["S1:1<->S2:1"] = Link(interfaces["S1:1"], interfaces["S2:1"]) |
||
450 | |||
451 | links["S1:2<->User1:1"] = Link(interfaces["S1:2"], |
||
452 | interfaces["User1:1"]) |
||
453 | |||
454 | links["S2:2<->User4:1"] = Link(interfaces["S2:2"], |
||
455 | interfaces["User4:1"]) |
||
456 | |||
457 | links["S3:1<->S5:1"] = Link(interfaces["S3:1"], interfaces["S5:1"]) |
||
458 | |||
459 | links["S3:2<->S7:1"] = Link(interfaces["S3:2"], interfaces["S7:1"]) |
||
460 | |||
461 | links["S3:3<->S8:1"] = Link(interfaces["S3:3"], interfaces["S8:1"]) |
||
462 | |||
463 | links["S3:4<->S11:1"] = Link(interfaces["S3:4"], interfaces["S11:1"]) |
||
464 | |||
465 | links["S3:5<->User3:1"] = Link(interfaces["S3:5"], |
||
466 | interfaces["User3:1"]) |
||
467 | |||
468 | links["S3:6<->User4:2"] = Link(interfaces["S3:6"], |
||
469 | interfaces["User4:2"]) |
||
470 | |||
471 | links["S4:1<->S5:2"] = Link(interfaces["S4:1"], interfaces["S5:2"]) |
||
472 | |||
473 | links["S4:2<->User1:2"] = Link(interfaces["S4:2"], |
||
474 | interfaces["User1:2"]) |
||
475 | |||
476 | links["S5:3<->S6:1"] = Link(interfaces["S5:3"], interfaces["S6:1"]) |
||
477 | |||
478 | links["S5:4<->S6:2"] = Link(interfaces["S5:4"], interfaces["S6:2"]) |
||
479 | |||
480 | links["S5:5<->S8:2"] = Link(interfaces["S5:5"], interfaces["S8:2"]) |
||
481 | |||
482 | links["S5:6<->User1:3"] = Link(interfaces["S5:6"], |
||
483 | interfaces["User1:3"]) |
||
484 | |||
485 | links["S6:3<->S9:1"] = Link(interfaces["S6:3"], interfaces["S9:1"]) |
||
486 | |||
487 | links["S6:4<->S9:2"] = Link(interfaces["S6:4"], interfaces["S9:2"]) |
||
488 | |||
489 | links["S6:5<->S10:1"] = Link(interfaces["S6:5"], interfaces["S10:1"]) |
||
490 | |||
491 | links["S7:2<->S8:3"] = Link(interfaces["S7:2"], interfaces["S8:3"]) |
||
492 | |||
493 | links["S8:4<->S9:3"] = Link(interfaces["S8:4"], interfaces["S9:3"]) |
||
494 | |||
495 | links["S8:5<->S9:4"] = Link(interfaces["S8:5"], interfaces["S9:4"]) |
||
496 | |||
497 | links["S8:6<->S10:2"] = Link(interfaces["S8:6"], interfaces["S10:2"]) |
||
498 | |||
499 | links["S8:7<->S11:2"] = Link(interfaces["S8:7"], interfaces["S11:2"]) |
||
500 | |||
501 | links["S8:8<->User3:2"] = Link(interfaces["S8:8"], |
||
502 | interfaces["User3:2"]) |
||
503 | |||
504 | links["S10:3<->User2:1"] = Link(interfaces["S10:3"], |
||
505 | interfaces["User2:1"]) |
||
506 | |||
507 | links["S11:3<->User2:2"] = Link(interfaces["S11:3"], |
||
508 | interfaces["User2:2"]) |
||
509 | |||
510 | links["User1:4<->User4:3"] = Link(interfaces["User1:4"], |
||
511 | interfaces["User4:3"]) |
||
512 |