test_datastore_api_sqlite_SOURCES = \
test_datastore_api.c
test_datastore_api_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datastore_api_management_sqlite_SOURCES = \
test_datastore_api_management.c
test_datastore_api_management_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_datastore_api_sqlite_SOURCES = \
perf_datastore_api.c
perf_datastore_api_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datastore_api_mysql_SOURCES = \
test_datastore_api.c
test_datastore_api_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datastore_api_management_mysql_SOURCES = \
test_datastore_api_management.c
test_datastore_api_management_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_datastore_api_mysql_SOURCES = \
perf_datastore_api.c
perf_datastore_api_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datastore_api_postgres_SOURCES = \
test_datastore_api.c
test_datastore_api_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datastore_api_management_postgres_SOURCES = \
test_datastore_api_management.c
test_datastore_api_management_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_datastore_api_postgres_SOURCES = \
perf_datastore_api.c
perf_datastore_api_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datastore/libgnunetdatastore.la \
$(top_builddir)/src/util/libgnunetutil.la
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_datastore_service.h"
+#include "gnunet_testing_lib-new.h"
#include <gauger.h>
-#define VERBOSE GNUNET_NO
-
/**
* How long until we give up on transmitting the message?
*/
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
-static const char *plugin_name;
-
-static struct GNUNET_DATASTORE_Handle *datastore;
-
/**
* Target datastore size (in bytes).
*/
static struct GNUNET_TIME_Absolute start_time;
+static const char *plugin_name;
+
+static struct GNUNET_DATASTORE_Handle *datastore;
+
static int ok;
+
enum RunPhase
{
RP_DONE = 0,
};
-
static void
run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
-
-
static void
check_success (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
{
static void
-run (void *cls, char *const *args, const char *cfgfile,
+run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct CpsRunContext *crc;
}
-static int
-check ()
-{
- struct GNUNET_OS_Process *proc;
- char cfg_name[128];
-
- char *const argv[] = {
- "perf-datastore-api",
- "-c",
- cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- NULL
- };
- struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
-
- GNUNET_snprintf (cfg_name, sizeof (cfg_name),
- "test_datastore_api_data_%s.conf", plugin_name);
- proc =
- GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
- "gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- "-c", cfg_name, NULL);
- GNUNET_assert (NULL != proc);
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
- "perf-datastore-api", "nohelp", options, &run, NULL);
- sleep (1); /* give datastore chance to process 'DROP' */
- 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_destroy (proc);
- proc = NULL;
- return ok;
-}
-
-
int
main (int argc, char *argv[])
{
- int ret;
char *pos;
- char dir_name[128];
+ char cfg_name[128];
- sleep (1);
/* determine name of plugin to use */
plugin_name = argv[0];
while (NULL != (pos = strstr (plugin_name, "_")))
plugin_name = pos + 1;
if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
+ pos[0] = '\0';
else
pos = (char *) plugin_name;
-
- GNUNET_snprintf (dir_name, sizeof (dir_name), "/tmp/test-gnunet-datastore-%s",
- plugin_name);
- GNUNET_DISK_directory_remove (dir_name);
- GNUNET_log_setup ("perf-datastore-api",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
- NULL);
- ret = check ();
- if (pos != plugin_name)
- pos[0] = '.';
-#if REPORT_ID
- FPRINTF (stderr, "%s", "\n");
-#endif
- GNUNET_DISK_directory_remove (dir_name);
- return ret;
+ GNUNET_snprintf (cfg_name, sizeof (cfg_name),
+ "test_datastore_api_data_%s.conf", plugin_name);
+ if (0 !=
+ GNUNET_TESTING_peer_run ("perf-gnunet-datastore",
+ cfg_name,
+ &run,
+ NULL))
+ return 1;
+ return ok;
}
/* end of perf_datastore_api.c */
#include "gnunet_datastore_plugin.h"
#include <gauger.h>
-#define VERBOSE GNUNET_NO
-
/**
* Target datastore size (in bytes). Realistic sizes are
* more like 16 GB (not the default of 16 MB); however,
memcpy (&i, &cdata[4], sizeof (i));
hits[i / 8] |= (1 << (i % 8));
-#if VERBOSE
- FPRINTF (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
- type, priority, size, (unsigned long long) expiration.abs_value);
-#endif
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
+ type, priority, size, (unsigned long long) expiration.abs_value);
crc->cnt++;
if (crc->cnt == PUT_10 / 4 - 1)
{
GNUNET_break (0);
crc->phase = RP_ERROR;
}
-#if VERBOSE
- FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
-#endif
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "In phase %d, iteration %u\n", crc->phase, crc->cnt);
switch (crc->phase)
{
case RP_ERROR:
}
-static int
-check ()
+int
+main (int argc, char *argv[])
{
+ char *pos;
+ char dir_name[128];
char cfg_name[128];
-
char *const argv[] = {
"perf-plugin-datastore",
"-c",
cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
- GNUNET_snprintf (category, sizeof (category), "DATASTORE-%s", plugin_name);
- GNUNET_snprintf (cfg_name, sizeof (cfg_name),
- "perf_plugin_datastore_data_%s.conf", plugin_name);
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
- "perf-plugin-datastore", "nohelp", options, &run, NULL);
- if (ok != 0)
- FPRINTF (stderr, "Missed some testcases: %u\n", ok);
- return ok;
-}
-
-
-int
-main (int argc, char *argv[])
-{
- int ret;
- char *pos;
- char dir_name[128];
-
- sleep (1);
/* determine name of plugin to use */
plugin_name = argv[0];
while (NULL != (pos = strstr (plugin_name, "_")))
pos[0] = 0;
else
pos = (char *) plugin_name;
-
GNUNET_snprintf (dir_name, sizeof (dir_name), "/tmp/perf-gnunet-datastore-%s",
plugin_name);
GNUNET_DISK_directory_remove (dir_name);
GNUNET_log_setup ("perf-plugin-datastore",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- ret = check ();
+ GNUNET_snprintf (category, sizeof (category), "DATASTORE-%s", plugin_name);
+ GNUNET_snprintf (cfg_name, sizeof (cfg_name),
+ "perf_plugin_datastore_data_%s.conf", plugin_name);
+ GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
+ "perf-plugin-datastore", "nohelp", options, &run, NULL);
+ if (ok != 0)
+ FPRINTF (stderr, "Missed some testcases: %u\n", ok);
if (pos != plugin_name)
pos[0] = '.';
GNUNET_DISK_directory_remove (dir_name);
- return ret;
+ return ok;
}
/* end of perf_plugin_datastore.c */
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_datastore_service.h"
+#include "gnunet_testing_lib-new.h"
-#define VERBOSE GNUNET_NO
-
-#define START_DATASTORE GNUNET_YES
/**
* How long until we give up on transmitting the message?
struct CpsRunContext *crc = cls;
ok = (int) crc->phase;
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test in phase %u\n", crc->phase);
-#endif
switch (crc->phase)
{
case RP_PUT:
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "PUT",
crc->i);
-#endif
GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
GNUNET_DATASTORE_put (datastore, 0, &crc->key, get_size (crc->i),
get_data (crc->i), get_type (crc->i),
break;
case RP_GET:
crc->i--;
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "GET",
crc->i);
-#endif
GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
GNUNET_DATASTORE_get_key (datastore, crc->offset, &crc->key,
get_type (crc->i), 1, 1, TIMEOUT, &check_value,
break;
case RP_DEL:
crc->i--;
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "DEL",
crc->i);
-#endif
crc->data = NULL;
GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
GNUNET_assert (NULL !=
&delete_value, crc));
break;
case RP_DO_DEL:
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "DO_DEL",
crc->i);
-#endif
if (crc->i == 0)
{
crc->i = ITERATIONS;
break;
case RP_DELVALIDATE:
crc->i--;
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n",
"DEL-VALIDATE", crc->i);
-#endif
GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
GNUNET_assert (NULL !=
GNUNET_DATASTORE_get_key (datastore, crc->offset, &crc->key,
&check_update, crc));
break;
case RP_DONE:
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished, disconnecting\n");
-#endif
GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
GNUNET_free (crc);
ok = 0;
static void
-run (void *cls, char *const *args, const char *cfgfile,
+run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct CpsRunContext *crc;
}
-static int
-check ()
-{
- char cfg_name[128];
-
-#if START_DATASTORE
- struct GNUNET_OS_Process *proc;
-#endif
- char *const argv[] = {
- "test-datastore-api",
- "-c",
- cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- NULL
- };
- struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
- GNUNET_snprintf (cfg_name, sizeof (cfg_name),
- "test_datastore_api_data_%s.conf", plugin_name);
-#if START_DATASTORE
- proc =
- GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
- "gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- "-c", cfg_name, NULL);
-#endif
- GNUNET_assert (NULL != proc);
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
- "test-datastore-api", "nohelp", options, &run, NULL);
-#if START_DATASTORE
- sleep (1); /* give datastore chance to receive 'DROP' request */
- 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_destroy (proc);
- proc = NULL;
-#endif
- if (ok != 0)
- FPRINTF (stderr, "Missed some testcases: %u\n", ok);
- return ok;
-}
-
int
main (int argc, char *argv[])
{
- int ret;
char *pos;
- char dir_name[128];
+ char cfg_name[128];
- sleep (1);
/* determine name of plugin to use */
plugin_name = argv[0];
while (NULL != (pos = strstr (plugin_name, "_")))
plugin_name = pos + 1;
if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
+ pos[0] = '\0';
else
pos = (char *) plugin_name;
-
- 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",
-#else
- "WARNING",
-#endif
- NULL);
- ret = check ();
- if (pos != plugin_name)
- pos[0] = '.';
- GNUNET_DISK_directory_remove (dir_name);
- return ret;
+ GNUNET_snprintf (cfg_name, sizeof (cfg_name),
+ "test_datastore_api_data_%s.conf", plugin_name);
+ if (0 !=
+ GNUNET_TESTING_peer_run ("test-gnunet-datastore",
+ cfg_name,
+ &run,
+ NULL))
+ return 1;
+ return ok;
}
/* end of test_datastore_api.c */
[datastore]
QUOTA = 10 MB
-[fs]
-AUTOSTART = NO
* @brief Test for the space management functions of the datastore implementation.
* @author Christian Grothoff
*/
-
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_datastore_service.h"
+#include "gnunet_testing_lib-new.h"
-#define VERBOSE GNUNET_NO
/**
* How long until we give up on transmitting the message?
*/
#define ITERATIONS 5000
+enum RunPhase
+{
+ RP_PUT,
+ RP_GET,
+ RP_DONE,
+ RP_GET_FAIL
+};
+
+
+struct CpsRunContext
+{
+ GNUNET_HashCode key;
+ int i;
+ int found;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
+ void *data;
+ enum RunPhase phase;
+ uint64_t offset;
+};
+
+
static struct GNUNET_DATASTORE_Handle *datastore;
static struct GNUNET_TIME_Absolute now;
static const char *plugin_name;
+
static size_t
get_size (int i)
{
return av;
}
-enum RunPhase
-{
- RP_PUT,
- RP_GET,
- RP_DONE,
- RP_GET_FAIL
-};
-
-
-struct CpsRunContext
-{
- GNUNET_HashCode key;
- int i;
- int found;
- const struct GNUNET_CONFIGURATION_Handle *cfg;
- void *data;
- enum RunPhase phase;
- uint64_t offset;
-};
-
static void
run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
switch (crc->phase)
{
case RP_PUT:
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "PUT",
crc->i);
-#endif
GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
GNUNET_DATASTORE_put (datastore, 0, &crc->key, get_size (crc->i),
get_data (crc->i), get_type (crc->i),
}
break;
case RP_GET:
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "GET",
crc->i);
-#endif
GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
GNUNET_DATASTORE_get_key (datastore, crc->offset++, &crc->key,
get_type (crc->i), 1, 1, TIMEOUT, &check_value,
crc);
break;
case RP_GET_FAIL:
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "GET(f)",
crc->i);
-#endif
GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
GNUNET_DATASTORE_get_key (datastore, crc->offset++, &crc->key,
get_type (crc->i), 1, 1, TIMEOUT, &check_nothing,
break;
case RP_DONE:
GNUNET_assert (0 == crc->i);
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished, disconnecting\n");
-#endif
GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
GNUNET_free (crc);
ok = 0;
static void
-run (void *cls, char *const *args, const char *cfgfile,
+run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct CpsRunContext *crc;
}
-
-static int
-check ()
-{
- struct GNUNET_OS_Process *proc;
- char cfg_name[128];
-
- char *const argv[] = {
- "test-datastore-api-management",
- "-c",
- cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- NULL
- };
- struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
- GNUNET_snprintf (cfg_name, sizeof (cfg_name),
- "test_datastore_api_data_%s.conf", plugin_name);
- proc =
- GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
- "gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- "-c", cfg_name, NULL);
- GNUNET_assert (NULL != proc);
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
- "test-datastore-api-management", "nohelp", options, &run,
- NULL);
- sleep (1); /* give datastore chance to process 'DROP' request */
- 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_destroy (proc);
- proc = NULL;
- if (ok != 0)
- FPRINTF (stderr, "Missed some testcases: %u\n", ok);
- return ok;
-}
-
int
main (int argc, char *argv[])
{
- int ret;
-
char *pos;
- char dir_name[128];
+ char cfg_name[128];
- sleep (1);
/* determine name of plugin to use */
plugin_name = argv[0];
while (NULL != (pos = strstr (plugin_name, "_")))
pos[0] = 0;
else
pos = (char *) plugin_name;
-
- 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
- "WARNING",
-#endif
- NULL);
- ret = check ();
- if (pos != plugin_name)
- pos[0] = '.';
- GNUNET_DISK_directory_remove (dir_name);
- return ret;
+ GNUNET_snprintf (cfg_name, sizeof (cfg_name),
+ "test_datastore_api_data_%s.conf", plugin_name);
+ if (0 !=
+ GNUNET_TESTING_peer_run ("test-gnunet-datastore-management",
+ cfg_name,
+ &run,
+ NULL))
+ return 1;
+ return ok;
}
/* end of test_datastore_api_management.c */
[namestore]
AUTOSTART = NO
+
+[fs]
+AUTOSTART = NO
#include "gnunet_protocols.h"
#include "gnunet_datastore_plugin.h"
-#define VERBOSE GNUNET_NO
-
/**
* Number of put operations to perform.
*/
value[0] = k;
msg = NULL;
prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100);
-#if VERBOSE
- FPRINTF (stderr, "putting type %u, anon %u under key %s\n", i + 1, i,
- GNUNET_h2s (&key));
-#endif
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "putting type %u, anon %u under key %s\n", i + 1, i,
+ GNUNET_h2s (&key));
if (GNUNET_OK != api->put (api->cls, &key, size, value, i + 1 /* type */ ,
prio, i /* anonymity */ ,
0 /* replication */ ,
GNUNET_assert (key != NULL);
guid = uid;
crc->phase++;
-#if VERBOSE
- FPRINTF (stderr,
- "Found result type=%u, priority=%u, size=%u, expire=%llu, key %s\n",
- type, priority, size, (unsigned long long) expiration.abs_value,
- GNUNET_h2s (key));
-#endif
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Found result type=%u, priority=%u, size=%u, expire=%llu, key %s\n",
+ type, priority, size, (unsigned long long) expiration.abs_value,
+ GNUNET_h2s (key));
GNUNET_SCHEDULER_add_now (&test, crc);
return GNUNET_OK;
}
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test aborted.\n");
crc->phase = RP_ERROR;
}
-#if VERBOSE
- FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
-#endif
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "In phase %d, iteration %u\n", crc->phase, crc->cnt);
switch (crc->phase)
{
case RP_ERROR:
}
-static int
-check ()
+
+int
+main (int argc, char *argv[])
{
+ char *pos;
+ char dir_name[128];
char cfg_name[128];
-
- char *const argv[] = {
+ char *const xargv[] = {
"test-plugin-datastore",
"-c",
cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
- struct GNUNET_GETOPT_CommandLineOption options[] = {
+ static struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
- GNUNET_snprintf (cfg_name, sizeof (cfg_name),
- "test_plugin_datastore_data_%s.conf", plugin_name);
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
- "test-plugin-datastore", "nohelp", options, &run, NULL);
- if (ok != 0)
- FPRINTF (stderr, "Missed some testcases: %u\n", ok);
- return ok;
-}
-
-
-int
-main (int argc, char *argv[])
-{
- int ret;
- char *pos;
- char dir_name[128];
-
- sleep (1);
/* determine name of plugin to use */
plugin_name = argv[0];
while (NULL != (pos = strstr (plugin_name, "_")))
"/tmp/test-gnunet-datastore-plugin-%s", plugin_name);
GNUNET_DISK_directory_remove (dir_name);
GNUNET_log_setup ("test-plugin-datastore",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- ret = check ();
+ GNUNET_snprintf (cfg_name, sizeof (cfg_name),
+ "test_plugin_datastore_data_%s.conf", plugin_name);
+ GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
+ "test-plugin-datastore", "nohelp", options, &run, NULL);
+ if (ok != 0)
+ FPRINTF (stderr, "Missed some testcases: %u\n", ok);
if (pos != plugin_name)
pos[0] = '.';
GNUNET_DISK_directory_remove (dir_name);
-
- return ret;
+ return ok;
}
/* end of test_plugin_datastore.c */