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.
20 # Testcase for gnunet-peerinfo
26 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf')
27 pinfo.expect ('Timeout trying to interact with PEERINFO service\r')
28 pinfo.expect (pexpect.EOF);
29 os.system ('rm -rf /tmp/gnunet-test-peerinfo/')
30 os.system ('gnunet-arm -sq -c test_gnunet_peerinfo_data.conf')
33 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -s')
34 pinfo.expect (re.compile ("I am peer `.*\'.\r"));
35 pinfo.expect (pexpect.EOF);
37 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -qs')
38 pinfo.expect (re.compile (".......................................................................................................\r"));
39 pinfo.expect (pexpect.EOF);
41 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf invalid')
42 pinfo.expect (re.compile ("Invalid command line argument `invalid\'\r"));
43 pinfo.expect (pexpect.EOF);
46 os.system ('gnunet-arm -q -i transport -c test_gnunet_peerinfo_data.conf')
48 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf')
49 pinfo.expect (re.compile ("Peer `.*\' with trust *0\r"));
50 pinfo.expect (re.compile (" *localhost:24357\r"));
51 pinfo.expect (pexpect.EOF);
53 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -n')
54 pinfo.expect (re.compile ("Peer `.*\' with trust *0\r"));
55 pinfo.expect (re.compile (" *127..*:24357\r"));
56 pinfo.expect (pexpect.EOF);
58 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -qs')
62 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 4 ' + pid)
63 pinfo.expect (re.compile ("Peer `" + pid + "\' with trust *4\r"));
64 pinfo.expect (pexpect.EOF);
66 pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -- -4 ' + pid)
67 pinfo.expect (re.compile ("Peer `" + pid + "\' with trust *0\r"));
68 pinfo.expect (pexpect.EOF);
71 os.system ('gnunet-arm -c test_gnunet_peerinfo_data.conf -eq')
72 os.system ('rm -rf /tmp/gnunet-test-peerinfo/')