aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/Makefile.am1
-rw-r--r--contrib/no_forcestart.conf29
-rw-r--r--src/arm/test_arm_api_data.conf45
-rw-r--r--src/core/test_core_defaults.conf2
-rw-r--r--src/datastore/test_datastore_api.c98
-rw-r--r--src/fs/test_fs_defaults.conf2
-rw-r--r--src/statistics/test_statistics_api_data.conf34
-rw-r--r--src/transport/test_transport_defaults.conf73
8 files changed, 113 insertions, 171 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index f36922b20..363588abf 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -44,6 +44,7 @@ tap64_DATA = \
44endif 44endif
45 45
46EXTRA_DIST = \ 46EXTRA_DIST = \
47 no_forcestart.conf \
47 coverage.sh \ 48 coverage.sh \
48 report.sh \ 49 report.sh \
49 terminate.py.in \ 50 terminate.py.in \
diff --git a/contrib/no_forcestart.conf b/contrib/no_forcestart.conf
new file mode 100644
index 000000000..7a1db42bd
--- /dev/null
+++ b/contrib/no_forcestart.conf
@@ -0,0 +1,29 @@
1# Configuration file that can be included to prevent ANY of the usual
2# FORCESTART = YES to be set. Also disables NSE POW calculation.
3#
4# This configuration is included from various configuration test files.
5# Whenever a new service is added that has FORCESTART = YES for
6# production should be disabled for (most) test suites, the option should
7# be added here instead of all over the place ;-).
8
9[core]
10FORCESTART = NO
11
12[fs]
13FORCESTART = NO
14
15[dht]
16FORCESTART = NO
17
18[cadet]
19FORCESTART = NO
20
21[nse]
22FORCESTART = NO
23WORKBITS = 0
24
25[revocation]
26FORCESTART = NO
27
28[topology]
29FORCESTART = NO
diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf
index 3ae5271a1..75eae0d17 100644
--- a/src/arm/test_arm_api_data.conf
+++ b/src/arm/test_arm_api_data.conf
@@ -1,5 +1,7 @@
1@INLINE@ ../../contrib/no_forcestart.conf
2
1[PATHS] 3[PATHS]
2GNUNET_TEST_HOME = /tmp/test-gnunetd-arm/ 4GNUNET_TEST_HOME = /tmp/test-gnunet-arm/
3 5
4[arm] 6[arm]
5PORT = 23354 7PORT = 23354
@@ -19,47 +21,6 @@ BINARY = /will/be/overwritten/by/test_exponential_backoff
19ACCEPT_FROM = 127.0.0.1; 21ACCEPT_FROM = 127.0.0.1;
20ACCEPT_FROM6 = ::1; 22ACCEPT_FROM6 = ::1;
21 23
22[fs]
23AUTOSTART = NO
24FORCESTART = NO
25
26[datastore]
27AUTOSTART = NO
28
29[core]
30AUTOSTART = NO
31
32[transport]
33AUTOSTART = NO
34
35[peerinfo]
36AUTOSTART = NO
37
38[statistics] 24[statistics]
39AUTOSTART = YES 25AUTOSTART = YES
40 26
41[dns]
42AUTOSTART = NO
43
44[consensus]
45AUTOSTART = NO
46
47[nse]
48AUTOSTART = NO
49FORCESTART = NO
50
51[hostlist]
52AUTOSTART = NO
53FORCESTART = NO
54
55[dht]
56AUTOSTART = NO
57FORCESTART = NO
58
59[cadet]
60AUTOSTART = NO
61FORCESTART = NO
62
63[revocation]
64AUTOSTART = NO
65FORCESTART = NO
diff --git a/src/core/test_core_defaults.conf b/src/core/test_core_defaults.conf
index 2184e103a..c73e9e092 100644
--- a/src/core/test_core_defaults.conf
+++ b/src/core/test_core_defaults.conf
@@ -1,3 +1,5 @@
1@INLINE@ ../../contrib/no_forcestart.conf
2
1[PATHS] 3[PATHS]
2GNUNET_TEST_HOME = /tmp/test-gnunet-core/ 4GNUNET_TEST_HOME = /tmp/test-gnunet-core/
3 5
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 26d0f1343..2bc29b9fe 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -137,7 +137,10 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
137 137
138 138
139static void 139static void
140check_success (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) 140check_success (void *cls,
141 int success,
142 struct GNUNET_TIME_Absolute min_expiration,
143 const char *msg)
141{ 144{
142 struct CpsRunContext *crc = cls; 145 struct CpsRunContext *crc = cls;
143 146
@@ -156,12 +159,16 @@ check_success (void *cls, int success, struct GNUNET_TIME_Absolute min_expiratio
156 159
157 160
158static void 161static void
159get_reserved (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) 162get_reserved (void *cls,
163 int success,
164 struct GNUNET_TIME_Absolute min_expiration,
165 const char *msg)
160{ 166{
161 struct CpsRunContext *crc = cls; 167 struct CpsRunContext *crc = cls;
162 168
163 if (0 >= success) 169 if (0 >= success)
164 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error obtaining reservation: `%s'\n", 170 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
171 "Error obtaining reservation: `%s'\n",
165 msg); 172 msg);
166 GNUNET_assert (0 < success); 173 GNUNET_assert (0 < success);
167 crc->rid = success; 174 crc->rid = success;
@@ -171,9 +178,14 @@ get_reserved (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration
171 178
172 179
173static void 180static void
174check_value (void *cls, const struct GNUNET_HashCode * key, size_t size, 181check_value (void *cls,
175 const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, 182 const struct GNUNET_HashCode *key,
176 uint32_t anonymity, struct GNUNET_TIME_Absolute expiration, 183 size_t size,
184 const void *data,
185 enum GNUNET_BLOCK_Type type,
186 uint32_t priority,
187 uint32_t anonymity,
188 struct GNUNET_TIME_Absolute expiration,
177 uint64_t uid) 189 uint64_t uid)
178{ 190{
179 struct CpsRunContext *crc = cls; 191 struct CpsRunContext *crc = cls;
@@ -183,7 +195,8 @@ check_value (void *cls, const struct GNUNET_HashCode * key, size_t size,
183 if (NULL == key) 195 if (NULL == key)
184 { 196 {
185 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 197 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
186 "Value check failed (got NULL key) in %d/%d\n", crc->phase, 198 "Value check failed (got NULL key) in %d/%d\n",
199 crc->phase,
187 crc->i); 200 crc->i);
188 crc->phase = RP_ERROR; 201 crc->phase = RP_ERROR;
189 GNUNET_SCHEDULER_add_continuation (&run_continuation, crc, 202 GNUNET_SCHEDULER_add_continuation (&run_continuation, crc,
@@ -218,14 +231,19 @@ check_value (void *cls, const struct GNUNET_HashCode * key, size_t size,
218 231
219 232
220static void 233static void
221delete_value (void *cls, const struct GNUNET_HashCode * key, size_t size, 234delete_value (void *cls,
222 const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, 235 const struct GNUNET_HashCode *key,
223 uint32_t anonymity, struct GNUNET_TIME_Absolute expiration, 236 size_t size,
237 const void *data,
238 enum GNUNET_BLOCK_Type type,
239 uint32_t priority,
240 uint32_t anonymity,
241 struct GNUNET_TIME_Absolute expiration,
224 uint64_t uid) 242 uint64_t uid)
225{ 243{
226 struct CpsRunContext *crc = cls; 244 struct CpsRunContext *crc = cls;
227 245
228 GNUNET_assert (crc->data == NULL); 246 GNUNET_assert (NULL == crc->data);
229 GNUNET_assert (NULL != key); 247 GNUNET_assert (NULL != key);
230 crc->size = size; 248 crc->size = size;
231 crc->key = *key; 249 crc->key = *key;
@@ -254,10 +272,15 @@ check_nothing (void *cls, const struct GNUNET_HashCode * key, size_t size,
254 272
255 273
256static void 274static void
257check_multiple (void *cls, const struct GNUNET_HashCode * key, size_t size, 275check_multiple (void *cls,
258 const void *data, enum GNUNET_BLOCK_Type type, 276 const struct GNUNET_HashCode *key,
259 uint32_t priority, uint32_t anonymity, 277 size_t size,
260 struct GNUNET_TIME_Absolute expiration, uint64_t uid) 278 const void *data,
279 enum GNUNET_BLOCK_Type type,
280 uint32_t priority,
281 uint32_t anonymity,
282 struct GNUNET_TIME_Absolute expiration,
283 uint64_t uid)
261{ 284{
262 struct CpsRunContext *crc = cls; 285 struct CpsRunContext *crc = cls;
263 286
@@ -286,9 +309,14 @@ check_multiple (void *cls, const struct GNUNET_HashCode * key, size_t size,
286 309
287 310
288static void 311static void
289check_update (void *cls, const struct GNUNET_HashCode * key, size_t size, 312check_update (void *cls,
290 const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, 313 const struct GNUNET_HashCode *key,
291 uint32_t anonymity, struct GNUNET_TIME_Absolute expiration, 314 size_t size,
315 const void *data,
316 enum GNUNET_BLOCK_Type type,
317 uint32_t priority,
318 uint32_t anonymity,
319 struct GNUNET_TIME_Absolute expiration,
292 uint64_t uid) 320 uint64_t uid)
293{ 321{
294 struct CpsRunContext *crc = cls; 322 struct CpsRunContext *crc = cls;
@@ -308,16 +336,21 @@ check_update (void *cls, const struct GNUNET_HashCode * key, size_t size,
308 336
309 337
310static void 338static void
311run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 339run_continuation (void *cls,
340 const struct GNUNET_SCHEDULER_TaskContext *tc)
312{ 341{
313 struct CpsRunContext *crc = cls; 342 struct CpsRunContext *crc = cls;
314 343
315 ok = (int) crc->phase; 344 ok = (int) crc->phase;
316 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test in phase %u\n", crc->phase); 345 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
346 "Test in phase %u\n",
347 crc->phase);
317 switch (crc->phase) 348 switch (crc->phase)
318 { 349 {
319 case RP_PUT: 350 case RP_PUT:
320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "PUT", 351 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
352 "Executing `%s' number %u\n",
353 "PUT",
321 crc->i); 354 crc->i);
322 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); 355 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
323 GNUNET_DATASTORE_put (datastore, 0, &crc->key, get_size (crc->i), 356 GNUNET_DATASTORE_put (datastore, 0, &crc->key, get_size (crc->i),
@@ -331,7 +364,9 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
331 break; 364 break;
332 case RP_GET: 365 case RP_GET:
333 crc->i--; 366 crc->i--;
334 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "GET", 367 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
368 "Executing `%s' number %u\n",
369 "GET",
335 crc->i); 370 crc->i);
336 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); 371 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
337 GNUNET_DATASTORE_get_key (datastore, crc->offset, &crc->key, 372 GNUNET_DATASTORE_get_key (datastore, crc->offset, &crc->key,
@@ -340,7 +375,9 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
340 break; 375 break;
341 case RP_DEL: 376 case RP_DEL:
342 crc->i--; 377 crc->i--;
343 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "DEL", 378 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
379 "Executing `%s' number %u\n",
380 "DEL",
344 crc->i); 381 crc->i);
345 crc->data = NULL; 382 crc->data = NULL;
346 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); 383 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
@@ -350,7 +387,9 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
350 &delete_value, crc)); 387 &delete_value, crc));
351 break; 388 break;
352 case RP_DO_DEL: 389 case RP_DO_DEL:
353 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", "DO_DEL", 390 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
391 "Executing `%s' number %u\n",
392 "DO_DEL",
354 crc->i); 393 crc->i);
355 if (crc->i == 0) 394 if (crc->i == 0)
356 { 395 {
@@ -368,7 +407,8 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
368 break; 407 break;
369 case RP_DELVALIDATE: 408 case RP_DELVALIDATE:
370 crc->i--; 409 crc->i--;
371 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing `%s' number %u\n", 410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
411 "Executing `%s' number %u\n",
372 "DEL-VALIDATE", crc->i); 412 "DEL-VALIDATE", crc->i);
373 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key); 413 GNUNET_CRYPTO_hash (&crc->i, sizeof (int), &crc->key);
374 GNUNET_assert (NULL != 414 GNUNET_assert (NULL !=
@@ -435,7 +475,10 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
435 475
436 476
437static void 477static void
438run_tests (void *cls, int32_t success, struct GNUNET_TIME_Absolute min_expiration, const char *msg) 478run_tests (void *cls,
479 int32_t success,
480 struct GNUNET_TIME_Absolute min_expiration,
481 const char *msg)
439{ 482{
440 struct CpsRunContext *crc = cls; 483 struct CpsRunContext *crc = cls;
441 484
@@ -446,7 +489,8 @@ run_tests (void *cls, int32_t success, struct GNUNET_TIME_Absolute min_expiratio
446 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 489 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
447 return; 490 return;
448 case GNUNET_NO: 491 case GNUNET_NO:
449 FPRINTF (stderr, "%s", "Test 'put' operation failed, key already exists (!?)\n"); 492 FPRINTF (stderr,
493 "%s", "Test 'put' operation failed, key already exists (!?)\n");
450 GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES); 494 GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
451 GNUNET_free (crc); 495 GNUNET_free (crc);
452 return; 496 return;
diff --git a/src/fs/test_fs_defaults.conf b/src/fs/test_fs_defaults.conf
index 97d8e6f87..a37c68938 100644
--- a/src/fs/test_fs_defaults.conf
+++ b/src/fs/test_fs_defaults.conf
@@ -1,3 +1,5 @@
1@INLINE@ ../../contrib/no_forcestart.conf
2
1[PATHS] 3[PATHS]
2GNUNET_TEST_HOME = /tmp/gnunet-test-fs-lib/ 4GNUNET_TEST_HOME = /tmp/gnunet-test-fs-lib/
3 5
diff --git a/src/statistics/test_statistics_api_data.conf b/src/statistics/test_statistics_api_data.conf
index c4fdb6aec..bf9a2c83e 100644
--- a/src/statistics/test_statistics_api_data.conf
+++ b/src/statistics/test_statistics_api_data.conf
@@ -1,35 +1,5 @@
1@INLINE@ ../../contrib/no_forcestart.conf
2
1[PATHS] 3[PATHS]
2GNUNET_TEST_HOME = /tmp/test-gnunet-statistics/ 4GNUNET_TEST_HOME = /tmp/test-gnunet-statistics/
3 5
4
5[statistics]
6PORT = 22353
7UNIXPATH = $GNUNET_RUNTIME_DIR/test-statistics-service-statistics.unix
8
9[arm]
10PORT = 22354
11UNIXPATH = $GNUNET_RUNTIME_DIR/test-statistics-service-arm.unix
12
13[hostlist]
14FORCESTART = NO
15
16[datastore]
17FORCESTART = NO
18
19[dht]
20FORCESTART = NO
21
22[nse]
23FORCESTART = NO
24
25[cadet]
26FORCESTART = NO
27
28[revocation]
29FORCESTART = NO
30
31[topology]
32FORCESTART = NO
33
34[fs]
35FORCESTART = NO \ No newline at end of file
diff --git a/src/transport/test_transport_defaults.conf b/src/transport/test_transport_defaults.conf
index 40b92433e..37b8a81f2 100644
--- a/src/transport/test_transport_defaults.conf
+++ b/src/transport/test_transport_defaults.conf
@@ -1,3 +1,5 @@
1@INLINE@ ../../contrib/no_forcestart.conf
2
1[PATHS] 3[PATHS]
2GNUNET_TEST_HOME = /tmp/test-transport-api/ 4GNUNET_TEST_HOME = /tmp/test-transport-api/
3 5
@@ -5,76 +7,7 @@ GNUNET_TEST_HOME = /tmp/test-transport-api/
5TIMEOUT = 300 s 7TIMEOUT = 300 s
6 8
7[transport] 9[transport]
8#PREFIX = valgrind -v --gen-suppressions=yes 10#PREFIX = valgrind -v --gen-suppressions=yes
9
10[core]
11AUTOSTART = NO
12FORCESTART = NO
13
14[datastore]
15AUTOSTART = NO
16
17[fs]
18AUTOSTART = NO
19FORCESTART = NO
20
21[dht]
22AUTOSTART = NO
23FORCESTART = NO
24
25[cadet]
26AUTOSTART = NO
27FORCESTART = NO
28
29[nse]
30AUTOSTART = NO
31FORCESTART = NO
32
33[dns]
34AUTOSTART = NO
35
36[dv]
37AUTOSTART = NO
38
39[gns]
40AUTOSTART = NO
41
42[namestore]
43AUTOSTART = NO
44
45[vpn]
46AUTOSTART = NO
47
48[consensus]
49AUTOSTART = NO
50
51[peerstore]
52AUTOSTART = NO
53
54[identity]
55AUTOSTART = NO
56
57[namecache]
58AUTOSTART = NO
59
60[sensor]
61AUTOSTART = NO
62
63[set]
64AUTOSTART = NO
65
66[psycstore]
67AUTOSTART = NO
68
69[regex]
70AUTOSTART = NO
71
72[sensordashboard]
73AUTOSTART = NO
74
75[revocation]
76AUTOSTART = NO
77FORCESTART = NO
78 11
79[nat] 12[nat]
80DISABLEV6 = NO 13DISABLEV6 = NO