diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-08-03 12:17:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-08-03 12:17:43 +0000 |
commit | 9efe0ce2c8b51f34b815e34d5f73fc180639581f (patch) | |
tree | 3fd6391fb5d4dd8ed9785f7f6e21d5d913c8eaa4 /src/datastore/test_datastore_api_management.c | |
parent | 5c70edfcef3121b1523f9cc39d9f0a1c94b0166e (diff) |
mysql plugin compiles now -- not complete
Diffstat (limited to 'src/datastore/test_datastore_api_management.c')
-rw-r--r-- | src/datastore/test_datastore_api_management.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index 9c3a602fbd..da0eb354be 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c @@ -47,6 +47,7 @@ static struct GNUNET_TIME_Absolute now; static int ok; +static const char* plugin_name; static size_t get_size (int i) @@ -319,6 +320,7 @@ static int check () { pid_t pid; + char cfg_name[128]; char *const argv[] = { "test-datastore-api-management", "-c", "test_datastore_api_data.conf", @@ -330,12 +332,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); @@ -355,8 +361,20 @@ main (int argc, char *argv[]) { int ret; - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore"); - GNUNET_log_setup ("test-datastore-api", + 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-management", #if VERBOSE "DEBUG", #else @@ -364,10 +382,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_management.c */ |