2 # This file is part of GNUnet.
3 # (C) 2010 Christian Grothoff (and other contributing authors)
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.
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.
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.
22 # This test starts 3 peers and expects bootstrap and a connected clique
24 # Conditions for successful exit:
25 # Both peers have 1 connected peer in transport, core, topology, fs
33 from gnunet_testing import Peer
34 from gnunet_testing import Test
35 from gnunet_testing import Check
36 from gnunet_testing import Condition
37 from gnunet_testing import *
40 tmp = os.getenv ("TEMP")
46 testname = "test_integration_connection_value"
52 shutil.rmtree (os.path.join (tmp, "c_normal_client"), True)
55 def success_cont (check):
59 def fail_cont (check):
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'))
75 res = check.run_once (None, None)
76 print "Values are equal"
77 check.evaluate (False)
93 test = Test ('test_integration_connection_value', verbose)
95 client = Peer(test, './confs/c_normal_client_tcp.conf');
98 if (client.started == True):
99 test.p ('Peers started, running check')
106 if (success == False):
107 print ('Test failed')
115 except (KeyboardInterrupt, SystemExit):
116 print 'Test interrupted'
119 if (success == False):