gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10807 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r10807 - gnunet/src/fs
Date: Mon, 5 Apr 2010 23:28:05 +0200

Author: grothoff
Date: 2010-04-05 23:28:05 +0200 (Mon, 05 Apr 2010)
New Revision: 10807

Added:
   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/fs/test_gnunet_fs_rec_data.tgz
Removed:
   gnunet/src/fs/test_gnunet_fs.py
Modified:
   gnunet/src/fs/Makefile.am
   gnunet/src/fs/fs_download.c
   gnunet/src/fs/fs_namespace.c
   gnunet/src/fs/gnunet-service-fs_drq.c
   gnunet/src/fs/gnunet-service-fs_indexing.c
   gnunet/src/fs/test_fs_namespace.c
Log:
additional tests

Modified: gnunet/src/fs/Makefile.am
===================================================================
--- gnunet/src/fs/Makefile.am   2010-04-05 20:45:53 UTC (rev 10806)
+++ gnunet/src/fs/Makefile.am   2010-04-05 21:28:05 UTC (rev 10807)
@@ -132,7 +132,10 @@
 
 if HAVE_PYTHON_PEXPECT
 check_SCRIPTS = \
- test_gnunet_fs.py
+ test_gnunet_fs_psd.py \
+ test_gnunet_fs_rec.py \
+ test_gnunet_fs_ns.py \
+ test_gnunet_fs_idx.py
 endif
 
 TESTS = $(check_SCRIPTS) \
@@ -258,4 +261,6 @@
   test_fs_publish_data.conf \
   test_fs_search_data.conf \
   test_fs_unindex_data.conf \
-  test_fs_uri_data.conf
+  test_fs_uri_data.conf \
+  test_gnunet_fs_data.conf \
+  test_gnunet_fs_rec_data.tgz

Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2010-04-05 20:45:53 UTC (rev 10806)
+++ gnunet/src/fs/fs_download.c 2010-04-05 21:28:05 UTC (rev 10807)
@@ -906,7 +906,6 @@
                                           dc);         
            
     }
-
   pi.status = GNUNET_FS_STATUS_DOWNLOAD_PROGRESS;
   make_download_status (&pi, dc);
   pi.value.download.specifics.progress.data = pt;
@@ -1324,7 +1323,7 @@
   dc->length = length;
   dc->anonymity = anonymity;
   dc->options = options;
-  dc->active = GNUNET_CONTAINER_multihashmap_create (2 * (length / 
DBLOCK_SIZE));
+  dc->active = GNUNET_CONTAINER_multihashmap_create (1 + 2 * (length / 
DBLOCK_SIZE));
   dc->treedepth = GNUNET_FS_compute_depth 
(GNUNET_ntohll(dc->uri->data.chk.file_length));
 #if DEBUG_DOWNLOAD
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,

Modified: gnunet/src/fs/fs_namespace.c
===================================================================
--- gnunet/src/fs/fs_namespace.c        2010-04-05 20:45:53 UTC (rev 10806)
+++ gnunet/src/fs/fs_namespace.c        2010-04-05 21:28:05 UTC (rev 10807)
@@ -170,7 +170,6 @@
       GNUNET_free (ac);
       return;
     }
-
   keyword = ac->ksk_uri->data.ksk.keywords[ac->pos++];
   /* first character of keyword indicates if it is
      mandatory or not -- ignore for hashing */

Modified: gnunet/src/fs/gnunet-service-fs_drq.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_drq.c       2010-04-05 20:45:53 UTC (rev 
10806)
+++ gnunet/src/fs/gnunet-service-fs_drq.c       2010-04-05 21:28:05 UTC (rev 
10807)
@@ -26,7 +26,7 @@
 #include "platform.h"
 #include "gnunet-service-fs_drq.h"
 
-#define DEBUG_DRQ GNUNET_NO
+#define DEBUG_DRQ GNUNET_YES
 
 /**
  * Signature of a function that is called whenever a datastore

Modified: gnunet/src/fs/gnunet-service-fs_indexing.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_indexing.c  2010-04-05 20:45:53 UTC (rev 
10806)
+++ gnunet/src/fs/gnunet-service-fs_indexing.c  2010-04-05 21:28:05 UTC (rev 
10807)
@@ -35,7 +35,7 @@
 #include "gnunet-service-fs_indexing.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_NO
+#define DEBUG_FS GNUNET_YES
 
 /**
  * In-memory information about indexed files (also available

Modified: gnunet/src/fs/test_fs_namespace.c
===================================================================
--- gnunet/src/fs/test_fs_namespace.c   2010-04-05 20:45:53 UTC (rev 10806)
+++ gnunet/src/fs/test_fs_namespace.c   2010-04-05 21:28:05 UTC (rev 10807)
@@ -303,8 +303,8 @@
 
 static void
 adv_cont (void *cls,
-             const struct GNUNET_FS_Uri *uri,
-             const char *emsg)
+         const struct GNUNET_FS_Uri *uri,
+         const char *emsg)
 {
   struct GNUNET_CONTAINER_MetaData *meta;
   struct GNUNET_FS_Namespace *ns;
@@ -361,6 +361,7 @@
   struct GNUNET_FS_Namespace *ns;
   struct GNUNET_TIME_Absolute expiration;
   struct GNUNET_CONTAINER_MetaData *meta;
+  struct GNUNET_FS_Uri *ksk_uri;
   int ok;
 
   ns = GNUNET_FS_namespace_create (fs,
@@ -378,13 +379,16 @@
   fprintf (stderr, "Advertising namespace root...\n");
   expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
   meta = GNUNET_CONTAINER_meta_data_create ();
+  ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/testnsa", NULL);
   GNUNET_FS_namespace_advertise (fs,
+                                ksk_uri,
                                 ns,
                                 meta,
                                 1, 1,
                                 expiration,                                    
   
                                 "root",
                                 &adv_cont, NULL);
+  GNUNET_FS_uri_destroy (ksk_uri);
   GNUNET_FS_namespace_delete (ns, GNUNET_NO);
   GNUNET_CONTAINER_meta_data_destroy (meta);
 }

Deleted: gnunet/src/fs/test_gnunet_fs.py
===================================================================
--- gnunet/src/fs/test_gnunet_fs.py     2010-04-05 20:45:53 UTC (rev 10806)
+++ gnunet/src/fs/test_gnunet_fs.py     2010-04-05 21:28:05 UTC (rev 10807)
@@ -1,67 +0,0 @@
-#!/usr/bin/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
-# 
-# TODO:
-# - test meta data
-# - test namespace search (sblocks, nblocks)
-# - test gnunet-unindex
-# - test gnunet-directory
-# - consider splitting into multiple independent scripts
-import pexpect
-import os
-import signal
-import re
-
-os.system ('gnunet-arm -sq -c test_gnunet_fs_data.conf')
-try:
-# first, basic publish-search-download run
-  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_data.conf -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 -c test_gnunet_fs_data.conf gpl')
-  search.expect ("gnunet-download -o \"COPYING\" 
gnunet://fs/chk/PC0M19QMQC0BPSHR6BGA228PP6INER1D610MGEMOMEM87222FN8HVUO7PQGO0O9HD2GVLHF2N5IDHEQUNK6LKE428FPO96SKQEA486O.PG7K85JGQ6N599MD5HEP3CHEVFPKQD9JB6NPSLVA3T1SKDS66CFI499VS6MGQ88B0QUAVT1282TCRD4GGFVUKDLGI8F0SPIANA3J2LG.35147\r")
-  search.kill (signal.SIGTERM)
-  search.expect (pexpect.EOF)
-# FIXME: check for meta-data (also need to add meta data in publish call!)
-  
-  down = pexpect.spawn ('gnunet-download -c test_gnunet_fs_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');
-
-# second, same with namespace creation  
-  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_data.conf -C 
licenses -k gpl -k test -m "description:Free Software Licenses"')
-  pseu.expect (pexpect.EOF)
-  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_data.conf -o')
-  pseu.expect (re.compile("licenses \(.*\)\r"))
-  pseu.expect (pexpect.EOF)
-
-  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_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 -c test_gnunet_fs_data.conf 
licenses')
-# FIXME: check that namespace was found (code currently does not work for 
NBLOCKS!)
-# FIXME: check for meta-data! (use gnunet-pseudonym to display?)
-
-finally:
-  os.system ('gnunet-arm -c test_gnunet_fs_data.conf -eq')

Copied: gnunet/src/fs/test_gnunet_fs_idx.py (from rev 10789, 
gnunet/src/fs/test_gnunet_fs.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_idx.py                         (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_idx.py 2010-04-05 21:28:05 UTC (rev 10807)
@@ -0,0 +1,44 @@
+#!/usr/bin/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/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_data.conf')
+try:
+  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_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_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_data.conf 
../../COPYING')
+  unindex.expect ('Unindexing done.\r')
+  unindex.expect (pexpect.EOF)
+
+finally:
+  os.system ('gnunet-arm -c test_gnunet_fs_data.conf -eq')

Copied: gnunet/src/fs/test_gnunet_fs_ns.py (from rev 10789, 
gnunet/src/fs/test_gnunet_fs.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_ns.py                          (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_ns.py  2010-04-05 21:28:05 UTC (rev 10807)
@@ -0,0 +1,49 @@
+#!/usr/bin/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/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_data.conf')
+try:
+  pseu = pexpect.spawn ('gnunet-pseudonym -c test_gnunet_fs_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_data.conf -o')
+  pseu.expect (re.compile("licenses \(.*\)\r"))
+  pseu.expect (pexpect.EOF)
+
+  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_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_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_data.conf')
+  pseu.expect (re.compile ("Free Software Licenses.*:\r"))
+  pseu.expect (pexpect.EOF)
+
+finally:
+  os.system ('gnunet-arm -c test_gnunet_fs_data.conf -eq')

Copied: gnunet/src/fs/test_gnunet_fs_psd.py (from rev 10789, 
gnunet/src/fs/test_gnunet_fs.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_psd.py                         (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_psd.py 2010-04-05 21:28:05 UTC (rev 10807)
@@ -0,0 +1,47 @@
+#!/usr/bin/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/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_data.conf')
+try:
+# first, basic publish-search-download run
+  pub = pexpect.spawn ('gnunet-publish -n -c test_gnunet_fs_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_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_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_data.conf -eq')

Copied: gnunet/src/fs/test_gnunet_fs_rec.py (from rev 10789, 
gnunet/src/fs/test_gnunet_fs.py)
===================================================================
--- gnunet/src/fs/test_gnunet_fs_rec.py                         (rev 0)
+++ gnunet/src/fs/test_gnunet_fs_rec.py 2010-04-05 21:28:05 UTC (rev 10807)
@@ -0,0 +1,51 @@
+#!/usr/bin/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/')
+os.system ('gnunet-arm -sq -c test_gnunet_fs_data.conf')
+os.system ('tar xfz test_gnunet_fs_rec_data.tgz')
+try:
+  pub = pexpect.spawn ('gnunet-publish -c test_gnunet_fs_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_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 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_data.conf -eq')
+  os.system ('rm -r dir rdir rdir.gnd')

Added: gnunet/src/fs/test_gnunet_fs_rec_data.tgz
===================================================================
(Binary files differ)


Property changes on: gnunet/src/fs/test_gnunet_fs_rec_data.tgz
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream





reply via email to

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