[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30081 - in gnunet/src: include testbed testing
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30081 - in gnunet/src: include testbed testing |
Date: |
Thu, 10 Oct 2013 11:59:29 +0200 |
Author: harsha
Date: 2013-10-10 11:59:29 +0200 (Thu, 10 Oct 2013)
New Revision: 30081
Modified:
gnunet/src/include/gnunet_testing_lib.h
gnunet/src/testbed/gnunet-helper-testbed.c
gnunet/src/testing/testing.c
Log:
- ignore GNUNET_TESTING_PREFIX in testbed helper
Modified: gnunet/src/include/gnunet_testing_lib.h
===================================================================
--- gnunet/src/include/gnunet_testing_lib.h 2013-10-10 09:32:25 UTC (rev
30080)
+++ gnunet/src/include/gnunet_testing_lib.h 2013-10-10 09:59:29 UTC (rev
30081)
@@ -51,6 +51,13 @@
#define GNUNET_TESTING_HOSTKEYFILESIZE sizeof (struct
GNUNET_CRYPTO_EccPrivateKey)
/**
+ * The environmental variable, if set, that dictates where testing should place
+ * generated peer configurations
+ */
+#define GNUNET_TESTING_PREFIX "GNUNET_TESTING_PREFIX"
+
+
+/**
* Handle for a system on which GNUnet peers are executed;
* a system is used for reserving unique paths and ports.
*/
Modified: gnunet/src/testbed/gnunet-helper-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-helper-testbed.c 2013-10-10 09:32:25 UTC (rev
30080)
+++ gnunet/src/testbed/gnunet-helper-testbed.c 2013-10-10 09:59:29 UTC (rev
30081)
@@ -338,6 +338,7 @@
char *config;
char *xconfig;
char *evstr;
+ char *str;
size_t config_size;
uLongf ul_config_size;
size_t xconfig_size;
@@ -401,8 +402,27 @@
hostname_size);
hostname[hostname_size] = '\0';
}
+ /* unset GNUNET_TESTING_PREFIX if present as it is more relevant for testbed
*/
+ evstr = getenv (GNUNET_TESTING_PREFIX);
+ if (NULL != evstr)
+ {
+#if WINDOWS
+ GNUNET_break (0 == putenv (GNUNET_TESTING_PREFIX "="));
+#else
+ gnunet_break (0 == unsetenv (GNUNET_TESTING_PREFIX));
+#endif
+ }
test_system =
- GNUNET_TESTING_system_create ("testbed-helper", trusted_ip, hostname,
NULL);
+ GNUNET_TESTING_system_create ("testbed-helper", trusted_ip, hostname,
+ NULL);
+ if (NULL != evstr)
+ {
+ GNUNET_assert (0 < GNUNET_asprintf (&str,
+ GNUNET_TESTING_PREFIX "=%s", evstr));
+ putenv (str);
+ /* do not free str will be consumed by putenv */
+ GNUNET_free (evstr);
+ }
GNUNET_free_non_null (hostname);
hostname = NULL;
GNUNET_assert (NULL != test_system);
Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c 2013-10-10 09:32:25 UTC (rev 30080)
+++ gnunet/src/testing/testing.c 2013-10-10 09:59:29 UTC (rev 30081)
@@ -388,7 +388,7 @@
GNUNET_assert (NULL != testdir);
system = GNUNET_malloc (sizeof (struct GNUNET_TESTING_System));
- if (NULL == (system->tmppath = getenv ("GNUNET_TESTING_PREFIX")))
+ if (NULL == (system->tmppath = getenv (GNUNET_TESTING_PREFIX)))
system->tmppath = GNUNET_DISK_mkdtemp (testdir);
else
system->tmppath = GNUNET_strdup (system->tmppath);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30081 - in gnunet/src: include testbed testing,
gnunet <=