aboutsummaryrefslogtreecommitdiff
path: root/src/integration-tests/test_integration_reconnect_nat.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/integration-tests/test_integration_reconnect_nat.py.in')
-rwxr-xr-xsrc/integration-tests/test_integration_reconnect_nat.py.in25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/integration-tests/test_integration_reconnect_nat.py.in b/src/integration-tests/test_integration_reconnect_nat.py.in
index 45626d50d..751a0484b 100755
--- a/src/integration-tests/test_integration_reconnect_nat.py.in
+++ b/src/integration-tests/test_integration_reconnect_nat.py.in
@@ -32,7 +32,6 @@ from gnunet_testing import Check
32from gnunet_testing import Condition 32from gnunet_testing import Condition
33from gnunet_testing import * 33from gnunet_testing import *
34 34
35
36# 35#
37# This test tests if a fresh peer bootstraps from a hostlist server and then 36# This test tests if a fresh peer bootstraps from a hostlist server and then
38# successfully connects to the server. When both peers are connected 37# successfully connects to the server. When both peers are connected
@@ -43,7 +42,6 @@ from gnunet_testing import *
43 42
44# definitions 43# definitions
45 44
46
47testname = "test_integration_restart" 45testname = "test_integration_restart"
48verbose = True 46verbose = True
49check_timeout = 180 47check_timeout = 180
@@ -82,7 +80,7 @@ def cleanup():
82 retries = 10 80 retries = 10
83 path = os.path.join(tmp, "c_nat_client") 81 path = os.path.join(tmp, "c_nat_client")
84 test.p("Removing " + path) 82 test.p("Removing " + path)
85 while((os.path.exists(path)) and(retries > 0)): 83 while ((os.path.exists(path)) and (retries > 0)):
86 shutil.rmtree((path), False, cleanup_onerror) 84 shutil.rmtree((path), False, cleanup_onerror)
87 time.sleep(1) 85 time.sleep(1)
88 retries -= 1 86 retries -= 1
@@ -91,18 +89,18 @@ def cleanup():
91 89
92 90
93def success_restart_cont(check): 91def success_restart_cont(check):
94 global success 92 global success
95 print('Peers connected successfully after restart') 93 print('Peers connected successfully after restart')
96 server.stop() 94 server.stop()
97 client.stop() 95 client.stop()
98 success = True 96 success = True
99 97
100 98
101def fail_restart_cont(check): 99def fail_restart_cont(check):
102 global success 100 global success
103 success = False 101 success = False
104 print('Peers failed to connect after restart') 102 print('Peers failed to connect after restart')
105 check.evaluate(True) 103 check.evaluate(True)
106 104
107 105
108def success_connect_cont(check): 106def success_connect_cont(check):
@@ -151,6 +149,7 @@ def check_connect():
151 149
152 check.run_blocking(check_timeout, success_connect_cont, fail_connect_cont) 150 check.run_blocking(check_timeout, success_connect_cont, fail_connect_cont)
153 151
152
154# 153#
155# Test execution 154# Test execution
156# 155#
@@ -227,7 +226,7 @@ def run():
227 226
228try: 227try:
229 run() 228 run()
230except(KeyboardInterrupt, SystemExit): 229except (KeyboardInterrupt, SystemExit):
231 print('Test interrupted') 230 print('Test interrupted')
232 server.stop() 231 server.stop()
233 client.stop() 232 client.stop()