diff options
Diffstat (limited to 'src/fs/test_fs_unindex_persistence.c')
-rw-r--r-- | src/fs/test_fs_unindex_persistence.c | 347 |
1 files changed, 171 insertions, 176 deletions
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 095c6961f..191dec57d 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c | |||
@@ -44,7 +44,7 @@ | |||
44 | 44 | ||
45 | /** | 45 | /** |
46 | * How long should our test-content live? | 46 | * How long should our test-content live? |
47 | */ | 47 | */ |
48 | #define LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) | 48 | #define LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) |
49 | 49 | ||
50 | struct PeerContext | 50 | struct PeerContext |
@@ -70,8 +70,7 @@ static char *fn; | |||
70 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 70 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
71 | 71 | ||
72 | static void | 72 | static void |
73 | abort_publish_task (void *cls, | 73 | abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
74 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
75 | { | 74 | { |
76 | GNUNET_FS_publish_stop (publish); | 75 | GNUNET_FS_publish_stop (publish); |
77 | publish = NULL; | 76 | publish = NULL; |
@@ -79,39 +78,35 @@ abort_publish_task (void *cls, | |||
79 | 78 | ||
80 | 79 | ||
81 | static void | 80 | static void |
82 | abort_unindex_task (void *cls, | 81 | abort_unindex_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
83 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
84 | { | 82 | { |
85 | if (unindex != NULL) | 83 | if (unindex != NULL) |
86 | { | 84 | { |
87 | GNUNET_FS_unindex_stop (unindex); | 85 | GNUNET_FS_unindex_stop (unindex); |
88 | unindex = NULL; | 86 | unindex = NULL; |
89 | } | 87 | } |
90 | if (fn != NULL) | 88 | if (fn != NULL) |
91 | { | 89 | { |
92 | GNUNET_DISK_directory_remove (fn); | 90 | GNUNET_DISK_directory_remove (fn); |
93 | GNUNET_free (fn); | 91 | GNUNET_free (fn); |
94 | fn = NULL; | 92 | fn = NULL; |
95 | } | 93 | } |
96 | } | 94 | } |
97 | 95 | ||
98 | 96 | ||
99 | static void * | 97 | static void *progress_cb (void *cls, |
100 | progress_cb (void *cls, | 98 | const struct GNUNET_FS_ProgressInfo *event); |
101 | const struct GNUNET_FS_ProgressInfo *event); | ||
102 | 99 | ||
103 | 100 | ||
104 | static void | 101 | static void |
105 | restart_fs_task (void *cls, | 102 | restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
106 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
107 | { | 103 | { |
108 | GNUNET_FS_stop (fs); | 104 | GNUNET_FS_stop (fs); |
109 | fs = GNUNET_FS_start (cfg, | 105 | fs = GNUNET_FS_start (cfg, |
110 | "test-fs-unindex-persistence", | 106 | "test-fs-unindex-persistence", |
111 | &progress_cb, | 107 | &progress_cb, |
112 | NULL, | 108 | NULL, |
113 | GNUNET_FS_FLAGS_PERSISTENCE, | 109 | GNUNET_FS_FLAGS_PERSISTENCE, GNUNET_FS_OPTIONS_END); |
114 | GNUNET_FS_OPTIONS_END); | ||
115 | } | 110 | } |
116 | 111 | ||
117 | 112 | ||
@@ -128,127 +123,130 @@ consider_restart (int ev) | |||
128 | static int prev[32]; | 123 | static int prev[32]; |
129 | static int off; | 124 | static int off; |
130 | int i; | 125 | int i; |
131 | for (i=0;i<off;i++) | 126 | |
127 | for (i = 0; i < off; i++) | ||
132 | if (prev[i] == ev) | 128 | if (prev[i] == ev) |
133 | return; | 129 | return; |
134 | prev[off++] = ev; | 130 | prev[off++] = ev; |
135 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_URGENT, | 131 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_URGENT, |
136 | &restart_fs_task, | 132 | &restart_fs_task, NULL); |
137 | NULL); | ||
138 | } | 133 | } |
139 | 134 | ||
140 | 135 | ||
141 | static void * | 136 | static void * |
142 | progress_cb (void *cls, | 137 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) |
143 | const struct GNUNET_FS_ProgressInfo *event) | ||
144 | { | 138 | { |
145 | switch (event->status) | 139 | switch (event->status) |
146 | { | 140 | { |
147 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 141 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
148 | #if VERBOSE | 142 | #if VERBOSE |
149 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 143 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
150 | (unsigned long long) event->value.publish.completed, | 144 | (unsigned long long) event->value.publish.completed, |
151 | (unsigned long long) event->value.publish.size, | 145 | (unsigned long long) event->value.publish.size, |
152 | event->value.publish.specifics.progress.depth, | 146 | event->value.publish.specifics.progress.depth, |
153 | (unsigned long long) event->value.publish.specifics.progress.offset); | 147 | (unsigned long long) event->value.publish.specifics. |
154 | #endif | 148 | progress.offset); |
155 | break; | 149 | #endif |
156 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 150 | break; |
157 | printf ("Publishing complete, %llu kbps.\n", | 151 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
158 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); | 152 | printf ("Publishing complete, %llu kbps.\n", |
159 | start = GNUNET_TIME_absolute_get (); | 153 | (unsigned long long) (FILESIZE * 1000 / |
160 | unindex = GNUNET_FS_unindex_start (fs, | 154 | (1 + |
161 | fn, | 155 | GNUNET_TIME_absolute_get_duration |
162 | "unindex"); | 156 | (start).rel_value) / 1024)); |
163 | GNUNET_assert (unindex != NULL); | 157 | start = GNUNET_TIME_absolute_get (); |
164 | break; | 158 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); |
165 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: | 159 | GNUNET_assert (unindex != NULL); |
166 | printf ("Unindex complete, %llu kbps.\n", | 160 | break; |
167 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); | 161 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: |
168 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, | 162 | printf ("Unindex complete, %llu kbps.\n", |
169 | NULL, | 163 | (unsigned long long) (FILESIZE * 1000 / |
170 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 164 | (1 + |
171 | break; | 165 | GNUNET_TIME_absolute_get_duration |
172 | case GNUNET_FS_STATUS_UNINDEX_PROGRESS: | 166 | (start).rel_value) / 1024)); |
173 | consider_restart (event->status); | 167 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, |
174 | GNUNET_assert (unindex == event->value.unindex.uc); | 168 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
169 | break; | ||
170 | case GNUNET_FS_STATUS_UNINDEX_PROGRESS: | ||
171 | consider_restart (event->status); | ||
172 | GNUNET_assert (unindex == event->value.unindex.uc); | ||
175 | #if VERBOSE | 173 | #if VERBOSE |
176 | printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", | 174 | printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", |
177 | (unsigned long long) event->value.unindex.completed, | 175 | (unsigned long long) event->value.unindex.completed, |
178 | (unsigned long long) event->value.unindex.size, | 176 | (unsigned long long) event->value.unindex.size, |
179 | event->value.unindex.specifics.progress.depth, | 177 | event->value.unindex.specifics.progress.depth, |
180 | (unsigned long long) event->value.unindex.specifics.progress.offset); | 178 | (unsigned long long) event->value.unindex.specifics. |
179 | progress.offset); | ||
181 | #endif | 180 | #endif |
182 | break; | 181 | break; |
183 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 182 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: |
184 | if (event->value.publish.pc == publish) | 183 | if (event->value.publish.pc == publish) |
185 | publish = NULL; | 184 | publish = NULL; |
186 | break; | 185 | break; |
187 | case GNUNET_FS_STATUS_PUBLISH_RESUME: | 186 | case GNUNET_FS_STATUS_PUBLISH_RESUME: |
188 | if (NULL == publish) | 187 | if (NULL == publish) |
189 | { | 188 | { |
190 | publish = event->value.publish.pc; | 189 | publish = event->value.publish.pc; |
191 | return "publish-context"; | 190 | return "publish-context"; |
192 | } | ||
193 | break; | ||
194 | case GNUNET_FS_STATUS_UNINDEX_SUSPEND: | ||
195 | GNUNET_assert (event->value.unindex.uc == unindex); | ||
196 | unindex = NULL; | ||
197 | break; | ||
198 | case GNUNET_FS_STATUS_UNINDEX_RESUME: | ||
199 | GNUNET_assert (NULL == unindex); | ||
200 | unindex = event->value.unindex.uc; | ||
201 | return "unindex"; | ||
202 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | ||
203 | fprintf (stderr, | ||
204 | "Error publishing file: %s\n", | ||
205 | event->value.publish.specifics.error.message); | ||
206 | GNUNET_break (0); | ||
207 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, | ||
208 | NULL, | ||
209 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
210 | break; | ||
211 | case GNUNET_FS_STATUS_UNINDEX_ERROR: | ||
212 | fprintf (stderr, | ||
213 | "Error unindexing file: %s\n", | ||
214 | event->value.unindex.specifics.error.message); | ||
215 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, | ||
216 | NULL, | ||
217 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
218 | break; | ||
219 | case GNUNET_FS_STATUS_PUBLISH_START: | ||
220 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); | ||
221 | GNUNET_assert (NULL == event->value.publish.pctx); | ||
222 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
223 | GNUNET_assert (0 == event->value.publish.completed); | ||
224 | GNUNET_assert (1 == event->value.publish.anonymity); | ||
225 | break; | ||
226 | case GNUNET_FS_STATUS_PUBLISH_STOPPED: | ||
227 | GNUNET_assert (publish == event->value.publish.pc); | ||
228 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
229 | GNUNET_assert (1 == event->value.publish.anonymity); | ||
230 | GNUNET_FS_stop (fs); | ||
231 | fs = NULL; | ||
232 | break; | ||
233 | case GNUNET_FS_STATUS_UNINDEX_START: | ||
234 | consider_restart (event->status); | ||
235 | GNUNET_assert (unindex == NULL); | ||
236 | GNUNET_assert (0 == strcmp ("unindex", event->value.unindex.cctx)); | ||
237 | GNUNET_assert (0 == strcmp (fn, event->value.unindex.filename)); | ||
238 | GNUNET_assert (FILESIZE == event->value.unindex.size); | ||
239 | GNUNET_assert (0 == event->value.unindex.completed); | ||
240 | break; | ||
241 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: | ||
242 | GNUNET_assert (unindex == event->value.unindex.uc); | ||
243 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, | ||
244 | NULL, | ||
245 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
246 | break; | ||
247 | default: | ||
248 | printf ("Unexpected event: %d\n", | ||
249 | event->status); | ||
250 | break; | ||
251 | } | 191 | } |
192 | break; | ||
193 | case GNUNET_FS_STATUS_UNINDEX_SUSPEND: | ||
194 | GNUNET_assert (event->value.unindex.uc == unindex); | ||
195 | unindex = NULL; | ||
196 | break; | ||
197 | case GNUNET_FS_STATUS_UNINDEX_RESUME: | ||
198 | GNUNET_assert (NULL == unindex); | ||
199 | unindex = event->value.unindex.uc; | ||
200 | return "unindex"; | ||
201 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | ||
202 | fprintf (stderr, | ||
203 | "Error publishing file: %s\n", | ||
204 | event->value.publish.specifics.error.message); | ||
205 | GNUNET_break (0); | ||
206 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, | ||
207 | NULL, | ||
208 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
209 | break; | ||
210 | case GNUNET_FS_STATUS_UNINDEX_ERROR: | ||
211 | fprintf (stderr, | ||
212 | "Error unindexing file: %s\n", | ||
213 | event->value.unindex.specifics.error.message); | ||
214 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, | ||
215 | NULL, | ||
216 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
217 | break; | ||
218 | case GNUNET_FS_STATUS_PUBLISH_START: | ||
219 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); | ||
220 | GNUNET_assert (NULL == event->value.publish.pctx); | ||
221 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
222 | GNUNET_assert (0 == event->value.publish.completed); | ||
223 | GNUNET_assert (1 == event->value.publish.anonymity); | ||
224 | break; | ||
225 | case GNUNET_FS_STATUS_PUBLISH_STOPPED: | ||
226 | GNUNET_assert (publish == event->value.publish.pc); | ||
227 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
228 | GNUNET_assert (1 == event->value.publish.anonymity); | ||
229 | GNUNET_FS_stop (fs); | ||
230 | fs = NULL; | ||
231 | break; | ||
232 | case GNUNET_FS_STATUS_UNINDEX_START: | ||
233 | consider_restart (event->status); | ||
234 | GNUNET_assert (unindex == NULL); | ||
235 | GNUNET_assert (0 == strcmp ("unindex", event->value.unindex.cctx)); | ||
236 | GNUNET_assert (0 == strcmp (fn, event->value.unindex.filename)); | ||
237 | GNUNET_assert (FILESIZE == event->value.unindex.size); | ||
238 | GNUNET_assert (0 == event->value.unindex.completed); | ||
239 | break; | ||
240 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: | ||
241 | GNUNET_assert (unindex == event->value.unindex.uc); | ||
242 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, | ||
243 | NULL, | ||
244 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
245 | break; | ||
246 | default: | ||
247 | printf ("Unexpected event: %d\n", event->status); | ||
248 | break; | ||
249 | } | ||
252 | return NULL; | 250 | return NULL; |
253 | } | 251 | } |
254 | 252 | ||
@@ -259,11 +257,11 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
259 | p->cfg = GNUNET_CONFIGURATION_create (); | 257 | p->cfg = GNUNET_CONFIGURATION_create (); |
260 | #if START_ARM | 258 | #if START_ARM |
261 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 259 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
262 | "gnunet-service-arm", | 260 | "gnunet-service-arm", |
263 | #if VERBOSE | 261 | #if VERBOSE |
264 | "-L", "DEBUG", | 262 | "-L", "DEBUG", |
265 | #endif | 263 | #endif |
266 | "-c", cfgname, NULL); | 264 | "-c", cfgname, NULL); |
267 | #endif | 265 | #endif |
268 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 266 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
269 | } | 267 | } |
@@ -274,16 +272,17 @@ stop_arm (struct PeerContext *p) | |||
274 | { | 272 | { |
275 | #if START_ARM | 273 | #if START_ARM |
276 | if (NULL != p->arm_proc) | 274 | if (NULL != p->arm_proc) |
277 | { | 275 | { |
278 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) | 276 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
279 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 277 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
280 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) | 278 | if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) |
281 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 279 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
282 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 280 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
283 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); | 281 | "ARM process %u stopped\n", |
284 | GNUNET_OS_process_close (p->arm_proc); | 282 | GNUNET_OS_process_get_pid (p->arm_proc)); |
285 | p->arm_proc = NULL; | 283 | GNUNET_OS_process_close (p->arm_proc); |
286 | } | 284 | p->arm_proc = NULL; |
285 | } | ||
287 | #endif | 286 | #endif |
288 | GNUNET_CONFIGURATION_destroy (p->cfg); | 287 | GNUNET_CONFIGURATION_destroy (p->cfg); |
289 | } | 288 | } |
@@ -292,8 +291,7 @@ stop_arm (struct PeerContext *p) | |||
292 | static void | 291 | static void |
293 | run (void *cls, | 292 | run (void *cls, |
294 | char *const *args, | 293 | char *const *args, |
295 | const char *cfgfile, | 294 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) |
296 | const struct GNUNET_CONFIGURATION_Handle *c) | ||
297 | { | 295 | { |
298 | const char *keywords[] = { | 296 | const char *keywords[] = { |
299 | "down_foo", | 297 | "down_foo", |
@@ -310,20 +308,20 @@ run (void *cls, | |||
310 | setup_peer (&p1, "test_fs_unindex_data.conf"); | 308 | setup_peer (&p1, "test_fs_unindex_data.conf"); |
311 | fn = GNUNET_DISK_mktemp ("gnunet-unindex-test-dst"); | 309 | fn = GNUNET_DISK_mktemp ("gnunet-unindex-test-dst"); |
312 | fs = GNUNET_FS_start (cfg, | 310 | fs = GNUNET_FS_start (cfg, |
313 | "test-fs-unindex-persistence", | 311 | "test-fs-unindex-persistence", |
314 | &progress_cb, | 312 | &progress_cb, |
315 | NULL, | 313 | NULL, |
316 | GNUNET_FS_FLAGS_PERSISTENCE, | 314 | GNUNET_FS_FLAGS_PERSISTENCE, GNUNET_FS_OPTIONS_END); |
317 | GNUNET_FS_OPTIONS_END); | 315 | GNUNET_assert (NULL != fs); |
318 | GNUNET_assert (NULL != fs); | ||
319 | buf = GNUNET_malloc (FILESIZE); | 316 | buf = GNUNET_malloc (FILESIZE); |
320 | for (i = 0; i < FILESIZE; i++) | 317 | for (i = 0; i < FILESIZE; i++) |
321 | buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); | 318 | buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); |
322 | GNUNET_assert (FILESIZE == | 319 | GNUNET_assert (FILESIZE == |
323 | GNUNET_DISK_fn_write (fn, | 320 | GNUNET_DISK_fn_write (fn, |
324 | buf, | 321 | buf, |
325 | FILESIZE, | 322 | FILESIZE, |
326 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE)); | 323 | GNUNET_DISK_PERM_USER_READ | |
324 | GNUNET_DISK_PERM_USER_WRITE)); | ||
327 | GNUNET_free (buf); | 325 | GNUNET_free (buf); |
328 | meta = GNUNET_CONTAINER_meta_data_create (); | 326 | meta = GNUNET_CONTAINER_meta_data_create (); |
329 | kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); | 327 | kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); |
@@ -332,20 +330,18 @@ run (void *cls, | |||
332 | bo.replication_level = 0; | 330 | bo.replication_level = 0; |
333 | bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME); | 331 | bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME); |
334 | fi = GNUNET_FS_file_information_create_from_file (fs, | 332 | fi = GNUNET_FS_file_information_create_from_file (fs, |
335 | "publish-context", | 333 | "publish-context", |
336 | fn, | 334 | fn, |
337 | kuri, | 335 | kuri, |
338 | meta, | 336 | meta, GNUNET_YES, &bo); |
339 | GNUNET_YES, | ||
340 | &bo); | ||
341 | GNUNET_FS_uri_destroy (kuri); | 337 | GNUNET_FS_uri_destroy (kuri); |
342 | GNUNET_CONTAINER_meta_data_destroy (meta); | 338 | GNUNET_CONTAINER_meta_data_destroy (meta); |
343 | GNUNET_assert (NULL != fi); | 339 | GNUNET_assert (NULL != fi); |
344 | start = GNUNET_TIME_absolute_get (); | 340 | start = GNUNET_TIME_absolute_get (); |
345 | publish = GNUNET_FS_publish_start (fs, | 341 | publish = GNUNET_FS_publish_start (fs, |
346 | fi, | 342 | fi, |
347 | NULL, NULL, NULL, | 343 | NULL, NULL, NULL, |
348 | GNUNET_FS_PUBLISH_OPTION_NONE); | 344 | GNUNET_FS_PUBLISH_OPTION_NONE); |
349 | GNUNET_assert (publish != NULL); | 345 | GNUNET_assert (publish != NULL); |
350 | } | 346 | } |
351 | 347 | ||
@@ -353,7 +349,7 @@ run (void *cls, | |||
353 | int | 349 | int |
354 | main (int argc, char *argv[]) | 350 | main (int argc, char *argv[]) |
355 | { | 351 | { |
356 | char *const argvx[] = { | 352 | char *const argvx[] = { |
357 | "test-fs-unindex", | 353 | "test-fs-unindex", |
358 | "-c", | 354 | "-c", |
359 | "test_fs_unindex_data.conf", | 355 | "test_fs_unindex_data.conf", |
@@ -366,23 +362,22 @@ main (int argc, char *argv[]) | |||
366 | GNUNET_GETOPT_OPTION_END | 362 | GNUNET_GETOPT_OPTION_END |
367 | }; | 363 | }; |
368 | 364 | ||
369 | GNUNET_log_setup ("test_fs_unindex_persistence", | 365 | GNUNET_log_setup ("test_fs_unindex_persistence", |
370 | #if VERBOSE | 366 | #if VERBOSE |
371 | "DEBUG", | 367 | "DEBUG", |
372 | #else | 368 | #else |
373 | "WARNING", | 369 | "WARNING", |
374 | #endif | 370 | #endif |
375 | NULL); | 371 | NULL); |
376 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, | 372 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, |
377 | argvx, "test-fs-unindex", | 373 | argvx, "test-fs-unindex", "nohelp", options, &run, NULL); |
378 | "nohelp", options, &run, NULL); | ||
379 | stop_arm (&p1); | 374 | stop_arm (&p1); |
380 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/"); | 375 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/"); |
381 | if (NULL != fn) | 376 | if (NULL != fn) |
382 | { | 377 | { |
383 | GNUNET_DISK_directory_remove (fn); | 378 | GNUNET_DISK_directory_remove (fn); |
384 | GNUNET_free (fn); | 379 | GNUNET_free (fn); |
385 | } | 380 | } |
386 | return 0; | 381 | return 0; |
387 | } | 382 | } |
388 | 383 | ||