- Tests did not clean up: TEST_HOME with namestore db was not removed after test
[oweals/gnunet.git] / src / namestore / test_namestore_api_remove_not_existing_record.c
index d1a664b1764f212e290a02acdf316b950f7446da..c3afee6ff120b9256057f81a9cf5667b8ad1b222 100644 (file)
@@ -46,6 +46,7 @@ static int res;
 
 static struct GNUNET_NAMESTORE_QueueEntry *nsqe;
 
+static char *directory;
 
 static void
 cleanup ()
@@ -60,6 +61,11 @@ cleanup ()
     GNUNET_free (privkey);
     privkey = NULL;
   }
+  if (NULL != directory)
+  {
+      GNUNET_DISK_directory_remove (directory);
+      GNUNET_free (directory);
+  }
   GNUNET_SCHEDULER_shutdown ();
 }
 
@@ -133,6 +139,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,