gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11123 - in gnunet/src: fs peerinfo-tool


From: gnunet
Subject: [GNUnet-SVN] r11123 - in gnunet/src: fs peerinfo-tool
Date: Fri, 30 Apr 2010 07:35:52 +0200

Author: amatus
Date: 2010-04-30 07:35:52 +0200 (Fri, 30 Apr 2010)
New Revision: 11123

Added:
   gnunet/src/fs/test_gnunet_fs_idx.py.in
   gnunet/src/fs/test_gnunet_fs_ns.py.in
   gnunet/src/fs/test_gnunet_fs_psd.py.in
   gnunet/src/fs/test_gnunet_fs_rec.py.in
   gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in
Removed:
   gnunet/src/fs/test_gnunet_fs_idx.py
   gnunet/src/fs/test_gnunet_fs_ns.py
   gnunet/src/fs/test_gnunet_fs_psd.py
   gnunet/src/fs/test_gnunet_fs_rec.py
   gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py
Modified:
   gnunet/src/fs/Makefile.am
   gnunet/src/peerinfo-tool/Makefile.am
Log:
Move python test scripts to .py.in and sed in the correct python path.


Modified: gnunet/src/fs/Makefile.am
===================================================================
--- gnunet/src/fs/Makefile.am   2010-04-29 22:52:46 UTC (rev 11122)
+++ gnunet/src/fs/Makefile.am   2010-04-30 05:35:52 UTC (rev 11123)
@@ -133,10 +133,6 @@
 
 
 if HAVE_PYTHON_PEXPECT
-TEST_EXTENSIONS = .py
-PY_LOG_COMPILER = $(PYTHON)
-AM_PY_LOG_FLAGS = -v
-
 check_SCRIPTS = \
  test_gnunet_fs_psd.py \
  test_gnunet_fs_rec.py \
@@ -254,7 +250,25 @@
   $(top_builddir)/src/fs/libgnunetfs.la  \
   $(top_builddir)/src/util/libgnunetutil.la  
 
+do_subst = $(SED) -e 's,address@hidden@],$(PYTHON),g'
 
+test_gnunet_fs_psd.py: test_gnunet_fs_psd.py.in Makefile
+       $(do_subst) < $(srcdir)/test_gnunet_fs_psd.py.in > test_gnunet_fs_psd.py
+       chmod +x test_gnunet_fs_psd.py
+
+test_gnunet_fs_rec.py: test_gnunet_fs_rec.py.in Makefile
+       $(do_subst) < $(srcdir)/test_gnunet_fs_rec.py.in > test_gnunet_fs_rec.py
+       chmod +x test_gnunet_fs_rec.py
+
+test_gnunet_fs_ns.py: test_gnunet_fs_ns.py.in Makefile
+       $(do_subst) < $(srcdir)/test_gnunet_fs_ns.py.in > test_gnunet_fs_ns.py
+       chmod +x test_gnunet_fs_ns.py
+
+test_gnunet_fs_idx.py: test_gnunet_fs_idx.py.in Makefile
+       $(do_subst) < $(srcdir)/test_gnunet_fs_idx.py.in > test_gnunet_fs_idx.py
+       chmod +x test_gnunet_fs_idx.py
+
+
 EXTRA_DIST = \
   fs_test_lib_data.conf \
   test_fs_data.conf \
@@ -273,4 +287,9 @@
   test_gnunet_fs_psd_data.conf \
   test_gnunet_fs_rec_data.conf \
   test_gnunet_fs_rec_data.tgz \
-  $(check_SCRIPTS)
+  test_gnunet_fs_psd.py.in \
+  test_gnunet_fs_rec.py.in \
+  test_gnunet_fs_ns.py.in \
+  test_gnunet_fs_idx.py.in
+
+CLEANFILES = $(check_SCRIPTS)

Deleted: gnunet/src/fs/test_gnunet_fs_idx.py
===================================================================
--- gnunet/src/fs/test_gnunet_fs_idx.py 2010-04-29 22:52:46 UTC (rev 11122)
+++ gnunet/src/fs/test_gnunet_fs_idx.py 2010-04-30 05:35:52 UTC (rev 11123)
@@ -1,45 +0,0 @@
-#!/usr/bin/env python 
-#    This file is part of GNUnet.
-#    (C) 2010 Christian Grothoff (and other contributing authors)
-#
-#    GNUnet is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published
-#    by the Free Software Foundation; either version 2, or (at your
-#    option) any later version.
-#
-#    GNUnet is distributed in the hope that it will be useful, but
-#    WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#    General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with GNUnet; see the file COPYING.  If not, write to the
-#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-#    Boston, MA 02111-1307, USA.
-#
-# Testcase for file-sharing command-line tools (indexing and unindexing)
-import pexpect
-import os
-import signal
-import re
-
-os.system ('rm -rf /tmp/gnunet-test-fs-py-idx/')
-os.system ('gnunet-arm -sq -c test_gnunet_fs_idx_data.conf')
-try:
-  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_idx_data.conf -m 
"description:The GNU Public License" -k gpl ../../COPYING')
-  pub.expect ('Publishing `../../COPYING\' done.\r')
-  pub.expect ("URI is 
`gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147'.\r")
-  pub.expect (pexpect.EOF)
-
-  down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_idx_data.conf -o 
\"COPYING\" 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147')
-  down.expect (re.compile ("Downloading `COPYING\' done \(.*\).\r"));
-  down.expect (pexpect.EOF);
-  os.system ('rm COPYING');
-
-  unindex = pexpect.spawn ('gnunet-unindex -c test_gnunet_fs_idx_data.conf 
../../COPYING')
-  unindex.expect ('Unindexing done.\r')
-  unindex.expect (pexpect.EOF)
-
-finally:
-  os.system ('gnunet-arm -c test_gnunet_fs_idx_data.conf -eq')
-  os.system ('rm -rf /tmp/gnunet-test-fs-py-idx/')

Copied: gnunet/src/fs/test_gnunet_fs_idx.py.in (from rev 11111, 
gnunet/src/fs/test_gnunet_fs_idx.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_idx.py.in                              (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_idx.py.in      2010-04-30 05:35:52 UTC (rev 
11123)
@@ -0,0 +1,45 @@
address@hidden@
+#    This file is part of GNUnet.
+#    (C) 2010 Christian Grothoff (and other contributing authors)
+#
+#    GNUnet is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation; either version 2, or (at your
+#    option) any later version.
+#
+#    GNUnet is distributed in the hope that it will be useful, but
+#    WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with GNUnet; see the file COPYING.  If not, write to the
+#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#    Boston, MA 02111-1307, USA.
+#
+# Testcase for file-sharing command-line tools (indexing and unindexing)
+import pexpect
+import os
+import signal
+import re
+
+os.system ('rm -rf /tmp/gnunet-test-fs-py-idx/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_idx_data.conf')
+try:
+  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_idx_data.conf -m 
"description:The GNU Public License" -k gpl ../../COPYING')
+  pub.expect ('Publishing `../../COPYING\' done.\r')
+  pub.expect ("URI is 
`gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147'.\r")
+  pub.expect (pexpect.EOF)
+
+  down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_idx_data.conf -o 
\"COPYING\" 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147')
+  down.expect (re.compile ("Downloading `COPYING\' done \(.*\).\r"));
+  down.expect (pexpect.EOF);
+  os.system ('rm COPYING');
+
+  unindex = pexpect.spawn ('gnunet-unindex -c test_gnunet_fs_idx_data.conf 
../../COPYING')
+  unindex.expect ('Unindexing done.\r')
+  unindex.expect (pexpect.EOF)
+
+finally:
+  os.system ('gnunet-arm -c test_gnunet_fs_idx_data.conf -eq')
+  os.system ('rm -rf /tmp/gnunet-test-fs-py-idx/')

Deleted: gnunet/src/fs/test_gnunet_fs_ns.py
===================================================================
--- gnunet/src/fs/test_gnunet_fs_ns.py  2010-04-29 22:52:46 UTC (rev 11122)
+++ gnunet/src/fs/test_gnunet_fs_ns.py  2010-04-30 05:35:52 UTC (rev 11123)
@@ -1,50 +0,0 @@
-#!/usr/bin/env python 
-#    This file is part of GNUnet.
-#    (C) 2010 Christian Grothoff (and other contributing authors)
-#
-#    GNUnet is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published
-#    by the Free Software Foundation; either version 2, or (at your
-#    option) any later version.
-#
-#    GNUnet is distributed in the hope that it will be useful, but
-#    WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#    General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with GNUnet; see the file COPYING.  If not, write to the
-#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-#    Boston, MA 02111-1307, USA.
-#
-# Testcase for file-sharing command-line tools (namespaces)
-import pexpect
-import os
-import signal
-import re
-
-os.system ('rm -rf /tmp/gnunet-test-fs-py-ns/')
-os.system ('gnunet-arm -sq -c test_gnunet_fs_ns_data.conf')
-try:
-  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_ns_data.conf -C 
licenses -k gplad -m "description:Free Software Licenses" -r myroot')
-  pseu.expect (pexpect.EOF)
-  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_ns_data.conf -o')
-  pseu.expect (re.compile("licenses \(.*\)\r"))
-  pseu.expect (pexpect.EOF)
-
-  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_ns_data.conf -k 
licenses -P licenses -u 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147
 -t gpl -N gpl3')
-  pub.expect (pexpect.EOF)
-
-  search = pexpect.spawn ('gnunet-search -V -c test_gnunet_fs_ns_data.conf 
gplad')
-  search.expect (re.compile ("gnunet-download gnunet://fs/sks/.*/myroot\r"))
-  search.expect (re.compile (" *description: Free Software Licenses\r"))
-  search.kill (signal.SIGTERM)
-  search.expect (pexpect.EOF)
-
-  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_ns_data.conf')
-  pseu.expect (re.compile ("Free Software Licenses.*:\r"))
-  pseu.expect (pexpect.EOF)
-
-finally:
-  os.system ('gnunet-arm -c test_gnunet_fs_ns_data.conf -eq')
-  os.system ('rm -rf /tmp/gnunet-test-fs-py-ns/')

Copied: gnunet/src/fs/test_gnunet_fs_ns.py.in (from rev 11111, 
gnunet/src/fs/test_gnunet_fs_ns.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_ns.py.in                               (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_ns.py.in       2010-04-30 05:35:52 UTC (rev 
11123)
@@ -0,0 +1,50 @@
address@hidden@
+#    This file is part of GNUnet.
+#    (C) 2010 Christian Grothoff (and other contributing authors)
+#
+#    GNUnet is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation; either version 2, or (at your
+#    option) any later version.
+#
+#    GNUnet is distributed in the hope that it will be useful, but
+#    WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with GNUnet; see the file COPYING.  If not, write to the
+#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#    Boston, MA 02111-1307, USA.
+#
+# Testcase for file-sharing command-line tools (namespaces)
+import pexpect
+import os
+import signal
+import re
+
+os.system ('rm -rf /tmp/gnunet-test-fs-py-ns/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_ns_data.conf')
+try:
+  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_ns_data.conf -C 
licenses -k gplad -m "description:Free Software Licenses" -r myroot')
+  pseu.expect (pexpect.EOF)
+  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_ns_data.conf -o')
+  pseu.expect (re.compile("licenses \(.*\)\r"))
+  pseu.expect (pexpect.EOF)
+
+  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_ns_data.conf -k 
licenses -P licenses -u 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147
 -t gpl -N gpl3')
+  pub.expect (pexpect.EOF)
+
+  search = pexpect.spawn ('gnunet-search -V -c test_gnunet_fs_ns_data.conf 
gplad')
+  search.expect (re.compile ("gnunet-download gnunet://fs/sks/.*/myroot\r"))
+  search.expect (re.compile (" *description: Free Software Licenses\r"))
+  search.kill (signal.SIGTERM)
+  search.expect (pexpect.EOF)
+
+  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_ns_data.conf')
+  pseu.expect (re.compile ("Free Software Licenses.*:\r"))
+  pseu.expect (pexpect.EOF)
+
+finally:
+  os.system ('gnunet-arm -c test_gnunet_fs_ns_data.conf -eq')
+  os.system ('rm -rf /tmp/gnunet-test-fs-py-ns/')

Deleted: gnunet/src/fs/test_gnunet_fs_psd.py
===================================================================
--- gnunet/src/fs/test_gnunet_fs_psd.py 2010-04-29 22:52:46 UTC (rev 11122)
+++ gnunet/src/fs/test_gnunet_fs_psd.py 2010-04-30 05:35:52 UTC (rev 11123)
@@ -1,48 +0,0 @@
-#!/usr/bin/env python 
-#    This file is part of GNUnet.
-#    (C) 2010 Christian Grothoff (and other contributing authors)
-#
-#    GNUnet is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published
-#    by the Free Software Foundation; either version 2, or (at your
-#    option) any later version.
-#
-#    GNUnet is distributed in the hope that it will be useful, but
-#    WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#    General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with GNUnet; see the file COPYING.  If not, write to the
-#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-#    Boston, MA 02111-1307, USA.
-#
-# Testcase for file-sharing command-line tools (publish, search, download)
-import pexpect
-import os
-import signal
-import re
-
-os.system ('rm -rf /tmp/gnunet-test-fs-py-psd/')
-os.system ('gnunet-arm -sq -c test_gnunet_fs_psd_data.conf')
-try:
-# first, basic publish-search-download run
-  pub = pexpect.spawn ('gnunet-publish -n -c test_gnunet_fs_psd_data.conf -m 
"description:The GNU Public License" -k gpl ../../COPYING')
-  pub.expect ('Publishing `../../COPYING\' done.\r')
-  pub.expect ("URI is 
`gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147'.\r")
-  pub.expect (pexpect.EOF)
-
-  search = pexpect.spawn ('gnunet-search -V -c test_gnunet_fs_psd_data.conf 
gpl')
-  search.expect ("gnunet-download -o \"COPYING\" 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147\r")
-  search.expect (re.compile (" *description: The GNU Public License\r"));
-  search.kill (signal.SIGTERM)
-  search.expect (pexpect.EOF)
-  
-  down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_psd_data.conf -o 
\"COPYING\" 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147')
-  down.expect (re.compile ("Downloading `COPYING\' done \(.*\).\r"));
-  down.expect (pexpect.EOF);
-  os.system ('rm COPYING');
-
-finally:
-  os.system ('gnunet-arm -c test_gnunet_fs_psd_data.conf -eq')
-  os.system ('rm -rf /tmp/gnunet-test-fs-py-psd/')

Copied: gnunet/src/fs/test_gnunet_fs_psd.py.in (from rev 11111, 
gnunet/src/fs/test_gnunet_fs_psd.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_psd.py.in                              (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_psd.py.in      2010-04-30 05:35:52 UTC (rev 
11123)
@@ -0,0 +1,48 @@
address@hidden@
+#    This file is part of GNUnet.
+#    (C) 2010 Christian Grothoff (and other contributing authors)
+#
+#    GNUnet is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation; either version 2, or (at your
+#    option) any later version.
+#
+#    GNUnet is distributed in the hope that it will be useful, but
+#    WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with GNUnet; see the file COPYING.  If not, write to the
+#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#    Boston, MA 02111-1307, USA.
+#
+# Testcase for file-sharing command-line tools (publish, search, download)
+import pexpect
+import os
+import signal
+import re
+
+os.system ('rm -rf /tmp/gnunet-test-fs-py-psd/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_psd_data.conf')
+try:
+# first, basic publish-search-download run
+  pub = pexpect.spawn ('gnunet-publish -n -c test_gnunet_fs_psd_data.conf -m 
"description:The GNU Public License" -k gpl ../../COPYING')
+  pub.expect ('Publishing `../../COPYING\' done.\r')
+  pub.expect ("URI is 
`gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147'.\r")
+  pub.expect (pexpect.EOF)
+
+  search = pexpect.spawn ('gnunet-search -V -c test_gnunet_fs_psd_data.conf 
gpl')
+  search.expect ("gnunet-download -o \"COPYING\" 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147\r")
+  search.expect (re.compile (" *description: The GNU Public License\r"));
+  search.kill (signal.SIGTERM)
+  search.expect (pexpect.EOF)
+  
+  down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_psd_data.conf -o 
\"COPYING\" 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147')
+  down.expect (re.compile ("Downloading `COPYING\' done \(.*\).\r"));
+  down.expect (pexpect.EOF);
+  os.system ('rm COPYING');
+
+finally:
+  os.system ('gnunet-arm -c test_gnunet_fs_psd_data.conf -eq')
+  os.system ('rm -rf /tmp/gnunet-test-fs-py-psd/')

Deleted: gnunet/src/fs/test_gnunet_fs_rec.py
===================================================================
--- gnunet/src/fs/test_gnunet_fs_rec.py 2010-04-29 22:52:46 UTC (rev 11122)
+++ gnunet/src/fs/test_gnunet_fs_rec.py 2010-04-30 05:35:52 UTC (rev 11123)
@@ -1,52 +0,0 @@
-#!/usr/bin/env python 
-#    This file is part of GNUnet.
-#    (C) 2010 Christian Grothoff (and other contributing authors)
-#
-#    GNUnet is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published
-#    by the Free Software Foundation; either version 2, or (at your
-#    option) any later version.
-#
-#    GNUnet is distributed in the hope that it will be useful, but
-#    WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#    General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with GNUnet; see the file COPYING.  If not, write to the
-#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-#    Boston, MA 02111-1307, USA.
-#
-# Testcase for file-sharing command-line tools (recursive publishing & 
download)
-import pexpect
-import os
-import signal
-import re
-
-os.system ('rm -rf /tmp/gnunet-test-fs-py-rec/')
-os.system ('gnunet-arm -sq -c test_gnunet_fs_rec_data.conf')
-os.system ('tar xfz test_gnunet_fs_rec_data.tgz')
-try:
-  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_rec_data.conf -d -k 
testdir dir/')
-  pub.expect ('Publishing `dir/\' done.\r')
-  pub.expect ("URI is 
`gnunet://fs/chk/P5BPKNHH7CECDQA1A917G5EB67PPVG99NVO5QMJ8AJP2C02NM8O1ALNGOJPLLO0RMST0FNM0ATJV95PDAGATHDGH7AGIK2N3O0OOC70.OSG2JS3JDSI0AV8LMOL9MKPJ70DNG2RBL2CBTUCHK563VEM7L00RN8I2K0VPB459JRVBFOIKJG72LIQPDP9RFCVEVI37BUD76RJ3KK0.20169\'.")
-  pub.expect (pexpect.EOF)
-
-  down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_rec_data.conf -R -o 
rdir.gnd 
gnunet://fs/chk/P5BPKNHH7CECDQA1A917G5EB67PPVG99NVO5QMJ8AJP2C02NM8O1ALNGOJPLLO0RMST0FNM0ATJV95PDAGATHDGH7AGIK2N3O0OOC70.OSG2JS3JDSI0AV8LMOL9MKPJ70DNG2RBL2CBTUCHK563VEM7L00RN8I2K0VPB459JRVBFOIKJG72LIQPDP9RFCVEVI37BUD76RJ3KK0.20169\'.')
-
-  down.expect (re.compile ("Downloading `rdir.gnd\' done \(.*\).\r"));
-  down.expect (pexpect.EOF);
-
-  dir = pexpect.spawn ('gnunet-directory -c test_gnunet_fs_rec_data.conf  
rdir/a.gnd')
-  dir.expect (re.compile (" *embedded filename: a"));
-  dir.expect (re.compile (" *embedded filename: COPYING"));
-  dir.expect (pexpect.EOF)
-
-  os.system ('rm -r rdir/b.gnd rdir/a.gnd')
-  if (0 != os.system ("diff -r dir rdir")):
-    raise Exception ("Unexpected difference between source directory and 
downloaded result")
-  
-finally:
-  os.system ('gnunet-arm -c test_gnunet_fs_rec_data.conf -eq')
-  os.system ('rm -r dir rdir rdir.gnd')
-  os.system ('rm -rf /tmp/gnunet-test-fs-py-rec/')

Copied: gnunet/src/fs/test_gnunet_fs_rec.py.in (from rev 11111, 
gnunet/src/fs/test_gnunet_fs_rec.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_rec.py.in                              (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_rec.py.in      2010-04-30 05:35:52 UTC (rev 
11123)
@@ -0,0 +1,52 @@
address@hidden@
+#    This file is part of GNUnet.
+#    (C) 2010 Christian Grothoff (and other contributing authors)
+#
+#    GNUnet is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation; either version 2, or (at your
+#    option) any later version.
+#
+#    GNUnet is distributed in the hope that it will be useful, but
+#    WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with GNUnet; see the file COPYING.  If not, write to the
+#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#    Boston, MA 02111-1307, USA.
+#
+# Testcase for file-sharing command-line tools (recursive publishing & 
download)
+import pexpect
+import os
+import signal
+import re
+
+os.system ('rm -rf /tmp/gnunet-test-fs-py-rec/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_rec_data.conf')
+os.system ('tar xfz test_gnunet_fs_rec_data.tgz')
+try:
+  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_rec_data.conf -d -k 
testdir dir/')
+  pub.expect ('Publishing `dir/\' done.\r')
+  pub.expect ("URI is 
`gnunet://fs/chk/P5BPKNHH7CECDQA1A917G5EB67PPVG99NVO5QMJ8AJP2C02NM8O1ALNGOJPLLO0RMST0FNM0ATJV95PDAGATHDGH7AGIK2N3O0OOC70.OSG2JS3JDSI0AV8LMOL9MKPJ70DNG2RBL2CBTUCHK563VEM7L00RN8I2K0VPB459JRVBFOIKJG72LIQPDP9RFCVEVI37BUD76RJ3KK0.20169\'.")
+  pub.expect (pexpect.EOF)
+
+  down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_rec_data.conf -R -o 
rdir.gnd 
gnunet://fs/chk/P5BPKNHH7CECDQA1A917G5EB67PPVG99NVO5QMJ8AJP2C02NM8O1ALNGOJPLLO0RMST0FNM0ATJV95PDAGATHDGH7AGIK2N3O0OOC70.OSG2JS3JDSI0AV8LMOL9MKPJ70DNG2RBL2CBTUCHK563VEM7L00RN8I2K0VPB459JRVBFOIKJG72LIQPDP9RFCVEVI37BUD76RJ3KK0.20169\'.')
+
+  down.expect (re.compile ("Downloading `rdir.gnd\' done \(.*\).\r"));
+  down.expect (pexpect.EOF);
+
+  dir = pexpect.spawn ('gnunet-directory -c test_gnunet_fs_rec_data.conf  
rdir/a.gnd')
+  dir.expect (re.compile (" *embedded filename: a"));
+  dir.expect (re.compile (" *embedded filename: COPYING"));
+  dir.expect (pexpect.EOF)
+
+  os.system ('rm -r rdir/b.gnd rdir/a.gnd')
+  if (0 != os.system ("diff -r dir rdir")):
+    raise Exception ("Unexpected difference between source directory and 
downloaded result")
+  
+finally:
+  os.system ('gnunet-arm -c test_gnunet_fs_rec_data.conf -eq')
+  os.system ('rm -r dir rdir rdir.gnd')
+  os.system ('rm -rf /tmp/gnunet-test-fs-py-rec/')

Modified: gnunet/src/peerinfo-tool/Makefile.am
===================================================================
--- gnunet/src/peerinfo-tool/Makefile.am        2010-04-29 22:52:46 UTC (rev 
11122)
+++ gnunet/src/peerinfo-tool/Makefile.am        2010-04-30 05:35:52 UTC (rev 
11123)
@@ -20,8 +20,19 @@
   $(top_builddir)/src/util/libgnunetutil.la 
 
 if HAVE_PYTHON_PEXPECT
-TESTS_ENVIRONMENT = $(PYTHON)
-TESTS = \
+check_SCRIPTS = \
  test_gnunet_peerinfo.py 
 endif
 
+TESTS = $(check_SCRIPTS)
+
+do_subst = $(SED) -e 's,address@hidden@],$(PYTHON),g'
+
+test_gnunet_peerinfo.py: test_gnunet_peerinfo.py.in Makefile
+       $(do_subst) < $(srcdir)/test_gnunet_peerinfo.py.in > 
test_gnunet_peerinfo.py
+       chmod +x test_gnunet_peerinfo.py
+
+EXTRADIST = \
+  test_gnunet_peerinfo.py.in
+
+CLEANFILES = $(check_SCRIPTS)

Deleted: gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py
===================================================================
--- gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py    2010-04-29 22:52:46 UTC 
(rev 11122)
+++ gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py    2010-04-30 05:35:52 UTC 
(rev 11123)
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-#    This file is part of GNUnet.
-#    (C) 2010 Christian Grothoff (and other contributing authors)
-#
-#    GNUnet is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published
-#    by the Free Software Foundation; either version 2, or (at your
-#    option) any later version.
-#
-#    GNUnet is distributed in the hope that it will be useful, but
-#    WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#    General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with GNUnet; see the file COPYING.  If not, write to the
-#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-#    Boston, MA 02111-1307, USA.
-#
-# Testcase for gnunet-peerinfo
-import pexpect
-import os
-import signal
-import re
-
-pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf')
-pinfo.expect  ('Timeout trying to interact with PEERINFO service\r')
-pinfo.expect (pexpect.EOF);
-os.system ('rm -rf /tmp/gnunet-test-peerinfo/')
-os.system ('gnunet-arm -sq -c test_gnunet_peerinfo_data.conf')
-
-try:
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-s')
-  pinfo.expect (re.compile ("I am peer `.*\'.\r"));
-  pinfo.expect (pexpect.EOF);
-
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-qs')
-  pinfo.expect (re.compile 
(".......................................................................................................\r"));
-  pinfo.expect (pexpect.EOF);
-
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
invalid')
-  pinfo.expect (re.compile ("Invalid command line argument `invalid\'\r"));
-  pinfo.expect (pexpect.EOF);
-
-
-  os.system ('gnunet-arm -q -i transport -c test_gnunet_peerinfo_data.conf')
-  os.system ('sleep 1')
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf')
-  pinfo.expect (re.compile ("Peer `.*\' with trust  *0\r"));
-  pinfo.expect (re.compile (" *localhost:24357\r"));
-  pinfo.expect (pexpect.EOF);
-
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-n')
-  pinfo.expect (re.compile ("Peer `.*\' with trust  *0\r"));
-  pinfo.expect (re.compile (" *127..*:24357\r"));
-  pinfo.expect (pexpect.EOF);
-
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-qs')
-  pid = pinfo.read (-1)
-  pid = pid.strip ()
-
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 4 
' + pid)
-  pinfo.expect (re.compile ("Peer `" + pid + "\' with trust  *4\r"));
-  pinfo.expect (pexpect.EOF);  
-
-  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -- 
-4 ' + pid)
-  pinfo.expect (re.compile ("Peer `" + pid + "\' with trust  *0\r"));
-  pinfo.expect (pexpect.EOF);  
-
-finally:
-  os.system ('gnunet-arm -c test_gnunet_peerinfo_data.conf -eq')
-  os.system ('rm -rf /tmp/gnunet-test-peerinfo/')

Copied: gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in (from rev 11112, 
gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py)
===================================================================
--- gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in                         
(rev 0)
+++ gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in 2010-04-30 05:35:52 UTC 
(rev 11123)
@@ -0,0 +1,72 @@
address@hidden@
+#    This file is part of GNUnet.
+#    (C) 2010 Christian Grothoff (and other contributing authors)
+#
+#    GNUnet is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation; either version 2, or (at your
+#    option) any later version.
+#
+#    GNUnet is distributed in the hope that it will be useful, but
+#    WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with GNUnet; see the file COPYING.  If not, write to the
+#    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#    Boston, MA 02111-1307, USA.
+#
+# Testcase for gnunet-peerinfo
+import pexpect
+import os
+import signal
+import re
+
+pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf')
+pinfo.expect  ('Timeout trying to interact with PEERINFO service\r')
+pinfo.expect (pexpect.EOF);
+os.system ('rm -rf /tmp/gnunet-test-peerinfo/')
+os.system ('gnunet-arm -sq -c test_gnunet_peerinfo_data.conf')
+
+try:
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-s')
+  pinfo.expect (re.compile ("I am peer `.*\'.\r"));
+  pinfo.expect (pexpect.EOF);
+
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-qs')
+  pinfo.expect (re.compile 
(".......................................................................................................\r"));
+  pinfo.expect (pexpect.EOF);
+
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
invalid')
+  pinfo.expect (re.compile ("Invalid command line argument `invalid\'\r"));
+  pinfo.expect (pexpect.EOF);
+
+
+  os.system ('gnunet-arm -q -i transport -c test_gnunet_peerinfo_data.conf')
+  os.system ('sleep 1')
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf')
+  pinfo.expect (re.compile ("Peer `.*\' with trust  *0\r"));
+  pinfo.expect (re.compile (" *localhost:24357\r"));
+  pinfo.expect (pexpect.EOF);
+
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-n')
+  pinfo.expect (re.compile ("Peer `.*\' with trust  *0\r"));
+  pinfo.expect (re.compile (" *127..*:24357\r"));
+  pinfo.expect (pexpect.EOF);
+
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 
-qs')
+  pid = pinfo.read (-1)
+  pid = pid.strip ()
+
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 4 
' + pid)
+  pinfo.expect (re.compile ("Peer `" + pid + "\' with trust  *4\r"));
+  pinfo.expect (pexpect.EOF);  
+
+  pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -- 
-4 ' + pid)
+  pinfo.expect (re.compile ("Peer `" + pid + "\' with trust  *0\r"));
+  pinfo.expect (pexpect.EOF);  
+
+finally:
+  os.system ('gnunet-arm -c test_gnunet_peerinfo_data.conf -eq')
+  os.system ('rm -rf /tmp/gnunet-test-peerinfo/')





reply via email to

[Prev in Thread] Current Thread [Next in Thread]