diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-16 13:43:06 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-16 13:43:06 +0000 |
commit | 5a8f88e1745a184039f07382c4b1c757011ca4be (patch) | |
tree | 6cfe2a3ab532a45a6372d86d877d8ab66cff331a /src | |
parent | 4997b98b69d53d14085f0da4d7d4b002f3d59100 (diff) | |
download | gnunet-5a8f88e1745a184039f07382c4b1c757011ca4be.tar.gz gnunet-5a8f88e1745a184039f07382c4b1c757011ca4be.zip |
Diffstat (limited to 'src')
4 files changed, 61 insertions, 54 deletions
diff --git a/src/integration-tests/Makefile.am b/src/integration-tests/Makefile.am index e98ba3242..1e5686bf8 100644 --- a/src/integration-tests/Makefile.am +++ b/src/integration-tests/Makefile.am | |||
@@ -20,6 +20,7 @@ if HAVE_PYTHON_PEXPECT | |||
20 | check_SCRIPTS = \ | 20 | check_SCRIPTS = \ |
21 | test_integration_bootstrap_and_connect.py \ | 21 | test_integration_bootstrap_and_connect.py \ |
22 | test_integration_disconnect.py \ | 22 | test_integration_disconnect.py \ |
23 | test_integration_restart.py \ | ||
23 | test_integration_clique.py | 24 | test_integration_clique.py |
24 | endif | 25 | endif |
25 | 26 | ||
@@ -42,6 +43,10 @@ test_integration_bootstrap_and_connect.py: test_integration_bootstrap_and_connec | |||
42 | test_integration_disconnect.py: test_integration_disconnect.py.in Makefile | 43 | test_integration_disconnect.py: test_integration_disconnect.py.in Makefile |
43 | $(do_subst) < $(srcdir)/test_integration_disconnect.py.in > test_integration_disconnect.py | 44 | $(do_subst) < $(srcdir)/test_integration_disconnect.py.in > test_integration_disconnect.py |
44 | chmod +x test_integration_disconnect.py | 45 | chmod +x test_integration_disconnect.py |
46 | |||
47 | test_integration_restart.py: test_integration_restart.py.in Makefile | ||
48 | $(do_subst) < $(srcdir)/test_integration_restart.py.in > test_integration_restart.py | ||
49 | chmod +x test_integration_restart.py | ||
45 | 50 | ||
46 | test_integration_clique.py: test_integration_clique.py.in Makefile | 51 | test_integration_clique.py: test_integration_clique.py.in Makefile |
47 | $(do_subst) < $(srcdir)/test_integration_clique.py.in > test_integration_clique.py | 52 | $(do_subst) < $(srcdir)/test_integration_clique.py.in > test_integration_clique.py |
@@ -50,7 +55,8 @@ test_integration_clique.py: test_integration_clique.py.in Makefile | |||
50 | EXTRA_DIST = \ | 55 | EXTRA_DIST = \ |
51 | gnunet_testing.py.in \ | 56 | gnunet_testing.py.in \ |
52 | test_integration_bootstrap_and_connect.py.in \ | 57 | test_integration_bootstrap_and_connect.py.in \ |
53 | test_integration_disconnect.py.in \ | 58 | test_integration_disconnect.py.in \ |
59 | test_integration_restart.py.in \ | ||
54 | test_integration_clique.py.in | 60 | test_integration_clique.py.in |
55 | 61 | ||
56 | CLEANFILES = \ | 62 | CLEANFILES = \ |
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 a8aff73d7..7738c72d8 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in | |||
@@ -67,14 +67,10 @@ def success_cont (check): | |||
67 | 67 | ||
68 | def fail_cont (check): | 68 | def fail_cont (check): |
69 | global success | 69 | global success |
70 | success= False; | 70 | success = False; |
71 | check.eval(True) | 71 | check.eval(True) |
72 | 72 | ||
73 | def check (): | 73 | def check (): |
74 | global test | ||
75 | global server | ||
76 | global client | ||
77 | global success | ||
78 | check = Check (test) | 74 | check = Check (test) |
79 | check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) | 75 | check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) |
80 | check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) | 76 | check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) |
@@ -96,36 +92,34 @@ def check (): | |||
96 | # | 92 | # |
97 | 93 | ||
98 | def run (): | 94 | def run (): |
99 | global test | 95 | global success |
100 | global server | 96 | global test |
101 | global client | 97 | global server |
102 | global success | 98 | global client |
103 | 99 | ||
104 | success = False | 100 | success = False |
105 | test = Test ('test_integration_bootstrap_and_connect.py', verbose) | 101 | test = Test ('test_integration_bootstrap_and_connect.py', verbose) |
106 | 102 | ||
107 | server = Peer(test, './confs/c_bootstrap_server.conf'); | 103 | server = Peer(test, './confs/c_bootstrap_server.conf'); |
108 | client = Peer(test, './confs/c_no_nat_client.conf'); | 104 | client = Peer(test, './confs/c_no_nat_client.conf'); |
109 | 105 | ||
110 | server.start(); | 106 | server.start(); |
111 | client.start(); | 107 | client.start(); |
112 | 108 | ||
113 | if ((client.started == True) and (server.started == True)): | 109 | if ((client.started == True) and (server.started == True)): |
114 | test.p ('Peers started, running check') | 110 | test.p ('Peers started, running check') |
115 | time.sleep(5) | 111 | time.sleep(5) |
116 | check () | 112 | check () |
117 | 113 | server.stop () | |
118 | print 'stop in run' | 114 | client.stop () |
119 | server.stop () | 115 | |
120 | client.stop () | 116 | cleanup () |
121 | 117 | ||
122 | cleanup () | 118 | if (success == False): |
123 | 119 | print ('Test failed') | |
124 | if (success == False): | 120 | return False |
125 | print ('Test failed') | 121 | else: |
126 | return False | 122 | return True |
127 | else: | ||
128 | return True | ||
129 | 123 | ||
130 | try: | 124 | try: |
131 | run () | 125 | run () |
@@ -134,5 +128,8 @@ except (KeyboardInterrupt, SystemExit): | |||
134 | server.stop () | 128 | server.stop () |
135 | client.stop () | 129 | client.stop () |
136 | cleanup () | 130 | cleanup () |
137 | sys.exit(success) | 131 | if (success == False): |
132 | sys.exit(1) | ||
133 | else: | ||
134 | sys.exit(0) | ||
138 | \ No newline at end of file | 135 | \ No newline at end of file |
diff --git a/src/integration-tests/test_integration_clique.py.in b/src/integration-tests/test_integration_clique.py.in index 2c9a569f1..faf66a7d2 100755 --- a/src/integration-tests/test_integration_clique.py.in +++ b/src/integration-tests/test_integration_clique.py.in | |||
@@ -145,11 +145,12 @@ def check_connect (): | |||
145 | # Test execution | 145 | # Test execution |
146 | # | 146 | # |
147 | def run (): | 147 | def run (): |
148 | global test | 148 | global success |
149 | global server | 149 | global test |
150 | global client | 150 | global server |
151 | global success | 151 | global client |
152 | 152 | global client2 | |
153 | |||
153 | success = False | 154 | success = False |
154 | 155 | ||
155 | test = Test ('test_integration_disconnect', verbose) | 156 | test = Test ('test_integration_disconnect', verbose) |
@@ -172,12 +173,12 @@ def run (): | |||
172 | client2.stop () | 173 | client2.stop () |
173 | 174 | ||
174 | cleanup () | 175 | cleanup () |
175 | 176 | ||
176 | if (success == False): | 177 | if (success == False): |
177 | print ('Test failed') | 178 | print ('Test failed') |
178 | return False | 179 | return False |
179 | else: | 180 | else: |
180 | return True | 181 | return True |
181 | 182 | ||
182 | 183 | ||
183 | try: | 184 | try: |
@@ -188,6 +189,9 @@ except (KeyboardInterrupt, SystemExit): | |||
188 | client.stop () | 189 | client.stop () |
189 | client2.stop () | 190 | client2.stop () |
190 | cleanup () | 191 | cleanup () |
191 | sys.exit(success) | 192 | if (success == False): |
193 | sys.exit(1) | ||
194 | else: | ||
195 | sys.exit(0) | ||
192 | 196 | ||
193 | 197 | ||
diff --git a/src/integration-tests/test_integration_disconnect.py.in b/src/integration-tests/test_integration_disconnect.py.in index f708aee1d..d055b6907 100755 --- a/src/integration-tests/test_integration_disconnect.py.in +++ b/src/integration-tests/test_integration_disconnect.py.in | |||
@@ -109,14 +109,11 @@ def check_connect (): | |||
109 | # Test execution | 109 | # Test execution |
110 | # | 110 | # |
111 | 111 | ||
112 | # | ||
113 | # Test execution | ||
114 | # | ||
115 | def run (): | 112 | def run (): |
113 | global success | ||
116 | global test | 114 | global test |
117 | global server | 115 | global server |
118 | global client | 116 | global client |
119 | global success | ||
120 | 117 | ||
121 | success = False | 118 | success = False |
122 | 119 | ||
@@ -152,5 +149,8 @@ except (KeyboardInterrupt, SystemExit): | |||
152 | server.stop () | 149 | server.stop () |
153 | client.stop () | 150 | client.stop () |
154 | cleanup () | 151 | cleanup () |
155 | sys.exit(success) | 152 | if (success == False): |
153 | sys.exit(1) | ||
154 | else: | ||
155 | sys.exit(0) | ||
156 | \ No newline at end of file | 156 | \ No newline at end of file |