diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-05-09 17:33:04 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-05-09 17:33:04 +0200 |
commit | 8bb475af99260f1d107dbc8908268ae93960aa83 (patch) | |
tree | 1a7a1fc03424df841a6f977b137482439b09bc9f /src/namestore/test_namestore_api_monitoring_existing.c | |
parent | 1f80a11e90ee982bffaae4685e281f75ee1c225d (diff) | |
download | gnunet-8bb475af99260f1d107dbc8908268ae93960aa83.tar.gz gnunet-8bb475af99260f1d107dbc8908268ae93960aa83.zip |
implement new functions in libgnunetsq, clean up sqlite namestore plugin, implement flow control in namestore API and tests
Diffstat (limited to 'src/namestore/test_namestore_api_monitoring_existing.c')
-rw-r--r-- | src/namestore/test_namestore_api_monitoring_existing.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c index f6a74609e..25c098fe3 100644 --- a/src/namestore/test_namestore_api_monitoring_existing.c +++ b/src/namestore/test_namestore_api_monitoring_existing.c | |||
@@ -57,8 +57,6 @@ static struct GNUNET_GNSRECORD_Data *s_rd_3; | |||
57 | 57 | ||
58 | struct GNUNET_NAMESTORE_QueueEntry * ns_ops[3]; | 58 | struct GNUNET_NAMESTORE_QueueEntry * ns_ops[3]; |
59 | 59 | ||
60 | static char *directory; | ||
61 | |||
62 | 60 | ||
63 | static void | 61 | static void |
64 | do_shutdown () | 62 | do_shutdown () |
@@ -316,30 +314,14 @@ run (void *cls, | |||
316 | const struct GNUNET_CONFIGURATION_Handle *mycfg, | 314 | const struct GNUNET_CONFIGURATION_Handle *mycfg, |
317 | struct GNUNET_TESTING_Peer *peer) | 315 | struct GNUNET_TESTING_Peer *peer) |
318 | { | 316 | { |
319 | char *hostkey_file; | ||
320 | |||
321 | directory = NULL; | ||
322 | GNUNET_assert (GNUNET_OK == | ||
323 | GNUNET_CONFIGURATION_get_value_string (mycfg, | ||
324 | "PATHS", | ||
325 | "GNUNET_TEST_HOME", | ||
326 | &directory)); | ||
327 | GNUNET_DISK_directory_remove (directory); | ||
328 | |||
329 | res = 1; | 317 | res = 1; |
330 | 318 | privkey = GNUNET_CRYPTO_ecdsa_key_create (); | |
331 | GNUNET_asprintf(&hostkey_file, | ||
332 | "zonefiles%s%s", | ||
333 | DIR_SEPARATOR_STR, | ||
334 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | ||
335 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
336 | "Using zonekey file `%s' \n", hostkey_file); | ||
337 | privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file); | ||
338 | GNUNET_free (hostkey_file); | ||
339 | GNUNET_assert (privkey != NULL); | 319 | GNUNET_assert (privkey != NULL); |
340 | 320 | ||
341 | cfg = mycfg; | 321 | cfg = mycfg; |
342 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &endbadly, NULL); | 322 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
323 | &endbadly, | ||
324 | NULL); | ||
343 | /* Connect to namestore */ | 325 | /* Connect to namestore */ |
344 | nsh = GNUNET_NAMESTORE_connect (cfg); | 326 | nsh = GNUNET_NAMESTORE_connect (cfg); |
345 | if (NULL == nsh) | 327 | if (NULL == nsh) |
@@ -350,12 +332,7 @@ run (void *cls, | |||
350 | return; | 332 | return; |
351 | } | 333 | } |
352 | 334 | ||
353 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s", | 335 | privkey2 = GNUNET_CRYPTO_ecdsa_key_create (); |
354 | DIR_SEPARATOR_STR, | ||
355 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); | ||
356 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | ||
357 | privkey2 = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file); | ||
358 | GNUNET_free (hostkey_file); | ||
359 | GNUNET_assert (privkey2 != NULL); | 336 | GNUNET_assert (privkey2 != NULL); |
360 | 337 | ||
361 | 338 | ||
@@ -397,6 +374,8 @@ main (int argc, char *argv[]) | |||
397 | "test_namestore_api_%s.conf", | 374 | "test_namestore_api_%s.conf", |
398 | plugin_name); | 375 | plugin_name); |
399 | res = 1; | 376 | res = 1; |
377 | GNUNET_DISK_purge_cfg_dir (cfg_name, | ||
378 | "GNUNET_TEST_HOME"); | ||
400 | if (0 != | 379 | if (0 != |
401 | GNUNET_TESTING_peer_run ("test-namestore-api-monitoring-existing", | 380 | GNUNET_TESTING_peer_run ("test-namestore-api-monitoring-existing", |
402 | cfg_name, | 381 | cfg_name, |
@@ -405,12 +384,9 @@ main (int argc, char *argv[]) | |||
405 | { | 384 | { |
406 | res = 1; | 385 | res = 1; |
407 | } | 386 | } |
387 | GNUNET_DISK_purge_cfg_dir (cfg_name, | ||
388 | "GNUNET_TEST_HOME"); | ||
408 | GNUNET_free (cfg_name); | 389 | GNUNET_free (cfg_name); |
409 | if (NULL != directory) | ||
410 | { | ||
411 | GNUNET_DISK_directory_remove (directory); | ||
412 | GNUNET_free (directory); | ||
413 | } | ||
414 | return res; | 390 | return res; |
415 | } | 391 | } |
416 | 392 | ||