aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/test_datastore_api.c
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2010-08-03 12:17:43 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2010-08-03 12:17:43 +0000
commitd6fa7d60b7f5e5b498b9a06fe3ccdb622f1032bc (patch)
tree3fd6391fb5d4dd8ed9785f7f6e21d5d913c8eaa4 /src/datastore/test_datastore_api.c
parent23e144cbead491167d2d9132ef7cc3b8238cd1e0 (diff)
mysql plugin compiles now -- not complete
git-svn-id: https://gnunet.org/svn/gnunet@12442 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/datastore/test_datastore_api.c')
-rw-r--r--src/datastore/test_datastore_api.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 3093f7545a..af2f15da84 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -46,6 +46,10 @@ static struct GNUNET_TIME_Absolute now;
static int ok;
+/**
+ * Name of plugin under test.
+ */
+static const char *plugin_name;
static size_t
get_size (int i)
@@ -593,6 +597,7 @@ run (void *cls,
static int
check ()
{
+ char cfg_name[128];
pid_t pid;
char *const argv[] = { "test-datastore-api",
"-c",
@@ -605,12 +610,16 @@ check ()
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
+ GNUNET_snprintf (cfg_name,
+ sizeof (cfg_name),
+ "test_datastore_api_data_%s.conf",
+ plugin_name);
pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
"gnunet-service-arm",
#if VERBOSE
"-L", "DEBUG",
#endif
- "-c", "test_datastore_api_data.conf", NULL);
+ "-c", cfg_name, NULL);
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
argv, "test-datastore-api", "nohelp",
options, &run, NULL);
@@ -629,8 +638,19 @@ int
main (int argc, char *argv[])
{
int ret;
-
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore");
+ const char *pos;
+ char dir_name[128];
+
+ /* determine name of plugin to use */
+ plugin_name = argv[0];
+ while (NULL != (pos = strstr(plugin_name, "_")))
+ plugin_name = pos+1;
+
+ GNUNET_snprintf (dir_name,
+ sizeof (dir_name),
+ "/tmp/test-gnunet-datastore-%s",
+ plugin_name);
+ GNUNET_DISK_directory_remove (dir_name);
GNUNET_log_setup ("test-datastore-api",
#if VERBOSE
"DEBUG",
@@ -639,11 +659,8 @@ main (int argc, char *argv[])
#endif
NULL);
ret = check ();
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore");
-
+ GNUNET_DISK_directory_remove (dir_name);
return ret;
}
-
-
/* end of test_datastore_api.c */