aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_gnunet_fs_rec.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_rec.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_rec.py.in')
-rwxr-xr-xsrc/fs/test_gnunet_fs_rec.py.in52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/fs/test_gnunet_fs_rec.py.in b/src/fs/test_gnunet_fs_rec.py.in
new file mode 100755
index 000000000..145b8e3b4
--- /dev/null
+++ b/src/fs/test_gnunet_fs_rec.py.in
@@ -0,0 +1,52 @@
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 (recursive publishing & download)
21import pexpect
22import os
23import signal
24import re
25
26os.system ('rm -rf /tmp/gnunet-test-fs-py-rec/')
27os.system ('gnunet-arm -sq -c test_gnunet_fs_rec_data.conf')
28os.system ('tar xfz test_gnunet_fs_rec_data.tgz')
29try:
30 pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_rec_data.conf -d -k testdir dir/')
31 pub.expect ('Publishing `dir/\' done.\r')
32 pub.expect ("URI is `gnunet://fs/chk/P5BPKNHH7CECDQA1A917G5EB67PPVG99NVO5QMJ8AJP2C02NM8O1ALNGOJPLLO0RMST0FNM0ATJV95PDAGATHDGH7AGIK2N3O0OOC70.OSG2JS3JDSI0AV8LMOL9MKPJ70DNG2RBL2CBTUCHK563VEM7L00RN8I2K0VPB459JRVBFOIKJG72LIQPDP9RFCVEVI37BUD76RJ3KK0.20169\'.")
33 pub.expect (pexpect.EOF)
34
35 down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_rec_data.conf -R -o rdir.gnd gnunet://fs/chk/P5BPKNHH7CECDQA1A917G5EB67PPVG99NVO5QMJ8AJP2C02NM8O1ALNGOJPLLO0RMST0FNM0ATJV95PDAGATHDGH7AGIK2N3O0OOC70.OSG2JS3JDSI0AV8LMOL9MKPJ70DNG2RBL2CBTUCHK563VEM7L00RN8I2K0VPB459JRVBFOIKJG72LIQPDP9RFCVEVI37BUD76RJ3KK0.20169\'.')
36
37 down.expect (re.compile ("Downloading `rdir.gnd\' done \(.*\).\r"));
38 down.expect (pexpect.EOF);
39
40 dir = pexpect.spawn ('gnunet-directory -c test_gnunet_fs_rec_data.conf rdir/a.gnd')
41 dir.expect (re.compile (" *embedded filename: a"));
42 dir.expect (re.compile (" *embedded filename: COPYING"));
43 dir.expect (pexpect.EOF)
44
45 os.system ('rm -r rdir/b.gnd rdir/a.gnd')
46 if (0 != os.system ("diff -r dir rdir")):
47 raise Exception ("Unexpected difference between source directory and downloaded result")
48
49finally:
50 os.system ('gnunet-arm -c test_gnunet_fs_rec_data.conf -eq')
51 os.system ('rm -r dir rdir rdir.gnd')
52 os.system ('rm -rf /tmp/gnunet-test-fs-py-rec/')