diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-15 17:03:59 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-15 17:03:59 +0000 |
commit | ac01064f2f336b9903164e11450bb46d4c5c04ad (patch) | |
tree | 944056458bea3529042287fdec40a65f78802824 /src/integration-tests/test_integration_bootstrap_and_connect.py.in | |
parent | 9af43c04be4bb3df805b07e42e04e4a5e70453d8 (diff) | |
download | gnunet-ac01064f2f336b9903164e11450bb46d4c5c04ad.tar.gz gnunet-ac01064f2f336b9903164e11450bb46d4c5c04ad.zip |
improved tests
Diffstat (limited to 'src/integration-tests/test_integration_bootstrap_and_connect.py.in')
-rwxr-xr-x | src/integration-tests/test_integration_bootstrap_and_connect.py.in | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/integration-tests/test_integration_bootstrap_and_connect.py.in b/src/integration-tests/test_integration_bootstrap_and_connect.py.in index 38746544c..581179f99 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in | |||
@@ -42,8 +42,7 @@ from gnunet_testing import * | |||
42 | #definitions | 42 | #definitions |
43 | 43 | ||
44 | testname = "test_integration_bootstrap_and_connect" | 44 | testname = "test_integration_bootstrap_and_connect" |
45 | verbose = True | 45 | verbose = False |
46 | success = False | ||
47 | timeout = 100 | 46 | timeout = 100 |
48 | 47 | ||
49 | 48 | ||
@@ -55,16 +54,18 @@ def cleanup (): | |||
55 | shutil.rmtree ("/tmp/c_bootstrap_server/", True) | 54 | shutil.rmtree ("/tmp/c_bootstrap_server/", True) |
56 | shutil.rmtree ("/tmp/c_no_nat_client/", True) | 55 | shutil.rmtree ("/tmp/c_no_nat_client/", True) |
57 | 56 | ||
58 | def success (): | 57 | def success_cont (check): |
59 | global success | 58 | global success |
60 | success = True; | 59 | success = True; |
61 | def fail (): | 60 | |
61 | def fail_cont (check): | ||
62 | global success | 62 | global success |
63 | success= False; | 63 | success= False; |
64 | check.eval(True) | ||
64 | 65 | ||
65 | def check (): | 66 | def check (): |
66 | 67 | ||
67 | check = Check () | 68 | check = Check (test) |
68 | check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) | 69 | check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) |
69 | check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) | 70 | check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) |
70 | check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) | 71 | check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) |
@@ -78,11 +79,12 @@ def check (): | |||
78 | check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) | 79 | check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) |
79 | check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) | 80 | check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) |
80 | 81 | ||
81 | check.run_blocking (10, success, fail) | 82 | check.run_blocking (10, success_cont, fail_cont) |
82 | 83 | ||
83 | # | 84 | # |
84 | # Test execution | 85 | # Test execution |
85 | # | 86 | # |
87 | success = False | ||
86 | 88 | ||
87 | test = Test ('test_integration_bootstrap_and_connect.py', verbose) | 89 | test = Test ('test_integration_bootstrap_and_connect.py', verbose) |
88 | 90 | ||
@@ -93,6 +95,7 @@ client = Peer(test, './confs/c_no_nat_client.conf'); | |||
93 | client.start(); | 95 | client.start(); |
94 | 96 | ||
95 | if ((client.started == True) and (server.started == True)): | 97 | if ((client.started == True) and (server.started == True)): |
98 | test.p ('Peers started, running check') | ||
96 | check () | 99 | check () |
97 | 100 | ||
98 | server.stop () | 101 | server.stop () |