aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2012-09-06 16:01:03 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2012-09-06 16:01:03 +0000
commit962667aa1749fafa7ae02a9cb5310f21567541d1 (patch)
treed62b9a00e993715d8b50267f50d28d1f50ee43e8 /src/gns
parent760d2d696450ef550abf99e16f4092b8050a9f4c (diff)
downloadgnunet-962667aa1749fafa7ae02a9cb5310f21567541d1.tar.gz
gnunet-962667aa1749fafa7ae02a9cb5310f21567541d1.zip
-really fix test
Diffstat (limited to 'src/gns')
-rw-r--r--src/gns/test_gns_dht_default.conf2
-rw-r--r--src/gns/test_gns_dht_three_peers.c25
2 files changed, 15 insertions, 12 deletions
diff --git a/src/gns/test_gns_dht_default.conf b/src/gns/test_gns_dht_default.conf
index ad640326c..b2897509a 100644
--- a/src/gns/test_gns_dht_default.conf
+++ b/src/gns/test_gns_dht_default.conf
@@ -71,7 +71,7 @@ CONFIG = $DEFAULTCONFIG
71AUTO_IMPORT_PKEY = NO 71AUTO_IMPORT_PKEY = NO
72MAX_PARALLEL_BACKGROUND_QUERIES = 10 72MAX_PARALLEL_BACKGROUND_QUERIES = 10
73DEFAULT_LOOKUP_TIMEOUT = 10 73DEFAULT_LOOKUP_TIMEOUT = 10
74RECORD_PUT_INTERVAL = 5 s 74RECORD_PUT_INTERVAL = 2 s
75 75
76[namestore] 76[namestore]
77PORT = 22371 77PORT = 22371
diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c
index e67180934..204cbc29e 100644
--- a/src/gns/test_gns_dht_three_peers.c
+++ b/src/gns/test_gns_dht_three_peers.c
@@ -40,7 +40,7 @@
40#include "gnunet_dnsparser_lib.h" 40#include "gnunet_dnsparser_lib.h"
41#include "gnunet_gns_service.h" 41#include "gnunet_gns_service.h"
42 42
43#define ZONE_PUT_WAIT_TIME GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 10) 43#define ZONE_PUT_WAIT_TIME GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)
44 44
45/* If number of peers not in config file, use this number */ 45/* If number of peers not in config file, use this number */
46#define DEFAULT_NUM_PEERS 2 46#define DEFAULT_NUM_PEERS 2
@@ -53,7 +53,7 @@
53 53
54 54
55/* Timeout for entire testcase */ 55/* Timeout for entire testcase */
56#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30) 56#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60)
57 57
58/* Global return value (0 for success, anything else for failure) */ 58/* Global return value (0 for success, anything else for failure) */
59static int ok; 59static int ok;
@@ -142,6 +142,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
142static void 142static void
143end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 143end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
144{ 144{
145 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Finished\n");
145 int c; 146 int c;
146 if (GNUNET_SCHEDULER_NO_TASK != die_task) 147 if (GNUNET_SCHEDULER_NO_TASK != die_task)
147 { 148 {
@@ -231,6 +232,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
231 "%s correctly resolved to %s!\n", TEST_DOMAIN, string_val); 232 "%s correctly resolved to %s!\n", TEST_DOMAIN, string_val);
232 ok = 0; 233 ok = 0;
233 } 234 }
235 GNUNET_free (string_val);
234 } 236 }
235 } 237 }
236 end_now (); 238 end_now ();
@@ -272,7 +274,7 @@ static void connect_peers ()
272{ 274{
273 static int started; 275 static int started;
274 started ++; 276 started ++;
275 277GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "C \n");
276 if (3 == started) 278 if (3 == started)
277 { 279 {
278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers started\n"); 280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers started\n");
@@ -301,7 +303,8 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg)
301 struct GNUNET_NAMESTORE_RecordData rd; 303 struct GNUNET_NAMESTORE_RecordData rd;
302 304
303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up dave\n"); 305 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up dave\n");
304 GNUNET_assert (NULL != cfg); 306 cfg_handles[0] = GNUNET_CONFIGURATION_dup (cfg);
307 GNUNET_assert (NULL != cfg_handles[0]);
305 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", 308 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
306 "ZONEKEY", 309 "ZONEKEY",
307 &keyfile)) 310 &keyfile))
@@ -318,7 +321,6 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg)
318 GNUNET_free (keyfile); 321 GNUNET_free (keyfile);
319 return GNUNET_SYSERR; 322 return GNUNET_SYSERR;
320 } 323 }
321
322 nh[0] = GNUNET_NAMESTORE_connect (cfg_handles[0]); 324 nh[0] = GNUNET_NAMESTORE_connect (cfg_handles[0]);
323 if (NULL == nh[0]) 325 if (NULL == nh[0])
324 { 326 {
@@ -363,7 +365,8 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg)
363 struct GNUNET_NAMESTORE_RecordData rd; 365 struct GNUNET_NAMESTORE_RecordData rd;
364 366
365 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n"); 367 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n");
366 GNUNET_assert (NULL != cfg); 368 cfg_handles[1] = GNUNET_CONFIGURATION_dup (cfg);
369 GNUNET_assert (NULL != cfg_handles[1]);
367 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", 370 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
368 "ZONEKEY", 371 "ZONEKEY",
369 &keyfile)) 372 &keyfile))
@@ -381,7 +384,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg)
381 return GNUNET_SYSERR; 384 return GNUNET_SYSERR;
382 } 385 }
383 386
384 nh[1] = GNUNET_NAMESTORE_connect (cfg); 387 nh[1] = GNUNET_NAMESTORE_connect (cfg_handles[1]);
385 if (NULL == nh[1]) 388 if (NULL == nh[1])
386 { 389 {
387 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); 390 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
@@ -414,7 +417,7 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg)
414 struct GNUNET_CRYPTO_RsaPrivateKey *key; 417 struct GNUNET_CRYPTO_RsaPrivateKey *key;
415 struct GNUNET_NAMESTORE_RecordData rd; 418 struct GNUNET_NAMESTORE_RecordData rd;
416 419
417 420 cfg_handles[2] = GNUNET_CONFIGURATION_dup (cfg);
418 GNUNET_assert (NULL != cfg); 421 GNUNET_assert (NULL != cfg);
419 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", 422 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
420 "ZONEKEY", 423 "ZONEKEY",
@@ -490,7 +493,7 @@ peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
490 const char *emsg) 493 const char *emsg)
491{ 494{
492 int res; 495 int res;
493 496GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "X \n");
494 GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit); 497 GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit);
495 if (GNUNET_NO == dave_is_setup) 498 if (GNUNET_NO == dave_is_setup)
496 res = setup_dave (pinfo->result.cfg); 499 res = setup_dave (pinfo->result.cfg);
@@ -501,7 +504,7 @@ peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
501 504
502 GNUNET_TESTBED_operation_done (op); 505 GNUNET_TESTBED_operation_done (op);
503 op = NULL; 506 op = NULL;
504 507 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "A \n");
505 if (GNUNET_SYSERR == res) 508 if (GNUNET_SYSERR == res)
506 { 509 {
507 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup peer \n"); 510 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup peer \n");
@@ -509,7 +512,7 @@ peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
509 } 512 }
510 else 513 else
511 connect_peers (); 514 connect_peers ();
512 515 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "B \n");
513 /*if (get_cfg_ops[0] == op) 516 /*if (get_cfg_ops[0] == op)
514 { 517 {
515 GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit); 518 GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit);