From ac01064f2f336b9903164e11450bb46d4c5c04ad Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 15 Dec 2011 17:03:59 +0000 Subject: improved tests --- .../test_integration_bootstrap_and_connect.py.in | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/integration-tests/test_integration_bootstrap_and_connect.py.in') 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 * #definitions testname = "test_integration_bootstrap_and_connect" -verbose = True -success = False +verbose = False timeout = 100 @@ -55,16 +54,18 @@ def cleanup (): shutil.rmtree ("/tmp/c_bootstrap_server/", True) shutil.rmtree ("/tmp/c_no_nat_client/", True) -def success (): +def success_cont (check): global success success = True; -def fail (): + +def fail_cont (check): global success success= False; + check.eval(True) def check (): - check = Check () + check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) @@ -78,11 +79,12 @@ def check (): check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) - check.run_blocking (10, success, fail) + check.run_blocking (10, success_cont, fail_cont) # # Test execution # +success = False test = Test ('test_integration_bootstrap_and_connect.py', verbose) @@ -93,6 +95,7 @@ client = Peer(test, './confs/c_no_nat_client.conf'); client.start(); if ((client.started == True) and (server.started == True)): + test.p ('Peers started, running check') check () server.stop () -- cgit v1.2.3