diff options
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 9c3a602fb..da0eb354b 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; | |||
47 | 47 | ||
48 | static int ok; | 48 | static int ok; |
49 | 49 | ||
50 | static const char* plugin_name; | ||
50 | 51 | ||
51 | static size_t | 52 | static size_t |
52 | get_size (int i) | 53 | get_size (int i) |
@@ -319,6 +320,7 @@ static int | |||
319 | check () | 320 | check () |
320 | { | 321 | { |
321 | pid_t pid; | 322 | pid_t pid; |
323 | char cfg_name[128]; | ||
322 | char *const argv[] = { "test-datastore-api-management", | 324 | char *const argv[] = { "test-datastore-api-management", |
323 | "-c", | 325 | "-c", |
324 | "test_datastore_api_data.conf", | 326 | "test_datastore_api_data.conf", |
@@ -330,12 +332,16 @@ check () | |||
330 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 332 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
331 | GNUNET_GETOPT_OPTION_END | 333 | GNUNET_GETOPT_OPTION_END |
332 | }; | 334 | }; |
335 | GNUNET_snprintf (cfg_name, | ||
336 | sizeof (cfg_name), | ||
337 | "test_datastore_api_data_%s.conf", | ||
338 | plugin_name); | ||
333 | pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 339 | pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
334 | "gnunet-service-arm", | 340 | "gnunet-service-arm", |
335 | #if VERBOSE | 341 | #if VERBOSE |
336 | "-L", "DEBUG", | 342 | "-L", "DEBUG", |
337 | #endif | 343 | #endif |
338 | "-c", "test_datastore_api_data.conf", NULL); | 344 | "-c", cfg_name, NULL); |
339 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 345 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
340 | argv, "test-datastore-api", "nohelp", | 346 | argv, "test-datastore-api", "nohelp", |
341 | options, &run, NULL); | 347 | options, &run, NULL); |
@@ -355,8 +361,20 @@ main (int argc, char *argv[]) | |||
355 | { | 361 | { |
356 | int ret; | 362 | int ret; |
357 | 363 | ||
358 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore"); | 364 | const char *pos; |
359 | GNUNET_log_setup ("test-datastore-api", | 365 | char dir_name[128]; |
366 | |||
367 | /* determine name of plugin to use */ | ||
368 | plugin_name = argv[0]; | ||
369 | while (NULL != (pos = strstr(plugin_name, "_"))) | ||
370 | plugin_name = pos+1; | ||
371 | |||
372 | GNUNET_snprintf (dir_name, | ||
373 | sizeof (dir_name), | ||
374 | "/tmp/test-gnunet-datastore-%s", | ||
375 | plugin_name); | ||
376 | GNUNET_DISK_directory_remove (dir_name); | ||
377 | GNUNET_log_setup ("test-datastore-api-management", | ||
360 | #if VERBOSE | 378 | #if VERBOSE |
361 | "DEBUG", | 379 | "DEBUG", |
362 | #else | 380 | #else |
@@ -364,10 +382,8 @@ main (int argc, char *argv[]) | |||
364 | #endif | 382 | #endif |
365 | NULL); | 383 | NULL); |
366 | ret = check (); | 384 | ret = check (); |
367 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore"); | 385 | GNUNET_DISK_directory_remove (dir_name); |
368 | return ret; | 386 | return ret; |
369 | } | 387 | } |
370 | 388 | ||
371 | |||
372 | |||
373 | /* end of test_datastore_api_management.c */ | 389 | /* end of test_datastore_api_management.c */ |