diff options
Diffstat (limited to 'src/integration-tests/test_integration_disconnect.py.in')
-rwxr-xr-x | src/integration-tests/test_integration_disconnect.py.in | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/src/integration-tests/test_integration_disconnect.py.in b/src/integration-tests/test_integration_disconnect.py.in index 0397fafd2..f708aee1d 100755 --- a/src/integration-tests/test_integration_disconnect.py.in +++ b/src/integration-tests/test_integration_disconnect.py.in | |||
@@ -43,7 +43,7 @@ from gnunet_testing import * | |||
43 | #definitions | 43 | #definitions |
44 | 44 | ||
45 | testname = "test_integration_disconnect" | 45 | testname = "test_integration_disconnect" |
46 | verbose = False | 46 | verbose = True |
47 | check_timeout = 30 | 47 | check_timeout = 30 |
48 | 48 | ||
49 | 49 | ||
@@ -112,28 +112,45 @@ def check_connect (): | |||
112 | # | 112 | # |
113 | # Test execution | 113 | # Test execution |
114 | # | 114 | # |
115 | success = False | 115 | def run (): |
116 | 116 | global test | |
117 | test = Test ('test_integration_disconnect', verbose) | 117 | global server |
118 | 118 | global client | |
119 | server = Peer(test, './confs/c_bootstrap_server.conf'); | 119 | global success |
120 | server.start(); | ||
121 | |||
122 | client = Peer(test, './confs/c_no_nat_client.conf'); | ||
123 | client.start(); | ||
124 | |||
125 | |||
126 | if ((client.started == True) and (server.started == True)): | ||
127 | test.p ('Peers started, running check') | ||
128 | check_connect () | ||
129 | 120 | ||
130 | server.stop () | 121 | success = False |
131 | client.stop () | 122 | |
132 | 123 | test = Test ('test_integration_disconnect', verbose) | |
133 | cleanup () | 124 | |
125 | server = Peer(test, './confs/c_bootstrap_server.conf'); | ||
126 | server.start(); | ||
127 | |||
128 | client = Peer(test, './confs/c_no_nat_client.conf'); | ||
129 | client.start(); | ||
130 | |||
131 | |||
132 | if ((client.started == True) and (server.started == True)): | ||
133 | test.p ('Peers started, running check') | ||
134 | check_connect () | ||
135 | |||
136 | server.stop () | ||
137 | client.stop () | ||
138 | |||
139 | cleanup () | ||
140 | |||
141 | if (success == False): | ||
142 | print ('Test failed') | ||
143 | return True | ||
144 | else: | ||
145 | return False | ||
134 | 146 | ||
135 | if (success == False): | 147 | |
136 | print ('Test failed') | 148 | try: |
137 | exit (1) | 149 | run () |
138 | else: | 150 | except (KeyboardInterrupt, SystemExit): |
139 | exit (0) | 151 | print 'Test interrupted' |
152 | server.stop () | ||
153 | client.stop () | ||
154 | cleanup () | ||
155 | sys.exit(success) | ||
156 | \ No newline at end of file | ||