diff options
Diffstat (limited to 'src/namestore/test_namestore_api_zone_to_name.c')
-rw-r--r-- | src/namestore/test_namestore_api_zone_to_name.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index 5b088d90b..292d8f701 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c | |||
@@ -51,8 +51,6 @@ static char * s_name; | |||
51 | 51 | ||
52 | static int res; | 52 | static int res; |
53 | 53 | ||
54 | static char *directory; | ||
55 | |||
56 | static struct GNUNET_NAMESTORE_QueueEntry *qe; | 54 | static struct GNUNET_NAMESTORE_QueueEntry *qe; |
57 | 55 | ||
58 | 56 | ||
@@ -204,34 +202,13 @@ run (void *cls, | |||
204 | { | 202 | { |
205 | (void) cls; | 203 | (void) cls; |
206 | (void) peer; | 204 | (void) peer; |
207 | directory = NULL; | ||
208 | GNUNET_assert (GNUNET_OK == | ||
209 | GNUNET_CONFIGURATION_get_value_string (cfg, | ||
210 | "PATHS", | ||
211 | "GNUNET_TEST_HOME", | ||
212 | &directory)); | ||
213 | GNUNET_DISK_directory_remove (directory); | ||
214 | |||
215 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 205 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
216 | &endbadly, | 206 | &endbadly, |
217 | NULL); | 207 | NULL); |
218 | GNUNET_SCHEDULER_add_shutdown (&end, | 208 | GNUNET_SCHEDULER_add_shutdown (&end, |
219 | NULL); | 209 | NULL); |
220 | GNUNET_asprintf (&s_name, "dummy"); | 210 | GNUNET_asprintf (&s_name, "dummy"); |
221 | /* load privat key */ | 211 | privkey = GNUNET_CRYPTO_ecdsa_key_create (); |
222 | { | ||
223 | char *zonekey_file; | ||
224 | |||
225 | GNUNET_asprintf (&zonekey_file, | ||
226 | "zonefiles%s%s", | ||
227 | DIR_SEPARATOR_STR, | ||
228 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | ||
229 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
230 | "Using zonekey file `%s'\n", | ||
231 | zonekey_file); | ||
232 | privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (zonekey_file); | ||
233 | GNUNET_free (zonekey_file); | ||
234 | } | ||
235 | GNUNET_assert (NULL != privkey); | 212 | GNUNET_assert (NULL != privkey); |
236 | /* get public key */ | 213 | /* get public key */ |
237 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, | 214 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, |
@@ -274,6 +251,8 @@ main (int argc, | |||
274 | GNUNET_asprintf (&cfg_name, | 251 | GNUNET_asprintf (&cfg_name, |
275 | "test_namestore_api_%s.conf", | 252 | "test_namestore_api_%s.conf", |
276 | plugin_name); | 253 | plugin_name); |
254 | GNUNET_DISK_purge_cfg_dir (cfg_name, | ||
255 | "GNUNET_TEST_HOME"); | ||
277 | res = 1; | 256 | res = 1; |
278 | if (0 != | 257 | if (0 != |
279 | GNUNET_TESTING_peer_run ("test-namestore-api-zone-to-name", | 258 | GNUNET_TESTING_peer_run ("test-namestore-api-zone-to-name", |
@@ -283,12 +262,9 @@ main (int argc, | |||
283 | { | 262 | { |
284 | res = 1; | 263 | res = 1; |
285 | } | 264 | } |
265 | GNUNET_DISK_purge_cfg_dir (cfg_name, | ||
266 | "GNUNET_TEST_HOME"); | ||
286 | GNUNET_free (cfg_name); | 267 | GNUNET_free (cfg_name); |
287 | if (NULL != directory) | ||
288 | { | ||
289 | GNUNET_DISK_directory_remove (directory); | ||
290 | GNUNET_free (directory); | ||
291 | } | ||
292 | return res; | 268 | return res; |
293 | } | 269 | } |
294 | 270 | ||