aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_lookup_public.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-09 17:33:04 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-09 17:33:04 +0200
commit8bb475af99260f1d107dbc8908268ae93960aa83 (patch)
tree1a7a1fc03424df841a6f977b137482439b09bc9f /src/namestore/test_namestore_api_lookup_public.c
parent1f80a11e90ee982bffaae4685e281f75ee1c225d (diff)
downloadgnunet-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_lookup_public.c')
-rw-r--r--src/namestore/test_namestore_api_lookup_public.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/namestore/test_namestore_api_lookup_public.c b/src/namestore/test_namestore_api_lookup_public.c
index 02ca16042..28a68daf9 100644
--- a/src/namestore/test_namestore_api_lookup_public.c
+++ b/src/namestore/test_namestore_api_lookup_public.c
@@ -51,7 +51,6 @@ static struct GNUNET_NAMESTORE_QueueEntry *nsqe;
51 51
52static struct GNUNET_NAMECACHE_QueueEntry *ncqe; 52static struct GNUNET_NAMECACHE_QueueEntry *ncqe;
53 53
54static char *directory;
55 54
56static void 55static void
57cleanup () 56cleanup ()
@@ -190,26 +189,15 @@ run (void *cls,
190 struct GNUNET_TESTING_Peer *peer) 189 struct GNUNET_TESTING_Peer *peer)
191{ 190{
192 struct GNUNET_GNSRECORD_Data rd; 191 struct GNUNET_GNSRECORD_Data rd;
193 char *hostkey_file;
194 const char * name = "dummy.dummy.gnunet"; 192 const char * name = "dummy.dummy.gnunet";
195 193
196 directory = NULL;
197 GNUNET_assert (GNUNET_OK ==
198 GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory));
199 GNUNET_DISK_directory_remove (directory);
200
201 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 194 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
202 &endbadly, NULL); 195 &endbadly,
203 GNUNET_asprintf (&hostkey_file, 196 NULL);
204 "zonefiles%s%s", 197 privkey = GNUNET_CRYPTO_ecdsa_key_create ();
205 DIR_SEPARATOR_STR,
206 "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
207 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file);
208 privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
209 GNUNET_free (hostkey_file);
210 GNUNET_assert (privkey != NULL); 198 GNUNET_assert (privkey != NULL);
211 GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey); 199 GNUNET_CRYPTO_ecdsa_key_get_public (privkey,
212 200 &pubkey);
213 201
214 rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000; 202 rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000;
215 rd.record_type = TEST_RECORD_TYPE; 203 rd.record_type = TEST_RECORD_TYPE;
@@ -244,6 +232,8 @@ main (int argc, char *argv[])
244 GNUNET_asprintf (&cfg_name, 232 GNUNET_asprintf (&cfg_name,
245 "test_namestore_api_%s.conf", 233 "test_namestore_api_%s.conf",
246 plugin_name); 234 plugin_name);
235 GNUNET_DISK_purge_cfg_dir (cfg_name,
236 "GNUNET_TEST_HOME");
247 res = 1; 237 res = 1;
248 if (0 != 238 if (0 !=
249 GNUNET_TESTING_peer_run ("test-namestore-api", 239 GNUNET_TESTING_peer_run ("test-namestore-api",
@@ -253,12 +243,9 @@ main (int argc, char *argv[])
253 { 243 {
254 res = 1; 244 res = 1;
255 } 245 }
246 GNUNET_DISK_purge_cfg_dir (cfg_name,
247 "GNUNET_TEST_HOME");
256 GNUNET_free (cfg_name); 248 GNUNET_free (cfg_name);
257 if (NULL != directory)
258 {
259 GNUNET_DISK_directory_remove (directory);
260 GNUNET_free (directory);
261 }
262 return res; 249 return res;
263} 250}
264 251