aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo-tool/test_gnunet_peerinfo.py.in
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-19 08:02:47 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-19 08:02:47 +0000
commitebd2cf0e07c0dca2cc81282e8d7d1eb2a9dcffb0 (patch)
tree2107c29be1b9e7c31f9ed002f8fb6c7622bbd51b /src/peerinfo-tool/test_gnunet_peerinfo.py.in
parent92ab0a2e11b3b3c5dec664383370d0dab3c30974 (diff)
downloadgnunet-ebd2cf0e07c0dca2cc81282e8d7d1eb2a9dcffb0.tar.gz
gnunet-ebd2cf0e07c0dca2cc81282e8d7d1eb2a9dcffb0.zip
-use testing to create hostkey during peerinfo tool test
Diffstat (limited to 'src/peerinfo-tool/test_gnunet_peerinfo.py.in')
-rwxr-xr-xsrc/peerinfo-tool/test_gnunet_peerinfo.py.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/peerinfo-tool/test_gnunet_peerinfo.py.in b/src/peerinfo-tool/test_gnunet_peerinfo.py.in
index bff673e3b..81acb3c8b 100755
--- a/src/peerinfo-tool/test_gnunet_peerinfo.py.in
+++ b/src/peerinfo-tool/test_gnunet_peerinfo.py.in
@@ -35,21 +35,27 @@ from gnunet_pyexpect import pexpect
35if os.name == 'posix': 35if os.name == 'posix':
36 peerinfo = 'gnunet-peerinfo' 36 peerinfo = 'gnunet-peerinfo'
37 gnunetarm = 'gnunet-arm' 37 gnunetarm = 'gnunet-arm'
38 gnunettesting = 'gnunet-testing'
38elif os.name == 'nt': 39elif os.name == 'nt':
39 peerinfo = 'gnunet-peerinfo.exe' 40 peerinfo = 'gnunet-peerinfo.exe'
40 gnunetarm = 'gnunet-arm.exe' 41 gnunetarm = 'gnunet-arm.exe'
41 42 gnunettesting = 'gnunet-testing.exe'
42
43 43
44pinfo = pexpect () 44pinfo = pexpect ()
45pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-L', 'ERROR'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 45pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-L', 'ERROR'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
46pinfo.expect ("stdout", re.compile (r'Error in communication with PEERINFO service: Timeout transmitting iteration request to `PEERINFO\' service.\r?\n')) 46pinfo.expect ("stdout", re.compile (r'Error in communication with PEERINFO service: Timeout transmitting iteration request to `PEERINFO\' service.\r?\n'))
47pinfo.expect ("stdout", "EOF") 47pinfo.expect ("stdout", "EOF")
48 48
49
49if os.name == "nt": 50if os.name == "nt":
50 shutil.rmtree (os.path.join (os.getenv ("TEMP"), "gnunet-test-peerinfo"), True) 51 shutil.rmtree (os.path.join (os.getenv ("TEMP"), "gnunet-test-peerinfo"), True)
51else: 52else:
52 shutil.rmtree ("/tmp/gnunet-test-peerinfo", True) 53 shutil.rmtree ("/tmp/gnunet-test-peerinfo", True)
54
55# create hostkey via testing lib
56hkk = subprocess.Popen ([gnunettesting, '-n 1', '-k', '/tmp/gnunet-test-peerinfo/.hostkey'])
57hkk.communicate ()
58
53arm = subprocess.Popen ([gnunetarm, '-sq', '-c', 'test_gnunet_peerinfo_data.conf']) 59arm = subprocess.Popen ([gnunetarm, '-sq', '-c', 'test_gnunet_peerinfo_data.conf'])
54arm.communicate () 60arm.communicate ()
55 61