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
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
#include "platform.h"
#include "fs_test_lib.h"
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
/**
* File-size we use for testing.
/**
* How long until we give up on transmitting the message?
*/
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
#define NUM_DAEMONS 2
static struct GNUNET_SCHEDULER_Handle *sched;
+static int ret;
static void
do_stop (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE));
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Finished download, shutting down\n",
- (unsigned long long) FILESIZE);
+ if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
+ {
+ GNUNET_break (0);
+ ret = 1;
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Finished download, shutting down\n",
+ (unsigned long long) FILESIZE);
+ }
GNUNET_FS_TEST_daemons_stop (sched,
NUM_DAEMONS,
daemons);
do_download (void *cls,
const struct GNUNET_FS_Uri *uri)
{
- GNUNET_assert (NULL != uri);
+ if (NULL == uri)
+ {
+ GNUNET_break (0);
+ GNUNET_SCHEDULER_add_now (sched,
+ &do_stop,
+ NULL);
+ ret = 1;
+ return;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Downloading %llu bytes\n",
(unsigned long long) FILESIZE);
do_publish (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE));
+ if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
+ {
+ GNUNET_break (0);
+ ret = 1;
+ GNUNET_SCHEDULER_add_now (sched,
+ &do_stop,
+ NULL);
+ return;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Publishing %llu bytes\n",
(unsigned long long) FILESIZE);
do_connect (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE));
+ if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
+ {
+ GNUNET_break (0);
+ ret = 1;
+ GNUNET_SCHEDULER_add_now (sched,
+ &do_stop,
+ NULL);
+ return;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Daemons started, will now try to connect them\n");
GNUNET_FS_TEST_daemons_connect (sched,
{
sched = s;
GNUNET_FS_TEST_daemons_start (sched,
+ "fs_test_lib_data.conf",
TIMEOUT,
NUM_DAEMONS,
daemons,
argvx, "test-fs-test-lib",
"nohelp", options, &run, NULL);
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
- return 0;
+ return ret;
}
-/* end of test_gnunet_service_fs_p2p.c */
+/* end of test_fs_test_lib.c */