Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Commit 3e35d75

Browse files
committed
run all bucket tests with test arguments
1 parent a84f519 commit 3e35d75

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

pyretic/examples/bucket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def test0():
113113
number of packets/bytes displayed by wireshark or tshark with these
114114
filters. They are designed to work under topology and policy updates.
115115
"""
116-
test_bucket = QueryTest(0)
116+
test_bucket = QueryTest('0')
117117
return test_bucket
118118

119119
def test1():

pyretic/tests/all_bucket_tests.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
fails_counts = []
3535

3636
def single_test(fwding, query, filt_funs, topo_name, topo_args,
37-
results, pass_fail):
37+
results, pass_fail, test_nums):
3838
global fails_counts
3939
cmd = ("sudo python pyretic/tests/test_bucket.py " +
4040
"--fwding=" + fwding + ' ' +
@@ -43,7 +43,8 @@ def single_test(fwding, query, filt_funs, topo_name, topo_args,
4343
"--topo_args=" + topo_args + ' ' +
4444
"--tshark_filter_funs=" + filt_funs + ' ' +
4545
"--results_folder=" + results + ' ' +
46-
"--success_file=" + pass_fail)
46+
"--success_file=" + pass_fail + ' ' +
47+
"--test_nums=" + test_nums)
4748
test = subprocess.call(shlex.split(cmd))
4849
pf_file = os.path.join(results, pass_fail)
4950
f = open(pf_file, 'r')
@@ -70,13 +71,22 @@ def generic_topo_tests(topo_name, topo_args, fwding_pols):
7071
'filt_test5',
7172
'filt_test6',
7273
'filt_test7']
74+
test_nums = ['0',
75+
'1',
76+
'2.b0,2.b1',
77+
'3.b0,3.b1',
78+
'4.b0,4.b1,4.b2',
79+
'5',
80+
'6',
81+
'7']
7382
results = './pyretic/evaluations/results'
7483
pass_fail = 'pass-fail.txt'
7584

7685
for fwding in fwding_pols:
7786
for i in range(0, len(query_pols)):
7887
res = single_test(fwding, query_pols[i], filt_funs[i],
79-
topo_name, topo_args, results, pass_fail)
88+
topo_name, topo_args, results, pass_fail,
89+
test_nums[i])
8090
test_name = "%s %s on %s" % (query_pols[i], fwding, topo_name)
8191
if res:
8292
print "===== TEST %s PASSED =====" % test_name

0 commit comments

Comments
 (0)