- Tests did not clean up: TEST_HOME with namestore db was not removed after test
[oweals/gnunet.git] / src / namestore / test_namestore_api_lookup_public.c
index a0678ddc4fb93f82c81c84174179ef10f938f6a1..096e5e0553d0d5321826f6e0fe1676d928b41278 100644 (file)
@@ -51,6 +51,7 @@ static struct GNUNET_NAMESTORE_QueueEntry *nsqe;
 
 static struct GNUNET_NAMECACHE_QueueEntry *ncqe;
 
+static char *directory;
 
 static void
 cleanup ()
@@ -70,6 +71,11 @@ cleanup ()
     GNUNET_free (privkey);
     privkey = NULL;
   }
+  if (NULL != directory)
+  {
+      GNUNET_DISK_directory_remove (directory);
+      GNUNET_free (directory);
+  }
   GNUNET_SCHEDULER_shutdown ();
 }
 
@@ -193,6 +199,9 @@ run (void *cls,
   char *hostkey_file;
   const char * name = "dummy.dummy.gnunet";
 
+  directory = NULL;
+  GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory);
+
   endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
                                                &endbadly, NULL);
   GNUNET_asprintf (&hostkey_file,