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/integration-tests/test_integration_bootstrap_and_connect.py.in | |
parent | 4997b98b69d53d14085f0da4d7d4b002f3d59100 (diff) | |
download | gnunet-5a8f88e1745a184039f07382c4b1c757011ca4be.tar.gz gnunet-5a8f88e1745a184039f07382c4b1c757011ca4be.zip |
Diffstat (limited to 'src/integration-tests/test_integration_bootstrap_and_connect.py.in')
-rwxr-xr-x | src/integration-tests/test_integration_bootstrap_and_connect.py.in | 69 |
1 files changed, 33 insertions, 36 deletions
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 |