1
|
|
|
"""Module to test the KytosGraph in graph.py.""" |
2
|
|
|
from itertools import combinations |
3
|
|
|
|
4
|
|
|
# module under test |
5
|
|
|
from tests.integration.edges_settings import EdgesSettings |
6
|
|
|
|
7
|
|
|
|
8
|
|
|
class TestResultsEdges(EdgesSettings): |
9
|
|
|
"""Tests for the graph class. |
10
|
|
|
|
11
|
|
|
Tests to see if reflexive searches and impossible searches |
12
|
|
|
show correct results. |
13
|
|
|
""" |
14
|
|
|
|
15
|
|
|
def test_path1(self): |
16
|
|
|
"""Tests paths between all users using unconstrained path algorithm.""" |
17
|
|
|
combos = combinations(["User1", "User2", "User3", "User4"], 2) |
18
|
|
|
self.initializer() |
19
|
|
|
|
20
|
|
|
valid = True |
21
|
|
|
for point_a, point_b in combos: |
22
|
|
|
results = self.get_path(point_a, point_b) |
23
|
|
|
if not results: |
24
|
|
|
valid = False |
25
|
|
|
break |
26
|
|
|
|
27
|
|
|
self.assertNotEqual(valid, False) |
28
|
|
|
|
29
|
|
|
def test_path12(self): |
30
|
|
|
"""Tests paths between all users using unconstrained path algorithm.""" |
31
|
|
|
combos = combinations(["User1", "User2", "User3", "User4", "User5"], 2) |
32
|
|
|
self.initializer() |
33
|
|
|
|
34
|
|
|
valid = True |
35
|
|
|
for point_a, point_b in combos: |
36
|
|
|
results = self.get_path(point_a, point_b) |
37
|
|
|
if not results: |
38
|
|
|
valid = False |
39
|
|
|
break |
40
|
|
|
|
41
|
|
|
self.assertEqual(valid, False) |
42
|
|
|
|
43
|
|
|
def test_path2(self): |
44
|
|
|
"""Tests paths between all users using constrained path algorithm, |
45
|
|
|
with no constraints set. |
46
|
|
|
""" |
47
|
|
|
combos = combinations(["User1", "User2", "User3", "User4"], 2) |
48
|
|
|
self.initializer() |
49
|
|
|
|
50
|
|
|
for point_a, point_b in combos: |
51
|
|
|
results = self.get_path_constrained(point_a, point_b) |
52
|
|
|
self.assertNotEqual(results, []) |
53
|
|
|
|
54
|
|
|
def paths_between_all_users(self, item, base=None, flexible=None, metrics=None): |
55
|
|
|
"""Method to verify the existence of a path between |
56
|
|
|
a set of points given different constrains""" |
57
|
|
|
combos = combinations(["User1", "User2", "User3", "User4"], 2) |
58
|
|
|
self.initializer() |
59
|
|
|
|
60
|
|
|
valid = True |
61
|
|
|
for point_a, point_b in combos: |
62
|
|
|
results = [] |
63
|
|
|
if base is not None and flexible is None: |
64
|
|
|
results = self.get_path_constrained( |
65
|
|
|
point_a, point_b, base=base) |
66
|
|
|
|
67
|
|
|
elif base is None and flexible is not None: |
68
|
|
|
results = self.get_path_constrained( |
69
|
|
|
point_a, point_b, flexible=flexible) |
70
|
|
|
|
71
|
|
|
for result in results: |
72
|
|
|
if metrics is not None: |
73
|
|
|
if metrics in result["metrics"]: |
74
|
|
|
for path in result["paths"]: |
75
|
|
|
if item in path: |
76
|
|
|
valid = False |
77
|
|
|
else: |
78
|
|
|
for path in result["paths"]: |
79
|
|
|
if item in path: |
80
|
|
|
valid = False |
81
|
|
|
return valid |
82
|
|
|
|
83
|
|
|
def test_path3_1(self): |
84
|
|
|
"""Tests paths between all users using constrained path algorithm, |
85
|
|
|
with the ownership constraint set to B. |
86
|
|
|
""" |
87
|
|
|
self.assertTrue(self.paths_between_all_users("S4:1", {'ownership': "B"})) |
88
|
|
|
|
89
|
|
|
def test_path3_2(self): |
90
|
|
|
"""Tests paths between all users using constrained path algorithm, |
91
|
|
|
with the ownership constraint set to B. |
92
|
|
|
""" |
93
|
|
|
self.assertTrue(self.paths_between_all_users("S5:2", {'ownership': "B"})) |
94
|
|
|
|
95
|
|
|
def test_path3_3(self): |
96
|
|
|
"""Tests paths between all users using constrained path algorithm, |
97
|
|
|
with the ownership constraint set to B. |
98
|
|
|
""" |
99
|
|
|
self.assertTrue(self.paths_between_all_users("S4:2", {'ownership': "B"})) |
100
|
|
|
|
101
|
|
|
def test_path3_4(self): |
102
|
|
|
"""Tests paths between all users using constrained path algorithm, |
103
|
|
|
with the ownership constraint set to B. |
104
|
|
|
""" |
105
|
|
|
self.assertTrue(self.paths_between_all_users("User1:2", {'ownership': "B"})) |
106
|
|
|
|
107
|
|
|
def test_path3_5(self): |
108
|
|
|
"""Tests paths between all users using constrained path algorithm, |
109
|
|
|
with the ownership constraint set to B. |
110
|
|
|
""" |
111
|
|
|
self.assertTrue(self.paths_between_all_users("S5:4", {'ownership': "B"})) |
112
|
|
|
|
113
|
|
|
def test_path3_6(self): |
114
|
|
|
"""Tests paths between all users using constrained path algorithm, |
115
|
|
|
with the ownership constraint set to B. |
116
|
|
|
""" |
117
|
|
|
self.assertTrue(self.paths_between_all_users("S6:2", {'ownership': "B"})) |
118
|
|
|
|
119
|
|
|
def test_path3_7(self): |
120
|
|
|
"""Tests paths between all users using constrained path algorithm, |
121
|
|
|
with the ownership constraint set to B. |
122
|
|
|
""" |
123
|
|
|
self.assertTrue(self.paths_between_all_users("S6:5", {'ownership': "B"})) |
124
|
|
|
|
125
|
|
|
def test_path3_8(self): |
126
|
|
|
"""Tests paths between all users using constrained path algorithm, |
127
|
|
|
with the ownership constraint set to B. |
128
|
|
|
""" |
129
|
|
|
self.assertTrue(self.paths_between_all_users("S10:1", {'ownership': "B"})) |
130
|
|
|
|
131
|
|
|
def test_path3_9(self): |
132
|
|
|
"""Tests paths between all users using constrained path algorithm, |
133
|
|
|
with the ownership constraint set to B. |
134
|
|
|
""" |
135
|
|
|
self.assertTrue(self.paths_between_all_users("S8:6", {'ownership': "B"})) |
136
|
|
|
|
137
|
|
|
def test_path3_1_0(self): |
138
|
|
|
"""Tests paths between all users using constrained path algorithm, |
139
|
|
|
with the ownership constraint set to B. |
140
|
|
|
""" |
141
|
|
|
self.assertTrue(self.paths_between_all_users("S10:2", {'ownership': "B"})) |
142
|
|
|
|
143
|
|
|
def test_path3_1_1(self): |
144
|
|
|
"""Tests paths between all users using constrained path algorithm, |
145
|
|
|
with the ownership constraint set to B. |
146
|
|
|
""" |
147
|
|
|
self.assertTrue(self.paths_between_all_users("S10:3", {'ownership': "B"})) |
148
|
|
|
|
149
|
|
|
def test_path3_1_2(self): |
150
|
|
|
"""Tests paths between all users using constrained path algorithm, |
151
|
|
|
with the ownership constraint set to B. |
152
|
|
|
""" |
153
|
|
|
self.assertTrue(self.paths_between_all_users("User2:1", {'ownership': "B"})) |
154
|
|
|
|
155
|
|
|
##### |
156
|
|
|
|
157
|
|
|
def test_path4_1(self): |
158
|
|
|
"""Tests paths between all users using constrained path algorithm, |
159
|
|
|
with the reliability constraint set to 3. |
160
|
|
|
""" |
161
|
|
|
self.assertTrue(self.paths_between_all_users("S4:1", {'reliability': 3})) |
162
|
|
|
|
163
|
|
|
def test_path4_2(self): |
164
|
|
|
"""Tests paths between all users using constrained path algorithm, |
165
|
|
|
with the reliability constraint set to 3. |
166
|
|
|
""" |
167
|
|
|
self.assertTrue(self.paths_between_all_users("S5:2", {'reliability': 3})) |
168
|
|
|
|
169
|
|
|
def test_path4_3(self): |
170
|
|
|
"""Tests paths between all users using constrained path algorithm, |
171
|
|
|
with the reliability constraint set to 3. |
172
|
|
|
""" |
173
|
|
|
self.assertTrue(self.paths_between_all_users("S5:3", {'reliability': 3})) |
174
|
|
|
|
175
|
|
|
def test_path4_4(self): |
176
|
|
|
"""Tests paths between all users using constrained path algorithm, |
177
|
|
|
with the reliability constraint set to 3. |
178
|
|
|
""" |
179
|
|
|
self.assertTrue(self.paths_between_all_users("S6:1", {'reliability': 3})) |
180
|
|
|
|
181
|
|
|
def test_path5_1(self): |
182
|
|
|
"""Tests paths between all users using constrained path algorithm, |
183
|
|
|
with the reliability constraint set to 3. |
184
|
|
|
""" |
185
|
|
|
self.assertTrue(self.paths_between_all_users("S3:1", {'bandwidth': 100})) |
186
|
|
|
|
187
|
|
|
def test_path5_2(self): |
188
|
|
|
"""Tests paths between all users using constrained path algorithm, |
189
|
|
|
with the reliability constraint set to 3. |
190
|
|
|
""" |
191
|
|
|
self.assertTrue(self.paths_between_all_users("S5:1", {'bandwidth': 100})) |
192
|
|
|
|
193
|
|
|
def test_path5_3(self): |
194
|
|
|
"""Tests paths between all users using constrained path algorithm, |
195
|
|
|
with the reliability constraint set to 3. |
196
|
|
|
""" |
197
|
|
|
self.assertTrue(self.paths_between_all_users("User1:4", {'bandwidth': 100})) |
198
|
|
|
|
199
|
|
|
def test_path5_4(self): |
200
|
|
|
"""Tests paths between all users using constrained path algorithm, |
201
|
|
|
with the reliability constraint set to 3. |
202
|
|
|
""" |
203
|
|
|
self.assertTrue(self.paths_between_all_users("User4:3", {'bandwidth': 100})) |
204
|
|
|
|
205
|
|
|
#### |
206
|
|
|
|
207
|
|
|
def test_path6_1(self): |
208
|
|
|
"""Tests paths between all users using constrained path algorithm, |
209
|
|
|
with the delay constraint set to 50. |
210
|
|
|
""" |
211
|
|
|
self.assertTrue(self.paths_between_all_users("S1:1", {'delay': 50})) |
212
|
|
|
|
213
|
|
|
def test_path6_2(self): |
214
|
|
|
"""Tests paths between all users using constrained path algorithm, |
215
|
|
|
with the delay constraint set to 50. |
216
|
|
|
""" |
217
|
|
|
self.assertTrue(self.paths_between_all_users("S2:1", {'delay': 50})) |
218
|
|
|
|
219
|
|
|
def test_path6_3(self): |
220
|
|
|
"""Tests paths between all users using constrained path algorithm, |
221
|
|
|
with the delay constraint set to 50. |
222
|
|
|
""" |
223
|
|
|
self.assertTrue(self.paths_between_all_users("S3:1", {'delay': 50})) |
224
|
|
|
|
225
|
|
|
def test_path6_4(self): |
226
|
|
|
"""Tests paths between all users using constrained path algorithm, |
227
|
|
|
with the delay constraint set to 50. |
228
|
|
|
""" |
229
|
|
|
self.assertTrue(self.paths_between_all_users("S5:1", {'delay': 50})) |
230
|
|
|
|
231
|
|
|
def test_path6_5(self): |
232
|
|
|
"""Tests paths between all users using constrained path algorithm, |
233
|
|
|
with the delay constraint set to 50. |
234
|
|
|
""" |
235
|
|
|
self.assertTrue(self.paths_between_all_users("S4:2", {'delay': 50})) |
236
|
|
|
|
237
|
|
|
def test_path6_6(self): |
238
|
|
|
"""Tests paths between all users using constrained path algorithm, |
239
|
|
|
with the delay constraint set to 50. |
240
|
|
|
""" |
241
|
|
|
self.assertTrue(self.paths_between_all_users("User1:2", {'delay': 50})) |
242
|
|
|
|
243
|
|
|
def test_path6_7(self): |
244
|
|
|
"""Tests paths between all users using constrained path algorithm, |
245
|
|
|
with the delay constraint set to 50. |
246
|
|
|
""" |
247
|
|
|
self.assertTrue(self.paths_between_all_users("S5:5", {'delay': 50})) |
248
|
|
|
|
249
|
|
|
def test_path6_8(self): |
250
|
|
|
"""Tests paths between all users using constrained path algorithm, |
251
|
|
|
with the delay constraint set to 50. |
252
|
|
|
""" |
253
|
|
|
self.assertTrue(self.paths_between_all_users("S8:2", {'delay': 50})) |
254
|
|
|
|
255
|
|
|
def test_path6_9(self): |
256
|
|
|
"""Tests paths between all users using constrained path algorithm, |
257
|
|
|
with the delay constraint set to 50. |
258
|
|
|
""" |
259
|
|
|
self.assertTrue(self.paths_between_all_users("S5:6", {'delay': 50})) |
260
|
|
|
|
261
|
|
|
def test_path6_1_0(self): |
262
|
|
|
"""Tests paths between all users using constrained path algorithm, |
263
|
|
|
with the delay constraint set to 50. |
264
|
|
|
""" |
265
|
|
|
self.assertTrue(self.paths_between_all_users("User1:3", {'delay': 50})) |
266
|
|
|
|
267
|
|
|
def test_path6_1_1(self): |
268
|
|
|
"""Tests paths between all users using constrained path algorithm, |
269
|
|
|
with the delay constraint set to 50. |
270
|
|
|
""" |
271
|
|
|
self.assertTrue(self.paths_between_all_users("S6:3", {'delay': 50})) |
272
|
|
|
|
273
|
|
|
def test_path6_1_2(self): |
274
|
|
|
"""Tests paths between all users using constrained path algorithm, |
275
|
|
|
with the delay constraint set to 50. |
276
|
|
|
""" |
277
|
|
|
self.assertTrue(self.paths_between_all_users("S9:1", {'delay': 50})) |
278
|
|
|
|
279
|
|
|
def test_path6_1_3(self): |
280
|
|
|
"""Tests paths between all users using constrained path algorithm, |
281
|
|
|
with the delay constraint set to 50. |
282
|
|
|
""" |
283
|
|
|
self.assertTrue(self.paths_between_all_users("S6:4", {'delay': 50})) |
284
|
|
|
|
285
|
|
|
def test_path6_1_4(self): |
286
|
|
|
"""Tests paths between all users using constrained path algorithm, |
287
|
|
|
with the delay constraint set to 50. |
288
|
|
|
""" |
289
|
|
|
self.assertTrue(self.paths_between_all_users("S9:2", {'delay': 50})) |
290
|
|
|
|
291
|
|
|
def test_path6_1_5(self): |
292
|
|
|
"""Tests paths between all users using constrained path algorithm, |
293
|
|
|
with the delay constraint set to 50. |
294
|
|
|
""" |
295
|
|
|
self.assertTrue(self.paths_between_all_users("S6:5", {'delay': 50})) |
296
|
|
|
|
297
|
|
|
def test_path6_1_6(self): |
298
|
|
|
"""Tests paths between all users using constrained path algorithm, |
299
|
|
|
with the delay constraint set to 50. |
300
|
|
|
""" |
301
|
|
|
self.assertTrue(self.paths_between_all_users("S6:5", {'delay': 50})) |
302
|
|
|
|
303
|
|
|
def test_path6_1_7(self): |
304
|
|
|
"""Tests paths between all users using constrained path algorithm, |
305
|
|
|
with the delay constraint set to 50. |
306
|
|
|
""" |
307
|
|
|
self.assertTrue(self.paths_between_all_users("S10:1", {'delay': 50})) |
308
|
|
|
|
309
|
|
|
def test_path6_1_8(self): |
310
|
|
|
"""Tests paths between all users using constrained path algorithm, |
311
|
|
|
with the delay constraint set to 50. |
312
|
|
|
""" |
313
|
|
|
self.assertTrue(self.paths_between_all_users("S8:5", {'delay': 50})) |
314
|
|
|
|
315
|
|
|
def test_path6_1_9(self): |
316
|
|
|
"""Tests paths between all users using constrained path algorithm, |
317
|
|
|
with the delay constraint set to 50. |
318
|
|
|
""" |
319
|
|
|
self.assertTrue(self.paths_between_all_users("S9:4", {'delay': 50})) |
320
|
|
|
|
321
|
|
|
def test_path6_2_0(self): |
322
|
|
|
"""Tests paths between all users using constrained path algorithm, |
323
|
|
|
with the delay constraint set to 50. |
324
|
|
|
""" |
325
|
|
|
self.assertTrue(self.paths_between_all_users("User1:4", {'delay': 50})) |
326
|
|
|
|
327
|
|
|
def test_path6_2_1(self): |
328
|
|
|
"""Tests paths between all users using constrained path algorithm, |
329
|
|
|
with the delay constraint set to 50. |
330
|
|
|
""" |
331
|
|
|
self.assertTrue(self.paths_between_all_users("User4:3", {'delay': 50})) |
332
|
|
|
|
333
|
|
|
#### |
334
|
|
|
|
335
|
|
|
def test_path7_1(self): |
336
|
|
|
"""Tests paths between all users using constrained path algorithm, |
337
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
338
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
339
|
|
|
constraint set to 'B' |
340
|
|
|
""" |
341
|
|
|
# delay = 50 |
342
|
|
|
self.assertTrue(self.paths_between_all_users("S1:1", {'delay': 50, |
343
|
|
|
'bandwidth': 100, |
344
|
|
|
'ownership': "B"})) |
345
|
|
|
|
346
|
|
|
def test_path7_2(self): |
347
|
|
|
"""Tests paths between all users using constrained path algorithm, |
348
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
349
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
350
|
|
|
constraint set to 'B' |
351
|
|
|
""" |
352
|
|
|
# delay = 50 |
353
|
|
|
self.assertTrue(self.paths_between_all_users("S2:1", {'delay': 50, |
354
|
|
|
'bandwidth': 100, |
355
|
|
|
'ownership': "B"})) |
356
|
|
|
|
357
|
|
|
def test_path7_3(self): |
358
|
|
|
"""Tests paths between all users using constrained path algorithm, |
359
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
360
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
361
|
|
|
constraint set to 'B' |
362
|
|
|
""" |
363
|
|
|
# delay = 50 |
364
|
|
|
self.assertTrue(self.paths_between_all_users("S3:1", {'delay': 50, |
365
|
|
|
'bandwidth': 100, |
366
|
|
|
'ownership': "B"})) |
367
|
|
|
|
368
|
|
|
def test_path7_4(self): |
369
|
|
|
"""Tests paths between all users using constrained path algorithm, |
370
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
371
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
372
|
|
|
constraint set to 'B' |
373
|
|
|
""" |
374
|
|
|
# delay = 50 |
375
|
|
|
self.assertTrue(self.paths_between_all_users("S5:1", {'delay': 50, |
376
|
|
|
'bandwidth': 100, |
377
|
|
|
'ownership': "B"})) |
378
|
|
|
|
379
|
|
|
def test_path7_5(self): |
380
|
|
|
"""Tests paths between all users using constrained path algorithm, |
381
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
382
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
383
|
|
|
constraint set to 'B' |
384
|
|
|
""" |
385
|
|
|
# delay = 50 |
386
|
|
|
self.assertTrue(self.paths_between_all_users("S4:2", {'delay': 50, |
387
|
|
|
'bandwidth': 100, |
388
|
|
|
'ownership': "B"})) |
389
|
|
|
|
390
|
|
|
def test_path7_6(self): |
391
|
|
|
"""Tests paths between all users using constrained path algorithm, |
392
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
393
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
394
|
|
|
constraint set to 'B' |
395
|
|
|
""" |
396
|
|
|
# delay = 50 |
397
|
|
|
self.assertTrue(self.paths_between_all_users("User1:2", {'delay': 50, |
398
|
|
|
'bandwidth': 100, |
399
|
|
|
'ownership': "B"})) |
400
|
|
|
|
401
|
|
|
def test_path7_7(self): |
402
|
|
|
"""Tests paths between all users using constrained path algorithm, |
403
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
404
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
405
|
|
|
constraint set to 'B' |
406
|
|
|
""" |
407
|
|
|
# delay = 50 |
408
|
|
|
self.assertTrue(self.paths_between_all_users("S5:5", {'delay': 50, |
409
|
|
|
'bandwidth': 100, |
410
|
|
|
'ownership': "B"})) |
411
|
|
|
|
412
|
|
|
def test_path7_8(self): |
413
|
|
|
"""Tests paths between all users using constrained path algorithm, |
414
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
415
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
416
|
|
|
constraint set to 'B' |
417
|
|
|
""" |
418
|
|
|
# delay = 50 |
419
|
|
|
self.assertTrue(self.paths_between_all_users("S8:2", {'delay': 50, |
420
|
|
|
'bandwidth': 100, |
421
|
|
|
'ownership': "B"})) |
422
|
|
|
|
423
|
|
|
def test_path7_9(self): |
424
|
|
|
"""Tests paths between all users using constrained path algorithm, |
425
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
426
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
427
|
|
|
constraint set to 'B' |
428
|
|
|
""" |
429
|
|
|
# delay = 50 |
430
|
|
|
self.assertTrue(self.paths_between_all_users("S5:6", {'delay': 50, |
431
|
|
|
'bandwidth': 100, |
432
|
|
|
'ownership': "B"})) |
433
|
|
|
|
434
|
|
|
def test_path7_1_0(self): |
435
|
|
|
"""Tests paths between all users using constrained path algorithm, |
436
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
437
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
438
|
|
|
constraint set to 'B' |
439
|
|
|
""" |
440
|
|
|
# delay = 50 |
441
|
|
|
self.assertTrue(self.paths_between_all_users("User1:3", {'delay': 50, |
442
|
|
|
'bandwidth': 100, |
443
|
|
|
'ownership': "B"})) |
444
|
|
|
|
445
|
|
|
def test_path7_1_1(self): |
446
|
|
|
"""Tests paths between all users using constrained path algorithm, |
447
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
448
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
449
|
|
|
constraint set to 'B' |
450
|
|
|
""" |
451
|
|
|
# delay = 50 |
452
|
|
|
self.assertTrue(self.paths_between_all_users("S6:3", {'delay': 50, |
453
|
|
|
'bandwidth': 100, |
454
|
|
|
'ownership': "B"})) |
455
|
|
|
|
456
|
|
|
def test_path7_1_2(self): |
457
|
|
|
"""Tests paths between all users using constrained path algorithm, |
458
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
459
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
460
|
|
|
constraint set to 'B' |
461
|
|
|
""" |
462
|
|
|
# delay = 50 |
463
|
|
|
self.assertTrue(self.paths_between_all_users("S9:1", {'delay': 50, |
464
|
|
|
'bandwidth': 100, |
465
|
|
|
'ownership': "B"})) |
466
|
|
|
|
467
|
|
|
def test_path7_1_3(self): |
468
|
|
|
"""Tests paths between all users using constrained path algorithm, |
469
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
470
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
471
|
|
|
constraint set to 'B' |
472
|
|
|
""" |
473
|
|
|
# delay = 50 |
474
|
|
|
self.assertTrue(self.paths_between_all_users("S6:4", {'delay': 50, |
475
|
|
|
'bandwidth': 100, |
476
|
|
|
'ownership': "B"})) |
477
|
|
|
|
478
|
|
|
def test_path7_1_4(self): |
479
|
|
|
"""Tests paths between all users using constrained path algorithm, |
480
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
481
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
482
|
|
|
constraint set to 'B' |
483
|
|
|
""" |
484
|
|
|
# delay = 50 |
485
|
|
|
self.assertTrue(self.paths_between_all_users("S9:2", {'delay': 50, |
486
|
|
|
'bandwidth': 100, |
487
|
|
|
'ownership': "B"})) |
488
|
|
|
|
489
|
|
|
def test_path7_1_5(self): |
490
|
|
|
"""Tests paths between all users using constrained path algorithm, |
491
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
492
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
493
|
|
|
constraint set to 'B' |
494
|
|
|
""" |
495
|
|
|
# delay = 50 |
496
|
|
|
self.assertTrue(self.paths_between_all_users("S6:5", {'delay': 50, |
497
|
|
|
'bandwidth': 100, |
498
|
|
|
'ownership': "B"})) |
499
|
|
|
|
500
|
|
|
def test_path7_1_6(self): |
501
|
|
|
"""Tests paths between all users using constrained path algorithm, |
502
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
503
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
504
|
|
|
constraint set to 'B' |
505
|
|
|
""" |
506
|
|
|
# delay = 50 |
507
|
|
|
self.assertTrue(self.paths_between_all_users("S10:1", {'delay': 50, |
508
|
|
|
'bandwidth': 100, |
509
|
|
|
'ownership': "B"})) |
510
|
|
|
|
511
|
|
|
def test_path7_1_7(self): |
512
|
|
|
"""Tests paths between all users using constrained path algorithm, |
513
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
514
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
515
|
|
|
constraint set to 'B' |
516
|
|
|
""" |
517
|
|
|
# delay = 50 |
518
|
|
|
self.assertTrue(self.paths_between_all_users("S8:5", {'delay': 50, |
519
|
|
|
'bandwidth': 100, |
520
|
|
|
'ownership': "B"})) |
521
|
|
|
|
522
|
|
|
def test_path7_1_8(self): |
523
|
|
|
"""Tests paths between all users using constrained path algorithm, |
524
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
525
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
526
|
|
|
constraint set to 'B' |
527
|
|
|
""" |
528
|
|
|
# delay = 50 |
529
|
|
|
self.assertTrue(self.paths_between_all_users("S9:4", {'delay': 50, |
530
|
|
|
'bandwidth': 100, |
531
|
|
|
'ownership': "B"})) |
532
|
|
|
|
533
|
|
|
def test_path7_1_9(self): |
534
|
|
|
"""Tests paths between all users using constrained path algorithm, |
535
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
536
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
537
|
|
|
constraint set to 'B' |
538
|
|
|
""" |
539
|
|
|
# delay = 50 |
540
|
|
|
self.assertTrue(self.paths_between_all_users("User1:4", {'delay': 50, |
541
|
|
|
'bandwidth': 100, |
542
|
|
|
'ownership': "B"})) |
543
|
|
|
|
544
|
|
|
def test_path7_2_0(self): |
545
|
|
|
"""Tests paths between all users using constrained path algorithm, |
546
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
547
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
548
|
|
|
constraint set to 'B' |
549
|
|
|
""" |
550
|
|
|
# delay = 50 |
551
|
|
|
self.assertTrue(self.paths_between_all_users("User4:3", {'delay': 50, |
552
|
|
|
'bandwidth': 100, |
553
|
|
|
'ownership': "B"})) |
554
|
|
|
|
555
|
|
|
def test_path7_2_1(self): |
556
|
|
|
"""Tests paths between all users using constrained path algorithm, |
557
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
558
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
559
|
|
|
constraint set to 'B' |
560
|
|
|
""" |
561
|
|
|
# bandwidth = 100 |
562
|
|
|
self.assertTrue(self.paths_between_all_users("S3:1", {'delay': 50, |
563
|
|
|
'bandwidth': 100, |
564
|
|
|
'ownership': "B"})) |
565
|
|
|
|
566
|
|
|
def test_path7_2_2(self): |
567
|
|
|
"""Tests paths between all users using constrained path algorithm, |
568
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
569
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
570
|
|
|
constraint set to 'B' |
571
|
|
|
""" |
572
|
|
|
# bandwidth = 100 |
573
|
|
|
self.assertTrue(self.paths_between_all_users("S5:1", {'delay': 50, |
574
|
|
|
'bandwidth': 100, |
575
|
|
|
'ownership': "B"})) |
576
|
|
|
|
577
|
|
|
def test_path7_2_3(self): |
578
|
|
|
"""Tests paths between all users using constrained path algorithm, |
579
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
580
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
581
|
|
|
constraint set to 'B' |
582
|
|
|
""" |
583
|
|
|
# bandwidth = 100 |
584
|
|
|
self.assertTrue(self.paths_between_all_users("User1:4", {'delay': 50, |
585
|
|
|
'bandwidth': 100, |
586
|
|
|
'ownership': "B"})) |
587
|
|
|
|
588
|
|
|
def test_path7_2_4(self): |
589
|
|
|
"""Tests paths between all users using constrained path algorithm, |
590
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
591
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
592
|
|
|
constraint set to 'B' |
593
|
|
|
""" |
594
|
|
|
# bandwidth = 100 |
595
|
|
|
self.assertTrue(self.paths_between_all_users("User4:3", {'delay': 50, |
596
|
|
|
'bandwidth': 100, |
597
|
|
|
'ownership': "B"})) |
598
|
|
|
|
599
|
|
|
def test_path7_2_5(self): |
600
|
|
|
"""Tests paths between all users using constrained path algorithm, |
601
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
602
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
603
|
|
|
constraint set to 'B' |
604
|
|
|
""" |
605
|
|
|
# reliability = 3 |
606
|
|
|
self.assertTrue(self.paths_between_all_users("S4:1", {'delay': 50, |
607
|
|
|
'bandwidth': 100, |
608
|
|
|
'ownership': "B"})) |
609
|
|
|
|
610
|
|
|
def test_path7_2_6(self): |
611
|
|
|
"""Tests paths between all users using constrained path algorithm, |
612
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
613
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
614
|
|
|
constraint set to 'B' |
615
|
|
|
""" |
616
|
|
|
# reliability = 3 |
617
|
|
|
self.assertTrue(self.paths_between_all_users("S5:2", {'delay': 50, |
618
|
|
|
'bandwidth': 100, |
619
|
|
|
'ownership': "B"})) |
620
|
|
|
|
621
|
|
|
def test_path7_2_7(self): |
622
|
|
|
"""Tests paths between all users using constrained path algorithm, |
623
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
624
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
625
|
|
|
constraint set to 'B' |
626
|
|
|
""" |
627
|
|
|
# reliability = 3 |
628
|
|
|
self.assertTrue(self.paths_between_all_users("S5:3", {'delay': 50, |
629
|
|
|
'bandwidth': 100, |
630
|
|
|
'ownership': "B"})) |
631
|
|
|
|
632
|
|
|
def test_path7_2_8(self): |
633
|
|
|
"""Tests paths between all users using constrained path algorithm, |
634
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
635
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
636
|
|
|
constraint set to 'B' |
637
|
|
|
""" |
638
|
|
|
# reliability = 3 |
639
|
|
|
self.assertTrue(self.paths_between_all_users("S6:1", {'delay': 50, |
640
|
|
|
'bandwidth': 100, |
641
|
|
|
'ownership': "B"})) |
642
|
|
|
|
643
|
|
|
def test_path7_2_9(self): |
644
|
|
|
"""Tests paths between all users using constrained path algorithm, |
645
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
646
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
647
|
|
|
constraint set to 'B' |
648
|
|
|
""" |
649
|
|
|
# ownership = "B" |
650
|
|
|
self.assertTrue(self.paths_between_all_users("S4:1", {'delay': 50, |
651
|
|
|
'bandwidth': 100, |
652
|
|
|
'ownership': "B"})) |
653
|
|
|
|
654
|
|
|
def test_path7_3_0(self): |
655
|
|
|
"""Tests paths between all users using constrained path algorithm, |
656
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
657
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
658
|
|
|
constraint set to 'B' |
659
|
|
|
""" |
660
|
|
|
# ownership = "B" |
661
|
|
|
self.assertTrue(self.paths_between_all_users("S5:2", {'delay': 50, |
662
|
|
|
'bandwidth': 100, |
663
|
|
|
'ownership': "B"})) |
664
|
|
|
|
665
|
|
|
def test_path7_3_1(self): |
666
|
|
|
"""Tests paths between all users using constrained path algorithm, |
667
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
668
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
669
|
|
|
constraint set to 'B' |
670
|
|
|
""" |
671
|
|
|
# ownership = "B" |
672
|
|
|
self.assertTrue(self.paths_between_all_users("S4:2", {'delay': 50, |
673
|
|
|
'bandwidth': 100, |
674
|
|
|
'ownership': "B"})) |
675
|
|
|
|
676
|
|
|
def test_path7_3_2(self): |
677
|
|
|
"""Tests paths between all users using constrained path algorithm, |
678
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
679
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
680
|
|
|
constraint set to 'B' |
681
|
|
|
""" |
682
|
|
|
# ownership = "B" |
683
|
|
|
self.assertTrue(self.paths_between_all_users("User1:2", {'delay': 50, |
684
|
|
|
'bandwidth': 100, |
685
|
|
|
'ownership': "B"})) |
686
|
|
|
|
687
|
|
|
def test_path7_3_3(self): |
688
|
|
|
"""Tests paths between all users using constrained path algorithm, |
689
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
690
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
691
|
|
|
constraint set to 'B' |
692
|
|
|
""" |
693
|
|
|
# ownership = "B" |
694
|
|
|
self.assertTrue(self.paths_between_all_users("S5:4", {'delay': 50, |
695
|
|
|
'bandwidth': 100, |
696
|
|
|
'ownership': "B"})) |
697
|
|
|
|
698
|
|
|
def test_path7_3_4(self): |
699
|
|
|
"""Tests paths between all users using constrained path algorithm, |
700
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
701
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
702
|
|
|
constraint set to 'B' |
703
|
|
|
""" |
704
|
|
|
# ownership = "B" |
705
|
|
|
self.assertTrue(self.paths_between_all_users("S6:2", {'delay': 50, |
706
|
|
|
'bandwidth': 100, |
707
|
|
|
'ownership': "B"})) |
708
|
|
|
|
709
|
|
|
def test_path7_3_5(self): |
710
|
|
|
"""Tests paths between all users using constrained path algorithm, |
711
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
712
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
713
|
|
|
constraint set to 'B' |
714
|
|
|
""" |
715
|
|
|
# ownership = "B" |
716
|
|
|
self.assertTrue(self.paths_between_all_users("S6:5", {'delay': 50, |
717
|
|
|
'bandwidth': 100, |
718
|
|
|
'ownership': "B"})) |
719
|
|
|
|
720
|
|
|
def test_path7_3_6(self): |
721
|
|
|
"""Tests paths between all users using constrained path algorithm, |
722
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
723
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
724
|
|
|
constraint set to 'B' |
725
|
|
|
""" |
726
|
|
|
# ownership = "B" |
727
|
|
|
self.assertTrue(self.paths_between_all_users("S10:1", {'delay': 50, |
728
|
|
|
'bandwidth': 100, |
729
|
|
|
'ownership': "B"})) |
730
|
|
|
|
731
|
|
|
def test_path7_3_7(self): |
732
|
|
|
"""Tests paths between all users using constrained path algorithm, |
733
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
734
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
735
|
|
|
constraint set to 'B' |
736
|
|
|
""" |
737
|
|
|
# ownership = "B" |
738
|
|
|
self.assertTrue(self.paths_between_all_users("S8:6", {'delay': 50, |
739
|
|
|
'bandwidth': 100, |
740
|
|
|
'ownership': "B"})) |
741
|
|
|
|
742
|
|
|
def test_path7_3_8(self): |
743
|
|
|
"""Tests paths between all users using constrained path algorithm, |
744
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
745
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
746
|
|
|
constraint set to 'B' |
747
|
|
|
""" |
748
|
|
|
# ownership = "B" |
749
|
|
|
self.assertTrue(self.paths_between_all_users("S10:2", {'delay': 50, |
750
|
|
|
'bandwidth': 100, |
751
|
|
|
'ownership': "B"})) |
752
|
|
|
|
753
|
|
|
def test_path7_3_9(self): |
754
|
|
|
"""Tests paths between all users using constrained path algorithm, |
755
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
756
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
757
|
|
|
constraint set to 'B' |
758
|
|
|
""" |
759
|
|
|
# ownership = "B" |
760
|
|
|
self.assertTrue(self.paths_between_all_users("S10:3", {'delay': 50, |
761
|
|
|
'bandwidth': 100, |
762
|
|
|
'ownership': "B"})) |
763
|
|
|
|
764
|
|
|
def test_path7_4_0(self): |
765
|
|
|
"""Tests paths between all users using constrained path algorithm, |
766
|
|
|
with the delay constraint set to 50, the bandwidth constraint set |
767
|
|
|
to 100, the reliability constraint set to 3, and the ownership |
768
|
|
|
constraint set to 'B' |
769
|
|
|
""" |
770
|
|
|
# ownership = "B" |
771
|
|
|
self.assertTrue(self.paths_between_all_users("User2:1", {'delay': 50, |
772
|
|
|
'bandwidth': 100, |
773
|
|
|
'ownership': "B"})) |
774
|
|
|
|
775
|
|
|
##### |
776
|
|
|
|
777
|
|
|
def test_path8_1(self): |
778
|
|
|
"""Tests paths between all users using constrained path algorithm, |
779
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
780
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
781
|
|
|
constraint set to 'B' |
782
|
|
|
|
783
|
|
|
Tests conducted with flexibility enabled |
784
|
|
|
""" |
785
|
|
|
# delay = 50 |
786
|
|
|
self.assertTrue(self.paths_between_all_users("S1:1", flexible={'delay': 50, |
787
|
|
|
'bandwidth': 100, |
788
|
|
|
'reliability': 3, |
789
|
|
|
'ownership': "B"}, |
790
|
|
|
metrics='delay')) |
791
|
|
|
|
792
|
|
|
def test_path8_2(self): |
793
|
|
|
"""Tests paths between all users using constrained path algorithm, |
794
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
795
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
796
|
|
|
constraint set to 'B' |
797
|
|
|
|
798
|
|
|
Tests conducted with flexibility enabled |
799
|
|
|
""" |
800
|
|
|
# delay = 50 |
801
|
|
|
self.assertTrue(self.paths_between_all_users("S2:1", flexible={'delay': 50, |
802
|
|
|
'bandwidth': 100, |
803
|
|
|
'reliability': 3, |
804
|
|
|
'ownership': "B"}, |
805
|
|
|
metrics='delay')) |
806
|
|
|
|
807
|
|
|
def test_path8_3(self): |
808
|
|
|
"""Tests paths between all users using constrained path algorithm, |
809
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
810
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
811
|
|
|
constraint set to 'B' |
812
|
|
|
|
813
|
|
|
Tests conducted with flexibility enabled |
814
|
|
|
""" |
815
|
|
|
# delay = 50 |
816
|
|
|
self.assertTrue(self.paths_between_all_users("S3:1", flexible={'delay': 50, |
817
|
|
|
'bandwidth': 100, |
818
|
|
|
'reliability': 3, |
819
|
|
|
'ownership': "B"}, |
820
|
|
|
metrics='delay')) |
821
|
|
|
|
822
|
|
|
def test_path8_4(self): |
823
|
|
|
"""Tests paths between all users using constrained path algorithm, |
824
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
825
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
826
|
|
|
constraint set to 'B' |
827
|
|
|
|
828
|
|
|
Tests conducted with flexibility enabled |
829
|
|
|
""" |
830
|
|
|
# delay = 50 |
831
|
|
|
self.assertTrue(self.paths_between_all_users("S5:1", flexible={'delay': 50, |
832
|
|
|
'bandwidth': 100, |
833
|
|
|
'reliability': 3, |
834
|
|
|
'ownership': "B"}, |
835
|
|
|
metrics='delay')) |
836
|
|
|
|
837
|
|
|
def test_path8_5(self): |
838
|
|
|
"""Tests paths between all users using constrained path algorithm, |
839
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
840
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
841
|
|
|
constraint set to 'B' |
842
|
|
|
|
843
|
|
|
Tests conducted with flexibility enabled |
844
|
|
|
""" |
845
|
|
|
# delay = 50 |
846
|
|
|
self.assertTrue(self.paths_between_all_users("S4:2", flexible={'delay': 50, |
847
|
|
|
'bandwidth': 100, |
848
|
|
|
'reliability': 3, |
849
|
|
|
'ownership': "B"}, |
850
|
|
|
metrics='delay')) |
851
|
|
|
|
852
|
|
|
def test_path8_6(self): |
853
|
|
|
"""Tests paths between all users using constrained path algorithm, |
854
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
855
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
856
|
|
|
constraint set to 'B' |
857
|
|
|
|
858
|
|
|
Tests conducted with flexibility enabled |
859
|
|
|
""" |
860
|
|
|
# delay = 50 |
861
|
|
|
self.assertTrue(self.paths_between_all_users("User1:2", flexible={'delay': 50, |
862
|
|
|
'bandwidth': 100, |
863
|
|
|
'reliability': 3, |
864
|
|
|
'ownership': "B"}, |
865
|
|
|
metrics='delay')) |
866
|
|
|
|
867
|
|
|
def test_path8_7(self): |
868
|
|
|
"""Tests paths between all users using constrained path algorithm, |
869
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
870
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
871
|
|
|
constraint set to 'B' |
872
|
|
|
|
873
|
|
|
Tests conducted with flexibility enabled |
874
|
|
|
""" |
875
|
|
|
# delay = 50 |
876
|
|
|
self.assertTrue(self.paths_between_all_users("S5:5", flexible={'delay': 50, |
877
|
|
|
'bandwidth': 100, |
878
|
|
|
'reliability': 3, |
879
|
|
|
'ownership': "B"}, |
880
|
|
|
metrics='delay')) |
881
|
|
|
|
882
|
|
|
def test_path8_8(self): |
883
|
|
|
"""Tests paths between all users using constrained path algorithm, |
884
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
885
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
886
|
|
|
constraint set to 'B' |
887
|
|
|
|
888
|
|
|
Tests conducted with flexibility enabled |
889
|
|
|
""" |
890
|
|
|
# delay = 50 |
891
|
|
|
self.assertTrue(self.paths_between_all_users("S8:2", flexible={'delay': 50, |
892
|
|
|
'bandwidth': 100, |
893
|
|
|
'reliability': 3, |
894
|
|
|
'ownership': "B"}, |
895
|
|
|
metrics='delay')) |
896
|
|
|
|
897
|
|
|
def test_path8_9(self): |
898
|
|
|
"""Tests paths between all users using constrained path algorithm, |
899
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
900
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
901
|
|
|
constraint set to 'B' |
902
|
|
|
|
903
|
|
|
Tests conducted with flexibility enabled |
904
|
|
|
""" |
905
|
|
|
# delay = 50 |
906
|
|
|
self.assertTrue(self.paths_between_all_users("S5:6", flexible={'delay': 50, |
907
|
|
|
'bandwidth': 100, |
908
|
|
|
'reliability': 3, |
909
|
|
|
'ownership': "B"}, |
910
|
|
|
metrics='delay')) |
911
|
|
|
|
912
|
|
|
def test_path8_1_0(self): |
913
|
|
|
"""Tests paths between all users using constrained path algorithm, |
914
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
915
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
916
|
|
|
constraint set to 'B' |
917
|
|
|
|
918
|
|
|
Tests conducted with flexibility enabled |
919
|
|
|
""" |
920
|
|
|
# delay = 50 |
921
|
|
|
self.assertTrue(self.paths_between_all_users("User1:3", flexible={'delay': 50, |
922
|
|
|
'bandwidth': 100, |
923
|
|
|
'reliability': 3, |
924
|
|
|
'ownership': "B"}, |
925
|
|
|
metrics='delay')) |
926
|
|
|
|
927
|
|
|
def test_path8_1_1(self): |
928
|
|
|
"""Tests paths between all users using constrained path algorithm, |
929
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
930
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
931
|
|
|
constraint set to 'B' |
932
|
|
|
|
933
|
|
|
Tests conducted with flexibility enabled |
934
|
|
|
""" |
935
|
|
|
# delay = 50 |
936
|
|
|
self.assertTrue(self.paths_between_all_users("S6:3", flexible={'delay': 50, |
937
|
|
|
'bandwidth': 100, |
938
|
|
|
'reliability': 3, |
939
|
|
|
'ownership': "B"}, |
940
|
|
|
metrics='delay')) |
941
|
|
|
|
942
|
|
|
def test_path8_1_2(self): |
943
|
|
|
"""Tests paths between all users using constrained path algorithm, |
944
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
945
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
946
|
|
|
constraint set to 'B' |
947
|
|
|
|
948
|
|
|
Tests conducted with flexibility enabled |
949
|
|
|
""" |
950
|
|
|
# delay = 50 |
951
|
|
|
self.assertTrue(self.paths_between_all_users("S9:1", flexible={'delay': 50, |
952
|
|
|
'bandwidth': 100, |
953
|
|
|
'reliability': 3, |
954
|
|
|
'ownership': "B"}, |
955
|
|
|
metrics='delay')) |
956
|
|
|
|
957
|
|
|
def test_path8_1_3(self): |
958
|
|
|
"""Tests paths between all users using constrained path algorithm, |
959
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
960
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
961
|
|
|
constraint set to 'B' |
962
|
|
|
|
963
|
|
|
Tests conducted with flexibility enabled |
964
|
|
|
""" |
965
|
|
|
# delay = 50 |
966
|
|
|
self.assertTrue(self.paths_between_all_users("S6:4", flexible={'delay': 50, |
967
|
|
|
'bandwidth': 100, |
968
|
|
|
'reliability': 3, |
969
|
|
|
'ownership': "B"}, |
970
|
|
|
metrics='delay')) |
971
|
|
|
|
972
|
|
|
def test_path8_1_4(self): |
973
|
|
|
"""Tests paths between all users using constrained path algorithm, |
974
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
975
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
976
|
|
|
constraint set to 'B' |
977
|
|
|
|
978
|
|
|
Tests conducted with flexibility enabled |
979
|
|
|
""" |
980
|
|
|
# delay = 50 |
981
|
|
|
self.assertTrue(self.paths_between_all_users("S9:2", flexible={'delay': 50, |
982
|
|
|
'bandwidth': 100, |
983
|
|
|
'reliability': 3, |
984
|
|
|
'ownership': "B"}, |
985
|
|
|
metrics='delay')) |
986
|
|
|
|
987
|
|
|
def test_path8_1_5(self): |
988
|
|
|
"""Tests paths between all users using constrained path algorithm, |
989
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
990
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
991
|
|
|
constraint set to 'B' |
992
|
|
|
|
993
|
|
|
Tests conducted with flexibility enabled |
994
|
|
|
""" |
995
|
|
|
# delay = 50 |
996
|
|
|
self.assertTrue(self.paths_between_all_users("S6:5", flexible={'delay': 50, |
997
|
|
|
'bandwidth': 100, |
998
|
|
|
'reliability': 3, |
999
|
|
|
'ownership': "B"}, |
1000
|
|
|
metrics='delay')) |
1001
|
|
|
|
1002
|
|
|
def test_path8_1_6(self): |
1003
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1004
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1005
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1006
|
|
|
constraint set to 'B' |
1007
|
|
|
|
1008
|
|
|
Tests conducted with flexibility enabled |
1009
|
|
|
""" |
1010
|
|
|
# delay = 50 |
1011
|
|
|
self.assertTrue(self.paths_between_all_users("S10:1", flexible={'delay': 50, |
1012
|
|
|
'bandwidth': 100, |
1013
|
|
|
'reliability': 3, |
1014
|
|
|
'ownership': "B"}, |
1015
|
|
|
metrics='delay')) |
1016
|
|
|
|
1017
|
|
|
def test_path8_1_7(self): |
1018
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1019
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1020
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1021
|
|
|
constraint set to 'B' |
1022
|
|
|
|
1023
|
|
|
Tests conducted with flexibility enabled |
1024
|
|
|
""" |
1025
|
|
|
# delay = 50 |
1026
|
|
|
self.assertTrue(self.paths_between_all_users("S8:5", flexible={'delay': 50, |
1027
|
|
|
'bandwidth': 100, |
1028
|
|
|
'reliability': 3, |
1029
|
|
|
'ownership': "B"}, |
1030
|
|
|
metrics='delay')) |
1031
|
|
|
|
1032
|
|
|
def test_path8_1_8(self): |
1033
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1034
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1035
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1036
|
|
|
constraint set to 'B' |
1037
|
|
|
|
1038
|
|
|
Tests conducted with flexibility enabled |
1039
|
|
|
""" |
1040
|
|
|
# delay = 50 |
1041
|
|
|
self.assertTrue(self.paths_between_all_users("S9:4", flexible={'delay': 50, |
1042
|
|
|
'bandwidth': 100, |
1043
|
|
|
'reliability': 3, |
1044
|
|
|
'ownership': "B"}, |
1045
|
|
|
metrics='delay')) |
1046
|
|
|
|
1047
|
|
|
def test_path8_1_9(self): |
1048
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1049
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1050
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1051
|
|
|
constraint set to 'B' |
1052
|
|
|
|
1053
|
|
|
Tests conducted with flexibility enabled |
1054
|
|
|
""" |
1055
|
|
|
# delay = 50 |
1056
|
|
|
self.assertTrue(self.paths_between_all_users("User1:4", flexible={'delay': 50, |
1057
|
|
|
'bandwidth': 100, |
1058
|
|
|
'reliability': 3, |
1059
|
|
|
'ownership': "B"}, |
1060
|
|
|
metrics='delay')) |
1061
|
|
|
|
1062
|
|
|
def test_path8_2_0(self): |
1063
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1064
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1065
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1066
|
|
|
constraint set to 'B' |
1067
|
|
|
|
1068
|
|
|
Tests conducted with flexibility enabled |
1069
|
|
|
""" |
1070
|
|
|
# delay = 50 |
1071
|
|
|
self.assertTrue(self.paths_between_all_users("User4:3", flexible={'delay': 50, |
1072
|
|
|
'bandwidth': 100, |
1073
|
|
|
'reliability': 3, |
1074
|
|
|
'ownership': "B"}, |
1075
|
|
|
metrics='delay')) |
1076
|
|
|
|
1077
|
|
|
def test_path8_2_1(self): |
1078
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1079
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1080
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1081
|
|
|
constraint set to 'B' |
1082
|
|
|
|
1083
|
|
|
Tests conducted with flexibility enabled |
1084
|
|
|
""" |
1085
|
|
|
# bandwidth = 100 |
1086
|
|
|
self.assertTrue(self.paths_between_all_users("S3:1", flexible={'delay': 50, |
1087
|
|
|
'bandwidth': 100, |
1088
|
|
|
'reliability': 3, |
1089
|
|
|
'ownership': "B"}, |
1090
|
|
|
metrics='bandwidth')) |
1091
|
|
|
|
1092
|
|
|
def test_path8_2_2(self): |
1093
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1094
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1095
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1096
|
|
|
constraint set to 'B' |
1097
|
|
|
|
1098
|
|
|
Tests conducted with flexibility enabled |
1099
|
|
|
""" |
1100
|
|
|
# bandwidth = 100 |
1101
|
|
|
self.assertTrue(self.paths_between_all_users("S5:1", flexible={'delay': 50, |
1102
|
|
|
'bandwidth': 100, |
1103
|
|
|
'reliability': 3, |
1104
|
|
|
'ownership': "B"}, |
1105
|
|
|
metrics='bandwidth')) |
1106
|
|
|
|
1107
|
|
|
def test_path8_2_3(self): |
1108
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1109
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1110
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1111
|
|
|
constraint set to 'B' |
1112
|
|
|
|
1113
|
|
|
Tests conducted with flexibility enabled |
1114
|
|
|
""" |
1115
|
|
|
# bandwidth = 100 |
1116
|
|
|
self.assertTrue(self.paths_between_all_users("User1:4", flexible={'delay': 50, |
1117
|
|
|
'bandwidth': 100, |
1118
|
|
|
'reliability': 3, |
1119
|
|
|
'ownership': "B"}, |
1120
|
|
|
metrics='bandwidth')) |
1121
|
|
|
|
1122
|
|
|
def test_path8_2_4(self): |
1123
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1124
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1125
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1126
|
|
|
constraint set to 'B' |
1127
|
|
|
|
1128
|
|
|
Tests conducted with flexibility enabled |
1129
|
|
|
""" |
1130
|
|
|
# bandwidth = 100 |
1131
|
|
|
self.assertTrue(self.paths_between_all_users("User4:3", flexible={'delay': 50, |
1132
|
|
|
'bandwidth': 100, |
1133
|
|
|
'reliability': 3, |
1134
|
|
|
'ownership': "B"}, |
1135
|
|
|
metrics='bandwidth')) |
1136
|
|
|
|
1137
|
|
|
def test_path8_2_5(self): |
1138
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1139
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1140
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1141
|
|
|
constraint set to 'B' |
1142
|
|
|
|
1143
|
|
|
Tests conducted with flexibility enabled |
1144
|
|
|
""" |
1145
|
|
|
# reliability = 3 |
1146
|
|
|
self.assertTrue(self.paths_between_all_users("S4:1", flexible={'delay': 50, |
1147
|
|
|
'bandwidth': 100, |
1148
|
|
|
'reliability': 3, |
1149
|
|
|
'ownership': "B"}, |
1150
|
|
|
metrics='reliability')) |
1151
|
|
|
|
1152
|
|
|
def test_path8_2_6(self): |
1153
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1154
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1155
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1156
|
|
|
constraint set to 'B' |
1157
|
|
|
|
1158
|
|
|
Tests conducted with flexibility enabled |
1159
|
|
|
""" |
1160
|
|
|
# reliability = 3 |
1161
|
|
|
self.assertTrue(self.paths_between_all_users("S5:2", flexible={'delay': 50, |
1162
|
|
|
'bandwidth': 100, |
1163
|
|
|
'reliability': 3, |
1164
|
|
|
'ownership': "B"}, |
1165
|
|
|
metrics='reliability')) |
1166
|
|
|
|
1167
|
|
|
def test_path8_2_7(self): |
1168
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1169
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1170
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1171
|
|
|
constraint set to 'B' |
1172
|
|
|
|
1173
|
|
|
Tests conducted with flexibility enabled |
1174
|
|
|
""" |
1175
|
|
|
# reliability = 3 |
1176
|
|
|
self.assertTrue(self.paths_between_all_users("S5:3", flexible={'delay': 50, |
1177
|
|
|
'bandwidth': 100, |
1178
|
|
|
'reliability': 3, |
1179
|
|
|
'ownership': "B"}, |
1180
|
|
|
metrics='reliability')) |
1181
|
|
|
|
1182
|
|
|
def test_path8_2_8(self): |
1183
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1184
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1185
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1186
|
|
|
constraint set to 'B' |
1187
|
|
|
|
1188
|
|
|
Tests conducted with flexibility enabled |
1189
|
|
|
""" |
1190
|
|
|
# reliability = 3 |
1191
|
|
|
self.assertTrue(self.paths_between_all_users("S6:1", flexible={'delay': 50, |
1192
|
|
|
'bandwidth': 100, |
1193
|
|
|
'reliability': 3, |
1194
|
|
|
'ownership': "B"}, |
1195
|
|
|
metrics='reliability')) |
1196
|
|
|
|
1197
|
|
|
def test_path8_2_9(self): |
1198
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1199
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1200
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1201
|
|
|
constraint set to 'B' |
1202
|
|
|
|
1203
|
|
|
Tests conducted with flexibility enabled |
1204
|
|
|
""" |
1205
|
|
|
# ownership = "B" |
1206
|
|
|
self.assertTrue(self.paths_between_all_users("S4:1", flexible={'delay': 50, |
1207
|
|
|
'bandwidth': 100, |
1208
|
|
|
'reliability': 3, |
1209
|
|
|
'ownership': "B"})) |
1210
|
|
|
|
1211
|
|
|
def test_path8_3_0(self): |
1212
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1213
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1214
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1215
|
|
|
constraint set to 'B' |
1216
|
|
|
|
1217
|
|
|
Tests conducted with flexibility enabled |
1218
|
|
|
""" |
1219
|
|
|
# ownership = "B" |
1220
|
|
|
self.assertTrue(self.paths_between_all_users("S5:2", flexible={'delay': 50, |
1221
|
|
|
'bandwidth': 100, |
1222
|
|
|
'reliability': 3, |
1223
|
|
|
'ownership': "B"})) |
1224
|
|
|
|
1225
|
|
|
def test_path8_3_1(self): |
1226
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1227
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1228
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1229
|
|
|
constraint set to 'B' |
1230
|
|
|
|
1231
|
|
|
Tests conducted with flexibility enabled |
1232
|
|
|
""" |
1233
|
|
|
# ownership = "B" |
1234
|
|
|
self.assertTrue(self.paths_between_all_users("S4:2", flexible={'delay': 50, |
1235
|
|
|
'bandwidth': 100, |
1236
|
|
|
'reliability': 3, |
1237
|
|
|
'ownership': "B"})) |
1238
|
|
|
|
1239
|
|
|
def test_path8_3_2(self): |
1240
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1241
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1242
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1243
|
|
|
constraint set to 'B' |
1244
|
|
|
|
1245
|
|
|
Tests conducted with flexibility enabled |
1246
|
|
|
""" |
1247
|
|
|
# ownership = "B" |
1248
|
|
|
self.assertTrue(self.paths_between_all_users("User1:2", flexible={'delay': 50, |
1249
|
|
|
'bandwidth': 100, |
1250
|
|
|
'reliability': 3, |
1251
|
|
|
'ownership': "B"})) |
1252
|
|
|
|
1253
|
|
|
def test_path8_3_3(self): |
1254
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1255
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1256
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1257
|
|
|
constraint set to 'B' |
1258
|
|
|
|
1259
|
|
|
Tests conducted with flexibility enabled |
1260
|
|
|
""" |
1261
|
|
|
# ownership = "B" |
1262
|
|
|
self.assertTrue(self.paths_between_all_users("S5:4", flexible={'delay': 50, |
1263
|
|
|
'bandwidth': 100, |
1264
|
|
|
'reliability': 3, |
1265
|
|
|
'ownership': "B"})) |
1266
|
|
|
|
1267
|
|
|
def test_path8_3_4(self): |
1268
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1269
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1270
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1271
|
|
|
constraint set to 'B' |
1272
|
|
|
|
1273
|
|
|
Tests conducted with flexibility enabled |
1274
|
|
|
""" |
1275
|
|
|
# ownership = "B" |
1276
|
|
|
self.assertTrue(self.paths_between_all_users("S6:2", flexible={'delay': 50, |
1277
|
|
|
'bandwidth': 100, |
1278
|
|
|
'reliability': 3, |
1279
|
|
|
'ownership': "B"})) |
1280
|
|
|
|
1281
|
|
|
def test_path8_3_5(self): |
1282
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1283
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1284
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1285
|
|
|
constraint set to 'B' |
1286
|
|
|
|
1287
|
|
|
Tests conducted with flexibility enabled |
1288
|
|
|
""" |
1289
|
|
|
# ownership = "B" |
1290
|
|
|
self.assertTrue(self.paths_between_all_users("S6:5", flexible={'delay': 50, |
1291
|
|
|
'bandwidth': 100, |
1292
|
|
|
'reliability': 3, |
1293
|
|
|
'ownership': "B"})) |
1294
|
|
|
|
1295
|
|
|
def test_path8_3_6(self): |
1296
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1297
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1298
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1299
|
|
|
constraint set to 'B' |
1300
|
|
|
|
1301
|
|
|
Tests conducted with flexibility enabled |
1302
|
|
|
""" |
1303
|
|
|
# ownership = "B" |
1304
|
|
|
self.assertTrue(self.paths_between_all_users("S10:1", flexible={'delay': 50, |
1305
|
|
|
'bandwidth': 100, |
1306
|
|
|
'reliability': 3, |
1307
|
|
|
'ownership': "B"})) |
1308
|
|
|
|
1309
|
|
|
def test_path8_3_7(self): |
1310
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1311
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1312
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1313
|
|
|
constraint set to 'B' |
1314
|
|
|
|
1315
|
|
|
Tests conducted with flexibility enabled |
1316
|
|
|
""" |
1317
|
|
|
# ownership = "B" |
1318
|
|
|
self.assertTrue(self.paths_between_all_users("S8:6", flexible={'delay': 50, |
1319
|
|
|
'bandwidth': 100, |
1320
|
|
|
'reliability': 3, |
1321
|
|
|
'ownership': "B"})) |
1322
|
|
|
|
1323
|
|
|
def test_path8_3_8(self): |
1324
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1325
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1326
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1327
|
|
|
constraint set to 'B' |
1328
|
|
|
|
1329
|
|
|
Tests conducted with flexibility enabled |
1330
|
|
|
""" |
1331
|
|
|
# ownership = "B" |
1332
|
|
|
self.assertTrue(self.paths_between_all_users("S10:2", flexible={'delay': 50, |
1333
|
|
|
'bandwidth': 100, |
1334
|
|
|
'reliability': 3, |
1335
|
|
|
'ownership': "B"})) |
1336
|
|
|
|
1337
|
|
|
def test_path8_3_9(self): |
1338
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1339
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1340
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1341
|
|
|
constraint set to 'B' |
1342
|
|
|
|
1343
|
|
|
Tests conducted with flexibility enabled |
1344
|
|
|
""" |
1345
|
|
|
# ownership = "B" |
1346
|
|
|
self.assertTrue(self.paths_between_all_users("S10:3", flexible={'delay': 50, |
1347
|
|
|
'bandwidth': 100, |
1348
|
|
|
'reliability': 3, |
1349
|
|
|
'ownership': "B"})) |
1350
|
|
|
|
1351
|
|
|
def test_path8_4_0(self): |
1352
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1353
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1354
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1355
|
|
|
constraint set to 'B' |
1356
|
|
|
|
1357
|
|
|
Tests conducted with flexibility enabled |
1358
|
|
|
""" |
1359
|
|
|
# ownership = "B" |
1360
|
|
|
self.assertTrue(self.paths_between_all_users("User2:1", flexible={'delay': 50, |
1361
|
|
|
'bandwidth': 100, |
1362
|
|
|
'reliability': 3, |
1363
|
|
|
'ownership': "B"})) |
1364
|
|
|
|
1365
|
|
|
##### |
1366
|
|
|
|
1367
|
|
|
def test_path9(self): |
1368
|
|
|
"""Tests paths between all users using constrained path algorithm, |
1369
|
|
|
with the delay constraint set to 50, the bandwidth constraint |
1370
|
|
|
set to 100, the reliability constraint set to 3, and the ownership |
1371
|
|
|
constraint set to 'B' |
1372
|
|
|
|
1373
|
|
|
Tests conducted with all but ownership flexible |
1374
|
|
|
""" |
1375
|
|
|
combos = combinations(["User1", "User2", "User3", "User4"], 2) |
1376
|
|
|
self.initializer() |
1377
|
|
|
|
1378
|
|
|
for point_a, point_b in combos: |
1379
|
|
|
results = self.get_path_constrained(point_a, point_b, |
1380
|
|
|
base={"ownership": "B"}, |
1381
|
|
|
flexible={"delay": 50, |
1382
|
|
|
"bandwidth": 100, |
1383
|
|
|
"reliability": 3}) |
1384
|
|
|
for result in results: |
1385
|
|
|
# delay = 50 checks |
1386
|
|
|
if "delay" in result["metrics"]: |
1387
|
|
|
for path in result["paths"]: |
1388
|
|
|
self.assertNotIn("S1:1", path) |
1389
|
|
|
self.assertNotIn("S2:1", path) |
1390
|
|
|
self.assertNotIn("S3:1", path) |
1391
|
|
|
self.assertNotIn("S5:1", path) |
1392
|
|
|
self.assertNotIn("S4:2", path) |
1393
|
|
|
self.assertNotIn("User1:2", path) |
1394
|
|
|
self.assertNotIn("S5:5", path) |
1395
|
|
|
self.assertNotIn("S8:2", path) |
1396
|
|
|
self.assertNotIn("S5:6", path) |
1397
|
|
|
self.assertNotIn("User1:3", path) |
1398
|
|
|
self.assertNotIn("S6:3", path) |
1399
|
|
|
self.assertNotIn("S9:1", path) |
1400
|
|
|
self.assertNotIn("S6:4", path) |
1401
|
|
|
self.assertNotIn("S9:2", path) |
1402
|
|
|
self.assertNotIn("S6:5", path) |
1403
|
|
|
self.assertNotIn("S10:1", path) |
1404
|
|
|
self.assertNotIn("S8:5", path) |
1405
|
|
|
self.assertNotIn("S9:4", path) |
1406
|
|
|
self.assertNotIn("User1:4", path) |
1407
|
|
|
self.assertNotIn("User4:3", path) |
1408
|
|
|
|
1409
|
|
|
# bandwidth = 100 checks |
1410
|
|
|
if "bandwidth" in result["metrics"]: |
1411
|
|
|
for path in result["paths"]: |
1412
|
|
|
self.assertNotIn("S3:1", path) |
1413
|
|
|
self.assertNotIn("S5:1", path) |
1414
|
|
|
self.assertNotIn("User1:4", path) |
1415
|
|
|
self.assertNotIn("User4:3", path) |
1416
|
|
|
|
1417
|
|
|
# reliability = 3 checks |
1418
|
|
|
if "reliability" in result["metrics"]: |
1419
|
|
|
for path in result["paths"]: |
1420
|
|
|
self.assertNotIn("S4:1", path) |
1421
|
|
|
self.assertNotIn("S5:2", path) |
1422
|
|
|
self.assertNotIn("S5:3", path) |
1423
|
|
|
self.assertNotIn("S6:1", path) |
1424
|
|
|
|
1425
|
|
|
# ownership = "B" checks |
1426
|
|
|
self.assertIn("ownership", result["metrics"]) |
1427
|
|
|
for path in result["paths"]: |
1428
|
|
|
self.assertNotIn("S4:1", path) |
1429
|
|
|
self.assertNotIn("S5:2", path) |
1430
|
|
|
self.assertNotIn("S4:2", path) |
1431
|
|
|
self.assertNotIn("User1:2", path) |
1432
|
|
|
self.assertNotIn("S5:4", path) |
1433
|
|
|
self.assertNotIn("S6:2", path) |
1434
|
|
|
self.assertNotIn("S6:5", path) |
1435
|
|
|
self.assertNotIn("S10:1", path) |
1436
|
|
|
self.assertNotIn("S8:6", path) |
1437
|
|
|
self.assertNotIn("S10:2", path) |
1438
|
|
|
self.assertNotIn("S10:3", path) |
1439
|
|
|
self.assertNotIn("User2:1", path) |
1440
|
|
|
|
1441
|
|
|
def test_path10(self): |
1442
|
|
|
"""Tests that TypeError is generated by get_path_constrained |
1443
|
|
|
|
1444
|
|
|
Tests with ownership using an int type rather than string |
1445
|
|
|
""" |
1446
|
|
|
self.initializer() |
1447
|
|
|
|
1448
|
|
|
with self.assertRaises(TypeError): |
1449
|
|
|
self.get_path_constrained( |
1450
|
|
|
"User1", "User2", base={"ownership": 1}) |
1451
|
|
|
|