aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_gnunet_fs_psd.py.in
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2010-04-30 05:35:52 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2010-04-30 05:35:52 +0000
commitb24b1e26e24f18c77035f4255dee90757b08365b (patch)
treee651fe85c06357ee0db3e5b5aceaf320c1b23184 /src/fs/test_gnunet_fs_psd.py.in
parentefbd30b934fa773634dd2b2e18e2824795973bc7 (diff)
downloadgnunet-b24b1e26e24f18c77035f4255dee90757b08365b.tar.gz
gnunet-b24b1e26e24f18c77035f4255dee90757b08365b.zip
Move python test scripts to .py.in and sed in the correct python path.
Diffstat (limited to 'src/fs/test_gnunet_fs_psd.py.in')
-rwxr-xr-xsrc/fs/test_gnunet_fs_psd.py.in48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/fs/test_gnunet_fs_psd.py.in b/src/fs/test_gnunet_fs_psd.py.in
new file mode 100755
index 000000000..d66b8b994
--- /dev/null
+++ b/src/fs/test_gnunet_fs_psd.py.in
@@ -0,0 +1,48 @@
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# Testcase for file-sharing command-line tools (publish, search, download)
21import pexpect
22import os
23import signal
24import re
25
26os.system ('rm -rf /tmp/gnunet-test-fs-py-psd/')
27os.system ('gnunet-arm -sq -c test_gnunet_fs_psd_data.conf')
28try:
29# first, basic publish-search-download run
30 pub = pexpect.spawn ('gnunet-publish -n -c test_gnunet_fs_psd_data.conf -m "description:The GNU Public License" -k gpl ../../COPYING')
31 pub.expect ('Publishing `../../COPYING\' done.\r')
32 pub.expect ("URI is `gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147'.\r")
33 pub.expect (pexpect.EOF)
34
35 search = pexpect.spawn ('gnunet-search -V -c test_gnunet_fs_psd_data.conf gpl')
36 search.expect ("gnunet-download -o \"COPYING\" gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147\r")
37 search.expect (re.compile (" *description: The GNU Public License\r"));
38 search.kill (signal.SIGTERM)
39 search.expect (pexpect.EOF)
40
41 down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_psd_data.conf -o \"COPYING\" gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147')
42 down.expect (re.compile ("Downloading `COPYING\' done \(.*\).\r"));
43 down.expect (pexpect.EOF);
44 os.system ('rm COPYING');
45
46finally:
47 os.system ('gnunet-arm -c test_gnunet_fs_psd_data.conf -eq')
48 os.system ('rm -rf /tmp/gnunet-test-fs-py-psd/')