diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2021-01-11 14:24:51 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2021-01-11 18:03:07 +0100 |
commit | 3b2c470e3b2fa241e8ee55eb3661a96d64f713f5 (patch) | |
tree | c296c1d89a3424a3401a365c8c824a5c1525a189 /src/testbed | |
parent | 8acff3af0c2862e556ddce96440db9a8c525f395 (diff) | |
download | gnunet-3b2c470e3b2fa241e8ee55eb3661a96d64f713f5.tar.gz gnunet-3b2c470e3b2fa241e8ee55eb3661a96d64f713f5.zip |
-fix setting environment variable for testbed
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/testbed_api_test.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testbed/testbed_api_test.c b/src/testbed/testbed_api_test.c index 6179a23ef..30dbe455d 100644 --- a/src/testbed/testbed_api_test.c +++ b/src/testbed/testbed_api_test.c | |||
@@ -23,9 +23,11 @@ | |||
23 | * @brief high-level test function | 23 | * @brief high-level test function |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * @author Sree Harsha Totakura | 25 | * @author Sree Harsha Totakura |
26 | * @author Tobias Frisch | ||
26 | */ | 27 | */ |
27 | #include "platform.h" | 28 | #include "platform.h" |
28 | #include "gnunet_testbed_service.h" | 29 | #include "gnunet_testbed_service.h" |
30 | #include "testbed.h" | ||
29 | 31 | ||
30 | 32 | ||
31 | /** | 33 | /** |
@@ -143,6 +145,10 @@ GNUNET_TESTBED_test_run (const char *testname, | |||
143 | argv2[2] = GNUNET_strdup (cfg_filename); | 145 | argv2[2] = GNUNET_strdup (cfg_filename); |
144 | GNUNET_assert (NULL != test_master); | 146 | GNUNET_assert (NULL != test_master); |
145 | GNUNET_assert (num_peers > 0); | 147 | GNUNET_assert (num_peers > 0); |
148 | |||
149 | char* envcfg = getenv(ENV_TESTBED_CONFIG); | ||
150 | setenv(ENV_TESTBED_CONFIG, cfg_filename, 1); | ||
151 | |||
146 | rc = GNUNET_malloc (sizeof(struct TestRunContext) | 152 | rc = GNUNET_malloc (sizeof(struct TestRunContext) |
147 | + (num_peers * sizeof(struct GNUNET_TESTBED_Peer *))); | 153 | + (num_peers * sizeof(struct GNUNET_TESTBED_Peer *))); |
148 | rc->test_master = test_master; | 154 | rc->test_master = test_master; |
@@ -153,6 +159,12 @@ GNUNET_TESTBED_test_run (const char *testname, | |||
153 | rc->cc_cls = cc_cls; | 159 | rc->cc_cls = cc_cls; |
154 | ret = GNUNET_PROGRAM_run ((sizeof(argv2) / sizeof(char *)) - 1, argv2, | 160 | ret = GNUNET_PROGRAM_run ((sizeof(argv2) / sizeof(char *)) - 1, argv2, |
155 | testname, "nohelp", options, &run, rc); | 161 | testname, "nohelp", options, &run, rc); |
162 | |||
163 | if (envcfg) | ||
164 | setenv(ENV_TESTBED_CONFIG, envcfg, 1); | ||
165 | else | ||
166 | unsetenv(ENV_TESTBED_CONFIG); | ||
167 | |||
156 | GNUNET_free (rc); | 168 | GNUNET_free (rc); |
157 | GNUNET_free (argv2[0]); | 169 | GNUNET_free (argv2[0]); |
158 | GNUNET_free (argv2[2]); | 170 | GNUNET_free (argv2[2]); |