-static int
-check ()
-{
- int ok = 0;
-
- char *const argv[] = { "perf-peerinfo-api",
- "-c",
- "test_peerinfo_api_data.conf",
- "-L", "ERROR",
- NULL
- };
-#if START_SERVICE
- struct GNUNET_OS_Process *proc;
-
- struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
- proc =
- GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-peerinfo",
- "gnunet-service-peerinfo",
- "-L", "ERROR",
- "-c", "test_peerinfo_api_data.conf", NULL);
-#endif
- GNUNET_assert (NULL != proc);
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
- "perf-peerinfo-api", "nohelp", options, &run, &ok);
- FPRINTF (stderr, "Received %u/%u calls before timeout\n", numpeers,
- NUM_REQUESTS * NUM_REQUESTS / 2);
- GAUGER ("PEERINFO", "Peerinfo lookups", numpeers / 30, "peers/s");
-#if START_SERVICE
- if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
- {
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
- ok = 1;
- }
- GNUNET_OS_process_wait (proc);
- GNUNET_OS_process_close (proc);
- proc = NULL;
-#endif
- return ok;
-}
-