diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2014-01-08 21:29:00 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2014-01-08 21:29:00 +0000 |
commit | 7ab6edba583d8d09d2c830c9c5b6fe155d31b408 (patch) | |
tree | d17756d007570647e62e15e1bf5f1e112ceca37d | |
parent | e7c031de1d196d5450213fad53419f76c0299109 (diff) | |
download | gnunet-7ab6edba583d8d09d2c830c9c5b6fe155d31b408.tar.gz gnunet-7ab6edba583d8d09d2c830c9c5b6fe155d31b408.zip |
-fixes
-rw-r--r-- | src/testbed/gnunet-daemon-testbed-underlay.c | 8 | ||||
-rw-r--r-- | src/testbed/test_testbed_underlay.c | 19 | ||||
-rw-r--r-- | src/testbed/test_testbed_underlay.conf.in | 1 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 5 |
4 files changed, 29 insertions, 4 deletions
diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c index 0e77dc4cd..9716b36c6 100644 --- a/src/testbed/gnunet-daemon-testbed-underlay.c +++ b/src/testbed/gnunet-daemon-testbed-underlay.c | |||
@@ -158,7 +158,13 @@ check_access (void *cls, const struct GNUNET_PeerIdentity * pid) | |||
158 | 158 | ||
159 | GNUNET_assert (NULL != map); | 159 | GNUNET_assert (NULL != map); |
160 | contains = GNUNET_CONTAINER_multipeermap_contains (map, pid); | 160 | contains = GNUNET_CONTAINER_multipeermap_contains (map, pid); |
161 | return (contains) ? GNUNET_OK : GNUNET_SYSERR; | 161 | if (GNUNET_YES == contains) |
162 | { | ||
163 | DEBUG ("Permitting `%s'\n", GNUNET_i2s (pid)); | ||
164 | return GNUNET_OK; | ||
165 | } | ||
166 | DEBUG ("Not permitting `%s'\n", GNUNET_i2s (pid)); | ||
167 | return GNUNET_SYSERR; | ||
162 | } | 168 | } |
163 | 169 | ||
164 | 170 | ||
diff --git a/src/testbed/test_testbed_underlay.c b/src/testbed/test_testbed_underlay.c index 6b66a5f7a..fe70036f7 100644 --- a/src/testbed/test_testbed_underlay.c +++ b/src/testbed/test_testbed_underlay.c | |||
@@ -43,6 +43,21 @@ static struct GNUNET_TESTBED_Operation *op; | |||
43 | 43 | ||
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Shutdown testcase | ||
47 | * | ||
48 | * @param cls NULL | ||
49 | * @param tc scheduler task context | ||
50 | */ | ||
51 | static void | ||
52 | do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
53 | { | ||
54 | if (NULL != op) | ||
55 | GNUNET_TESTBED_operation_done (op); | ||
56 | op = NULL; | ||
57 | } | ||
58 | |||
59 | |||
60 | /** | ||
46 | * Callback to be called when an operation is completed | 61 | * Callback to be called when an operation is completed |
47 | * | 62 | * |
48 | * @param cls the callback closure from functions generating an operation | 63 | * @param cls the callback closure from functions generating an operation |
@@ -90,6 +105,7 @@ test_master (void *cls, | |||
90 | if (NULL == peers_) | 105 | if (NULL == peers_) |
91 | { | 106 | { |
92 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n"); | 107 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n"); |
108 | GNUNET_SCHEDULER_shutdown (); | ||
93 | return; | 109 | return; |
94 | } | 110 | } |
95 | GNUNET_assert (NUM_PEERS == num_peers); | 111 | GNUNET_assert (NUM_PEERS == num_peers); |
@@ -99,6 +115,9 @@ test_master (void *cls, | |||
99 | NULL, | 115 | NULL, |
100 | peers_[0], | 116 | peers_[0], |
101 | peers_[2]); | 117 | peers_[2]); |
118 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | ||
119 | 15), | ||
120 | &do_shutdown, NULL); | ||
102 | } | 121 | } |
103 | 122 | ||
104 | 123 | ||
diff --git a/src/testbed/test_testbed_underlay.conf.in b/src/testbed/test_testbed_underlay.conf.in index 647360ec1..f1ae59ac8 100644 --- a/src/testbed/test_testbed_underlay.conf.in +++ b/src/testbed/test_testbed_underlay.conf.in | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | [testbed] | 3 | [testbed] |
4 | OVERLAY_TOPOLOGY = LINE | 4 | OVERLAY_TOPOLOGY = LINE |
5 | OPERATION_TIMEOUT = 5 s | ||
5 | 6 | ||
6 | [testbed-underlay] | 7 | [testbed-underlay] |
7 | AUTOSTART = NO | 8 | AUTOSTART = NO |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index cbfc4812d..2be565e63 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -448,12 +448,11 @@ remove_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation *rc | |||
448 | /** | 448 | /** |
449 | * Assuming all peers have been destroyed cleanup run handle | 449 | * Assuming all peers have been destroyed cleanup run handle |
450 | * | 450 | * |
451 | * @param cls the run handle | 451 | * @param rc the run context |
452 | */ | 452 | */ |
453 | static void | 453 | static void |
454 | cleanup (void *cls) | 454 | cleanup (struct GNUNET_TESTBED_RunHandle *rc) |
455 | { | 455 | { |
456 | struct GNUNET_TESTBED_RunHandle *rc = cls; | ||
457 | unsigned int hid; | 456 | unsigned int hid; |
458 | 457 | ||
459 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rc->register_hosts_task); | 458 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rc->register_hosts_task); |