diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-16 12:25:28 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-16 12:25:28 +0000 |
commit | 4997b98b69d53d14085f0da4d7d4b002f3d59100 (patch) | |
tree | 95dc9c487b9a23124f7aae48409d18fa6c20b574 /src/integration-tests/test_integration_clique.py.in | |
parent | 17f94e7fc0dfabbbd9868b72f957209549a16b5a (diff) | |
download | gnunet-4997b98b69d53d14085f0da4d7d4b002f3d59100.tar.gz gnunet-4997b98b69d53d14085f0da4d7d4b002f3d59100.zip |
added support for interupting a test
Diffstat (limited to 'src/integration-tests/test_integration_clique.py.in')
-rwxr-xr-x | src/integration-tests/test_integration_clique.py.in | 71 |
1 files changed, 44 insertions, 27 deletions
diff --git a/src/integration-tests/test_integration_clique.py.in b/src/integration-tests/test_integration_clique.py.in index ce254ca7b..2c9a569f1 100755 --- a/src/integration-tests/test_integration_clique.py.in +++ b/src/integration-tests/test_integration_clique.py.in | |||
@@ -144,33 +144,50 @@ def check_connect (): | |||
144 | # | 144 | # |
145 | # Test execution | 145 | # Test execution |
146 | # | 146 | # |
147 | 147 | def run (): | |
148 | success = False | 148 | global test |
149 | 149 | global server | |
150 | test = Test ('test_integration_disconnect', verbose) | 150 | global client |
151 | 151 | global success | |
152 | server = Peer(test, './confs/c_bootstrap_server.conf'); | ||
153 | server.start(); | ||
154 | |||
155 | client = Peer(test, './confs/c_no_nat_client.conf'); | ||
156 | client.start(); | ||
157 | |||
158 | client2 = Peer(test, './confs/c_no_nat_client_2.conf'); | ||
159 | client2.start(); | ||
160 | |||
161 | if ((client.started == True) and (client2.started == True) and (server.started == True)): | ||
162 | test.p ('Peers started, running check') | ||
163 | check_connect () | ||
164 | 152 | ||
165 | server.stop () | 153 | success = False |
166 | client.stop () | 154 | |
167 | client2.stop () | 155 | test = Test ('test_integration_disconnect', verbose) |
156 | |||
157 | server = Peer(test, './confs/c_bootstrap_server.conf'); | ||
158 | server.start(); | ||
159 | |||
160 | client = Peer(test, './confs/c_no_nat_client.conf'); | ||
161 | client.start(); | ||
162 | |||
163 | client2 = Peer(test, './confs/c_no_nat_client_2.conf'); | ||
164 | client2.start(); | ||
165 | |||
166 | if ((client.started == True) and (client2.started == True) and (server.started == True)): | ||
167 | test.p ('Peers started, running check') | ||
168 | check_connect () | ||
169 | |||
170 | server.stop () | ||
171 | client.stop () | ||
172 | client2.stop () | ||
173 | |||
174 | cleanup () | ||
175 | |||
176 | if (success == False): | ||
177 | print ('Test failed') | ||
178 | return False | ||
179 | else: | ||
180 | return True | ||
168 | 181 | ||
169 | cleanup () | 182 | |
170 | 183 | try: | |
171 | if (success == False): | 184 | run () |
172 | print ('Test failed') | 185 | except (KeyboardInterrupt, SystemExit): |
173 | exit (1) | 186 | print 'Test interrupted' |
174 | else: | 187 | server.stop () |
175 | exit (0) | 188 | client.stop () |
189 | client2.stop () | ||
190 | cleanup () | ||
191 | sys.exit(success) | ||
192 | |||
176 | 193 | ||