diff options
Diffstat (limited to 'src/gns/test_gns_revocation.c')
-rw-r--r-- | src/gns/test_gns_revocation.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/gns/test_gns_revocation.c b/src/gns/test_gns_revocation.c index a538ab3e7..691d8c124 100644 --- a/src/gns/test_gns_revocation.c +++ b/src/gns/test_gns_revocation.c | |||
@@ -32,15 +32,9 @@ | |||
32 | #include "gnunet_dnsparser_lib.h" | 32 | #include "gnunet_dnsparser_lib.h" |
33 | #include "gnunet_gns_service.h" | 33 | #include "gnunet_gns_service.h" |
34 | 34 | ||
35 | /* DEFINES */ | ||
36 | #define VERBOSE GNUNET_YES | ||
37 | |||
38 | /* Timeout for entire testcase */ | 35 | /* Timeout for entire testcase */ |
39 | #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 20) | 36 | #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 20) |
40 | 37 | ||
41 | /* If number of peers not in config file, use this number */ | ||
42 | #define DEFAULT_NUM_PEERS 2 | ||
43 | |||
44 | /* test records to resolve */ | 38 | /* test records to resolve */ |
45 | #define TEST_DOMAIN "www.bob.gads" | 39 | #define TEST_DOMAIN "www.bob.gads" |
46 | #define TEST_IP "127.0.0.1" | 40 | #define TEST_IP "127.0.0.1" |
@@ -50,10 +44,8 @@ | |||
50 | 44 | ||
51 | #define KEYFILE_BOB "../namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey" | 45 | #define KEYFILE_BOB "../namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey" |
52 | 46 | ||
53 | /* Globals */ | ||
54 | |||
55 | /* Task handle to use to schedule test failure */ | 47 | /* Task handle to use to schedule test failure */ |
56 | GNUNET_SCHEDULER_TaskIdentifier die_task; | 48 | static GNUNET_SCHEDULER_TaskIdentifier die_task; |
57 | 49 | ||
58 | /* Global return value (0 for success, anything else for failure) */ | 50 | /* Global return value (0 for success, anything else for failure) */ |
59 | static int ok; | 51 | static int ok; |
@@ -62,7 +54,8 @@ static struct GNUNET_NAMESTORE_Handle *namestore_handle; | |||
62 | 54 | ||
63 | static struct GNUNET_GNS_Handle *gns_handle; | 55 | static struct GNUNET_GNS_Handle *gns_handle; |
64 | 56 | ||
65 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 57 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
58 | |||
66 | 59 | ||
67 | /** | 60 | /** |
68 | * Check if the get_handle is being used, if so stop the request. Either | 61 | * Check if the get_handle is being used, if so stop the request. Either |
@@ -89,6 +82,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
89 | ok = 1; | 82 | ok = 1; |
90 | } | 83 | } |
91 | 84 | ||
85 | |||
92 | static void | 86 | static void |
93 | end_badly_now () | 87 | end_badly_now () |
94 | { | 88 | { |
@@ -96,14 +90,17 @@ end_badly_now () | |||
96 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 90 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
97 | } | 91 | } |
98 | 92 | ||
99 | static void shutdown_task (void *cls, | 93 | |
100 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 94 | static void |
95 | shutdown_task (void *cls, | ||
96 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
101 | { | 97 | { |
102 | GNUNET_GNS_disconnect(gns_handle); | 98 | GNUNET_GNS_disconnect(gns_handle); |
103 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n"); | 99 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n"); |
104 | GNUNET_SCHEDULER_shutdown (); | 100 | GNUNET_SCHEDULER_shutdown (); |
105 | } | 101 | } |
106 | 102 | ||
103 | |||
107 | static void | 104 | static void |
108 | on_lookup_result(void *cls, uint32_t rd_count, | 105 | on_lookup_result(void *cls, uint32_t rd_count, |
109 | const struct GNUNET_NAMESTORE_RecordData *rd) | 106 | const struct GNUNET_NAMESTORE_RecordData *rd) |
@@ -272,18 +269,13 @@ do_check (void *cls, | |||
272 | } | 269 | } |
273 | 270 | ||
274 | 271 | ||
275 | |||
276 | int | 272 | int |
277 | main (int argc, char *argv[]) | 273 | main (int argc, char *argv[]) |
278 | { | 274 | { |
279 | ok = 1; | 275 | ok = 1; |
280 | 276 | ||
281 | GNUNET_log_setup ("test-gns-revocation", | 277 | GNUNET_log_setup ("test-gns-revocation", |
282 | #if VERBOSE | ||
283 | "DEBUG", | ||
284 | #else | ||
285 | "WARNING", | 278 | "WARNING", |
286 | #endif | ||
287 | NULL); | 279 | NULL); |
288 | GNUNET_TESTING_peer_run ("test-gns-revocation", "test_gns_simple_lookup.conf", &do_check, NULL); | 280 | GNUNET_TESTING_peer_run ("test-gns-revocation", "test_gns_simple_lookup.conf", &do_check, NULL); |
289 | return ok; | 281 | return ok; |