aboutsummaryrefslogtreecommitdiff
path: root/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in')
-rwxr-xr-xsrc/integration-tests/test_integration_connection_values_tcp_udp_http.py.in124
1 files changed, 0 insertions, 124 deletions
diff --git a/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in b/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in
deleted file mode 100755
index 4e9e72e4e..000000000
--- a/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in
+++ /dev/null
@@ -1,124 +0,0 @@
1#!@PYTHON@
2# This file is part of GNUnet.
3# (C) 2010 Christian Grothoff (and other contributing authors)
4#
5# GNUnet is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published
7# by the Free Software Foundation; either version 2, or (at your
8# option) any later version.
9#
10# GNUnet is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with GNUnet; see the file COPYING. If not, write to the
17# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18# Boston, MA 02111-1307, USA.
19#
20#
21#
22# This test starts 3 peers and expects bootstrap and a connected clique
23#
24# Conditions for successful exit:
25# Both peers have 1 connected peer in transport, core, topology, fs
26
27import sys
28import os
29import subprocess
30import re
31import shutil
32import time
33from gnunet_testing import Peer
34from gnunet_testing import Test
35from gnunet_testing import Check
36from gnunet_testing import Condition
37from gnunet_testing import *
38
39if os.name == "nt":
40 tmp = os.getenv ("TEMP")
41else:
42 tmp = "/tmp"
43
44#definitions
45
46testname = "test_integration_connection_value"
47verbose = True
48check_timeout = 180
49
50
51def cleanup ():
52 shutil.rmtree (os.path.join (tmp, "c_normal_client"), True)
53
54
55def success_cont (check):
56 global success
57 success = True;
58
59def fail_cont (check):
60 global success
61 success= False;
62 check.evaluate(True)
63
64
65def check_connect ():
66 check = Check (test)
67 check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# neighbour entries allocated'))
68 check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# peers connected'))
69 check.add (EqualStatisticsCondition (client, 'core', '# neighbour entries allocated', client, 'core', '# peers connected'))
70 check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'topology', '# peers connected'))
71 check.add (EqualStatisticsCondition (client, 'topology', '# peers connected', client, 'core', '# peers connected'))
72
73 while True:
74 check.reset()
75 res = check.run_once (None, None)
76 print "Values are equal"
77 check.evaluate (False)
78#if (False == res):
79# break
80 time.sleep (5)
81
82#
83# Test execution
84#
85def run ():
86 global success
87 global test
88 global client
89
90
91 success = False
92
93 test = Test ('test_integration_connection_value', verbose)
94
95 client = Peer(test, './confs/c_normal_client_tcp_udp_http.conf');
96 client.start();
97
98 if (client.started == True):
99 test.p ('Peers started, running check')
100 check_connect ()
101
102 client.stop ()
103
104 cleanup ()
105
106 if (success == False):
107 print ('Test failed')
108 return False
109 else:
110 return True
111
112
113try:
114 run ()
115except (KeyboardInterrupt, SystemExit):
116 print 'Test interrupted'
117 client.stop ()
118 cleanup ()
119if (success == False):
120 sys.exit(1)
121else:
122 sys.exit(0)
123
124