#include "fs_test_lib.h"
#include "gnunet_testing_lib.h"
+#define CONNECT_ATTEMPTS 4
/**
* Handle for a daemon started for testing FS.
daemon,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
+ case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
+ if (daemon->verbose)
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Download at %llu/%llu bytes\n",
+ (unsigned long long) info->value.download.completed,
+ (unsigned long long) info->value.download.size);
+ break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
GNUNET_SCHEDULER_cancel (daemon->download_sched,
daemon->download_timeout_task);
daemon,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
+ case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE:
+ case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE:
+ break;
/* FIXME: monitor data correctness during download progress */
/* FIXME: do performance reports given sufficient verbosity */
/* FIXME: advance timeout task to "immediate" on error */
struct StartContext *sctx = cls;
unsigned int i;
- GNUNET_TESTING_daemons_stop (sctx->group);
+ GNUNET_TESTING_daemons_stop (sctx->group, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30));
for (i=0;i<sctx->total;i++)
{
if (i < sctx->have)
sctx->group = GNUNET_TESTING_daemons_start (sched,
sctx->cfg,
total,
+ timeout,
+ NULL,
+ NULL,
¬ify_running,
sctx,
NULL, NULL,
GNUNET_TESTING_daemons_connect (daemon1->daemon,
daemon2->daemon,
timeout,
+ CONNECT_ATTEMPTS,
¬ify_connection,
ncc);
}
unsigned int i;
GNUNET_assert (total > 0);
- GNUNET_TESTING_daemons_stop (daemons[0]->group);
+ GNUNET_TESTING_daemons_stop (daemons[0]->group, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30));
for (i=0;i<total;i++)
{
GNUNET_FS_stop (daemons[i]->fs);
struct GNUNET_FS_TestDaemon *daemon = cls;
uint64_t pos;
uint8_t *cbuf = buf;
+ int mod;
for (pos=0;pos<max;pos++)
- cbuf[pos] = (uint8_t) ((offset * daemon->publish_seed) % (255 - (offset / 1024 / 32)));
+ {
+ mod = (255 - (offset / 1024 / 32));
+ if (mod == 0)
+ mod = 1;
+ cbuf[pos] = (uint8_t) ((offset * daemon->publish_seed) % mod);
+ }
return max;
}
daemon->publish_seed = seed;
daemon->verbose = verbose;
daemon->publish_sched = sched;
- fi = GNUNET_FS_file_information_create_from_reader (daemon,
+ fi = GNUNET_FS_file_information_create_from_reader (daemon->fs,
+ daemon,
size,
&file_generator,
daemon,
struct GNUNET_FS_TestDaemon *daemon = cls;
daemon->download_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_FS_download_stop (daemon->download_context, GNUNET_YES);
+ daemon->download_context = NULL;
GNUNET_SCHEDULER_add_continuation (daemon->download_sched,
daemon->download_cont,
daemon->download_cont_cls,
daemon->download_seed = seed;
daemon->download_context = GNUNET_FS_download_start (daemon->fs,
uri,
- NULL,
+ NULL, NULL,
NULL,
0,
size,