aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/perf_datastore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/perf_datastore_api.c')
-rw-r--r--src/datastore/perf_datastore_api.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index 90cdf44b3..8b040c222 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -44,6 +44,7 @@
44 */ 44 */
45#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) 45#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
46 46
47static const char *plugin_name;
47 48
48static struct GNUNET_DATASTORE_Handle *datastore; 49static struct GNUNET_DATASTORE_Handle *datastore;
49 50
@@ -339,10 +340,11 @@ static int
339check () 340check ()
340{ 341{
341 pid_t pid; 342 pid_t pid;
343 char cfg_name[128];
342 char *const argv[] = { 344 char *const argv[] = {
343 "perf-datastore-api", 345 "perf-datastore-api",
344 "-c", 346 "-c",
345 "test_datastore_api_data.conf", 347 cfg_name,
346#if VERBOSE 348#if VERBOSE
347 "-L", "DEBUG", 349 "-L", "DEBUG",
348#endif 350#endif
@@ -351,6 +353,11 @@ check ()
351 struct GNUNET_GETOPT_CommandLineOption options[] = { 353 struct GNUNET_GETOPT_CommandLineOption options[] = {
352 GNUNET_GETOPT_OPTION_END 354 GNUNET_GETOPT_OPTION_END
353 }; 355 };
356
357 GNUNET_snprintf (cfg_name,
358 sizeof (cfg_name),
359 "test_datastore_api_data_%s.conf",
360 plugin_name);
354 pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", 361 pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
355 "gnunet-service-arm", 362 "gnunet-service-arm",
356#if VERBOSE 363#if VERBOSE
@@ -374,8 +381,19 @@ int
374main (int argc, char *argv[]) 381main (int argc, char *argv[])
375{ 382{
376 int ret; 383 int ret;
377 384 const char *pos;
378 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore"); 385 char dir_name[128];
386
387 /* determine name of plugin to use */
388 plugin_name = argv[0];
389 while (NULL != (pos = strstr(plugin_name, "_")))
390 plugin_name = pos+1;
391
392 GNUNET_snprintf (dir_name,
393 sizeof (dir_name),
394 "/tmp/test-gnunet-datastore-%s",
395 plugin_name);
396 GNUNET_DISK_directory_remove (dir_name);
379 GNUNET_log_setup ("perf-datastore-api", 397 GNUNET_log_setup ("perf-datastore-api",
380#if VERBOSE 398#if VERBOSE
381 "DEBUG", 399 "DEBUG",
@@ -387,9 +405,8 @@ main (int argc, char *argv[])
387#if REPORT_ID 405#if REPORT_ID
388 fprintf (stderr, "\n"); 406 fprintf (stderr, "\n");
389#endif 407#endif
390 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore"); 408 GNUNET_DISK_directory_remove (dir_name);
391 return ret; 409 return ret;
392} 410}
393 411
394
395/* end of perf_datastore_api.c */ 412/* end of perf_datastore_api.c */