#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_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,
daemon->download_seed = seed;
daemon->download_context = GNUNET_FS_download_start (daemon->fs,
uri,
- NULL,
+ NULL, NULL,
NULL,
0,
size,