X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fgns%2Ftest_gns_max_queries.c;h=82273798ff06f54116a61885c8537f205efe941b;hb=5a3caf73608d411566cce83fd470a8c758d935a5;hp=e94c57f059e90f57edc953b1feb04fa247ca109f;hpb=eb2f7ab009637c279a6bbf227ddfc54a8e2b08e3;p=oweals%2Fgnunet.git diff --git a/src/gns/test_gns_max_queries.c b/src/gns/test_gns_max_queries.c index e94c57f05..82273798f 100644 --- a/src/gns/test_gns_max_queries.c +++ b/src/gns/test_gns_max_queries.c @@ -32,18 +32,13 @@ #include "gnunet_dnsparser_lib.h" #include "gnunet_gns_service.h" -/* DEFINES */ -#define VERBOSE GNUNET_YES /* Timeout for entire testcase */ #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 20) -/* If number of peers not in config file, use this number */ -#define DEFAULT_NUM_PEERS 2 - /* test records to resolve */ -#define TEST_DOMAIN "www.gnunet" -#define TEST_DOMAIN_NACK "doesnotexist.bob.gnunet" +#define TEST_DOMAIN "www.gads" +#define TEST_DOMAIN_NACK "doesnotexist.bob.gads" #define TEST_IP "127.0.0.1" #define TEST_RECORD_NAME "www" #define TEST_ADDITIONAL_LOOKUPS 5 @@ -51,18 +46,8 @@ #define KEYFILE_BOB "../namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey" -/* Globals */ - -/** - * Directory to store temp data in, defined in config file - */ -static char *test_directory; - -struct GNUNET_TESTING_Daemon *d1; - - /* Task handle to use to schedule test failure */ -GNUNET_SCHEDULER_TaskIdentifier die_task; +static GNUNET_SCHEDULER_TaskIdentifier die_task; /* Global return value (0 for success, anything else for failure) */ static int ok; @@ -71,30 +56,89 @@ static struct GNUNET_NAMESTORE_Handle *namestore_handle; static struct GNUNET_GNS_Handle *gns_handle; -const struct GNUNET_CONFIGURATION_Handle *cfg; +static const struct GNUNET_CONFIGURATION_Handle *cfg; static unsigned long long max_parallel_lookups; +static struct GNUNET_GNS_LookupRequest **requests; + +static unsigned int num_requests; + + /** - * Check whether peers successfully shut down. + * Check if the get_handle is being used, if so stop the request. Either + * way, schedule the end_badly_cont function which actually shuts down the + * test. */ -void -shutdown_callback (void *cls, const char *emsg) +static void +end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (emsg != NULL) + unsigned int i; + + for (i=0;i