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.
28 # This test tests if a fresh peer bootstraps from a hostlist server and then
29 # successfully connects to the server
39 testname = "test_integration_bootstrap_and_connect"
45 gnunet_pyexpect_dir = os.path.join (srcdir, "contrib")
46 if gnunet_pyexpect_dir not in sys.path:
47 sys.path.append (gnunet_pyexpect_dir)
49 from gnunet_pyexpect import pexpect
51 if os.name == 'posix':
52 gnunetarm = 'gnunet-arm'
54 gnunetarm = 'gnunet-arm.exe'
57 shutil.rmtree (os.path.join (os.getenv ("TEMP"), testname), True)
59 shutil.rmtree ("/tmp/" + testname, True)
61 vpfrint ("Running " + testname)
67 vpfrint ("Starting bootstrap server & client")
69 server = subprocess.Popen ([gnunetarm, '-sq', '-c', './confs/c_bootstrap_server.conf'])
72 print "Can not start bootstrap server, exiting..."
75 client = subprocess.Popen ([gnunetarm, '-sq', '-c', 'confs/c_no_nat_client.conf'])
78 print "Can not start bootstrap client, exiting..."
80 vpfrint ("Bootstrap server & client started")
87 vpfrint ("Shutting down bootstrap server")
89 server = subprocess.Popen ([gnunetarm, '-eq', '-c', './confs/c_bootstrap_server.conf'])
92 print "Can not stop bootstrap server, exiting..."
95 client = subprocess.Popen ([gnunetarm, '-eq', '-c', 'confs/c_no_nat_client.conf'])
98 print "Can not stop bootstrap client, exiting..."
100 vpfrint ("Bootstrap server & client stopped")
105 shutil.rmtree (os.path.join (os.getenv ("TEMP"), "gnunet-test-fs-py-ns"), True)
107 shutil.rmtree ("/tmp/gnunet-test-fs-py-ns", True)