aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-07-09 10:07:43 +0000
committerChristian Grothoff <christian@grothoff.org>2010-07-09 10:07:43 +0000
commit0cada45a69334845c7efbd3c17c1b5b98f9ce2a1 (patch)
tree19f8fe81d6958648d42c773b7be0f66c56f35e91 /src/fs
parent7d09cf26f7ca7075aef5c9b75228ad0709980a7e (diff)
downloadgnunet-0cada45a69334845c7efbd3c17c1b5b98f9ce2a1.tar.gz
gnunet-0cada45a69334845c7efbd3c17c1b5b98f9ce2a1.zip
dead
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/Makefile.am8
-rw-r--r--src/fs/test_fs_collection.c120
-rw-r--r--src/fs/test_fs_collection_data.conf38
3 files changed, 0 insertions, 166 deletions
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am
index 5b5da8772..9625af830 100644
--- a/src/fs/Makefile.am
+++ b/src/fs/Makefile.am
@@ -114,7 +114,6 @@ gnunet_unindex_LDADD = \
114 114
115 115
116check_PROGRAMS = \ 116check_PROGRAMS = \
117 test_fs_collection \
118 test_fs_directory \ 117 test_fs_directory \
119 test_fs_download \ 118 test_fs_download \
120 test_fs_download_indexed \ 119 test_fs_download_indexed \
@@ -166,12 +165,6 @@ TESTS = \
166 $(check_SCRIPTS) 165 $(check_SCRIPTS)
167 166
168 167
169test_fs_collection_SOURCES = \
170 test_fs_collection.c
171test_fs_collection_LDADD = \
172 $(top_builddir)/src/fs/libgnunetfs.la \
173 $(top_builddir)/src/util/libgnunetutil.la
174
175test_fs_directory_SOURCES = \ 168test_fs_directory_SOURCES = \
176 test_fs_directory.c 169 test_fs_directory.c
177test_fs_directory_LDADD = \ 170test_fs_directory_LDADD = \
@@ -312,7 +305,6 @@ test_gnunet_fs_idx.py: test_gnunet_fs_idx.py.in Makefile
312EXTRA_DIST = \ 305EXTRA_DIST = \
313 fs_test_lib_data.conf \ 306 fs_test_lib_data.conf \
314 test_fs_data.conf \ 307 test_fs_data.conf \
315 test_fs_collection_data.conf \
316 test_fs_download_data.conf \ 308 test_fs_download_data.conf \
317 test_fs_file_information_data.conf \ 309 test_fs_file_information_data.conf \
318 test_fs_file_information_meta_data_image.jpg \ 310 test_fs_file_information_meta_data_image.jpg \
diff --git a/src/fs/test_fs_collection.c b/src/fs/test_fs_collection.c
deleted file mode 100644
index 3ff8c3ab9..000000000
--- a/src/fs/test_fs_collection.c
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 This file is part of GNUnet.
3 (C) 2006, 2009 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 3, 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
21/**
22 * @file fs/test_fs_collection.c
23 * @brief testcase for fs_collection.c
24 * @author Christian Grothoff
25 */
26
27#include "platform.h"
28#include "gnunet_util_lib.h"
29#include "gnunet_fs_service.h"
30
31static struct GNUNET_CONFIGURATION_Handle *cfg;
32
33static void* progress_cb (void *cls,
34 const struct GNUNET_FS_ProgressInfo *info)
35{
36 GNUNET_break (0);
37 return NULL;
38}
39
40
41static void
42task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
43{
44 struct GNUNET_FS_Namespace *have;
45 struct GNUNET_FS_Namespace *ns;
46 char *emsg;
47 struct GNUNET_FS_Uri *uri;
48 struct GNUNET_FS_Handle *fsh;
49 struct GNUNET_CONTAINER_MetaData *md;
50
51 fsh = GNUNET_FS_start (tc->sched,
52 cfg,
53 "test-fs-collection",
54 &progress_cb,
55 NULL,
56 GNUNET_FS_FLAGS_NONE,
57 GNUNET_FS_OPTIONS_END);
58 GNUNET_assert (NULL != fsh);
59 GNUNET_FS_collection_stop (fsh);
60 GNUNET_assert (NULL == GNUNET_FS_collection_get (fsh));
61 ns = GNUNET_FS_namespace_create (fsh, "test-namespace");
62 GNUNET_assert (NULL != ns);
63 GNUNET_assert (GNUNET_OK == GNUNET_FS_collection_start (fsh,
64 ns));
65 GNUNET_FS_namespace_delete (ns, GNUNET_NO);
66 have = GNUNET_FS_collection_get (fsh);
67 GNUNET_assert (NULL != have);
68 GNUNET_FS_namespace_delete (have, GNUNET_NO);
69 uri =
70 GNUNET_FS_uri_parse ("gnunet://fs/chk/0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0", &emsg);
71 GNUNET_assert (NULL != uri);
72 md = GNUNET_CONTAINER_meta_data_create ();
73 GNUNET_FS_collection_add (fsh, uri, md);
74 GNUNET_CONTAINER_meta_data_destroy (md);
75 GNUNET_FS_uri_destroy (uri);
76 GNUNET_FS_stop (fsh);
77 fsh = GNUNET_FS_start (tc->sched,
78 cfg,
79 "test-fs-collection",
80 &progress_cb,
81 NULL,
82 GNUNET_FS_FLAGS_NONE,
83 GNUNET_FS_OPTIONS_END);
84 have = GNUNET_FS_collection_get (fsh);
85 GNUNET_assert (NULL != have);
86 GNUNET_FS_namespace_delete (have, GNUNET_NO);
87 GNUNET_FS_collection_publish (fsh);
88 GNUNET_FS_collection_stop (fsh);
89 GNUNET_assert (NULL == GNUNET_FS_collection_get (fsh));
90 GNUNET_FS_stop (fsh);
91}
92
93
94int
95main (int argc, char *argv[])
96{
97 int ok;
98
99 GNUNET_log_setup ("test_fs_collection",
100#if VERBOSE
101 "DEBUG",
102#else
103 "WARNING",
104#endif
105 NULL);
106 GNUNET_CRYPTO_random_disable_entropy_gathering ();
107 cfg = GNUNET_CONFIGURATION_create ();
108 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_parse (cfg,
109 "test_fs_collection_data.conf"))
110 {
111 GNUNET_CONFIGURATION_destroy (cfg);
112 return -1;
113 }
114 ok = GNUNET_YES;
115 GNUNET_SCHEDULER_run (&task, &ok);
116 GNUNET_CONFIGURATION_destroy (cfg);
117 return (ok == GNUNET_YES) ? 0 : 1;
118}
119
120/* end of test_fs_collection.c */
diff --git a/src/fs/test_fs_collection_data.conf b/src/fs/test_fs_collection_data.conf
deleted file mode 100644
index bb3c282e0..000000000
--- a/src/fs/test_fs_collection_data.conf
+++ /dev/null
@@ -1,38 +0,0 @@
1[PATHS]
2SERVICEHOME = /tmp/gnunet-test-fs-collection/
3
4[gnunetd]
5HOSTKEY = $SERVICEHOME/.hostkey
6
7[resolver]
8PORT = 42464
9HOSTNAME = localhost
10
11[transport]
12PORT = 42465
13PLUGINS =
14HOSTNAME = localhost
15
16[arm]
17PORT = 42466
18HOSTNAME = localhost
19
20[statistics]
21PORT = 42467
22HOSTNAME = localhost
23
24[peerinfo]
25PORT = 42469
26HOSTNAME = localhost
27
28[core]
29PORT = 42470
30HOSTNAME = localhost
31
32[fs]
33PORT = 42471
34HOSTNAME = localhost
35IDENTITY_DIR = $SERVICEHOME/identities/
36
37[TESTING]
38WEAKRANDOM = YES