diff options
author | xrs <xrs@mail36.net> | 2020-03-20 14:56:21 +0100 |
---|---|---|
committer | xrs <xrs@mail36.net> | 2020-05-21 22:46:49 +0200 |
commit | cdea4f7ba00100c83b41d4820588e375b1bb996c (patch) | |
tree | c0bbb973745ed32fef794c7a1ead65444dbf1981 /src | |
parent | bb4940568b6ccf5915c8a4b5bcffd5dbdfe8e54d (diff) | |
download | gnunet-cdea4f7ba00100c83b41d4820588e375b1bb996c.tar.gz gnunet-cdea4f7ba00100c83b41d4820588e375b1bb996c.zip |
close port at testbed disconnect
Diffstat (limited to 'src')
-rw-r--r-- | src/cadet/test_cadeT.c | 1 | ||||
-rw-r--r-- | src/cadet/test_cadeT_util.c | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/cadet/test_cadeT.c b/src/cadet/test_cadeT.c index 3bf8e2ad9..5e92084a6 100644 --- a/src/cadet/test_cadeT.c +++ b/src/cadet/test_cadeT.c | |||
@@ -45,6 +45,7 @@ | |||
45 | * - GNUNET_TESTBED_underlay_configure_link not implemented | 45 | * - GNUNET_TESTBED_underlay_configure_link not implemented |
46 | * - GNUNET_TESTBED_underlaylinkmodel_set_link not usable | 46 | * - GNUNET_TESTBED_underlaylinkmodel_set_link not usable |
47 | * - GNUNET_TESTBED_peer_stop evokes standard service disconnect | 47 | * - GNUNET_TESTBED_peer_stop evokes standard service disconnect |
48 | * - GNUNET_TESTBED_peer_destroy and GNUNET_TESTBED_peer_create | ||
48 | * - how can we test the sublayers of CADET, e.g. connection, tunnel, channel? | 49 | * - how can we test the sublayers of CADET, e.g. connection, tunnel, channel? |
49 | * | 50 | * |
50 | * Development | 51 | * Development |
diff --git a/src/cadet/test_cadeT_util.c b/src/cadet/test_cadeT_util.c index f2082a006..bc66adbdc 100644 --- a/src/cadet/test_cadeT_util.c +++ b/src/cadet/test_cadeT_util.c | |||
@@ -41,6 +41,11 @@ static struct GNUNET_TESTBED_Operation *testbed_info_req[REQUESTED_PEERS]; | |||
41 | static struct GNUNET_HashCode hashed_portname; | 41 | static struct GNUNET_HashCode hashed_portname; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Port handle. | ||
45 | */ | ||
46 | struct GNUNET_CADET_Port *port; | ||
47 | |||
48 | /** | ||
44 | * Result of the test. | 49 | * Result of the test. |
45 | */ | 50 | */ |
46 | int test_result = 0; | 51 | int test_result = 0; |
@@ -78,6 +83,9 @@ disconnect_from_peer (void *cls, | |||
78 | 83 | ||
79 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); | 84 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); |
80 | 85 | ||
86 | if (0 == strncmp ("listening_peer", cls, sizeof (cls))) | ||
87 | GNUNET_CADET_close_port (port); | ||
88 | |||
81 | GNUNET_CADET_disconnect (cadet); | 89 | GNUNET_CADET_disconnect (cadet); |
82 | } | 90 | } |
83 | 91 | ||
@@ -134,7 +142,6 @@ setup_listening_peer (void *cls, | |||
134 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 142 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
135 | { | 143 | { |
136 | struct GNUNET_CADET_Handle *cadet; | 144 | struct GNUNET_CADET_Handle *cadet; |
137 | struct GNUNET_CADET_Port *port; | ||
138 | struct GNUNET_MQ_MessageHandler msg_handlers[] = { | 145 | struct GNUNET_MQ_MessageHandler msg_handlers[] = { |
139 | GNUNET_MQ_hd_fixed_size (message, | 146 | GNUNET_MQ_hd_fixed_size (message, |
140 | GNUNET_MESSAGE_TYPE_DUMMY, | 147 | GNUNET_MESSAGE_TYPE_DUMMY, |
@@ -198,13 +205,13 @@ connect_to_service (void *cb_cls, | |||
198 | "cadet", | 205 | "cadet", |
199 | &check_test_readyness, NULL, | 206 | &check_test_readyness, NULL, |
200 | &setup_listening_peer, | 207 | &setup_listening_peer, |
201 | &disconnect_from_peer, NULL); | 208 | &disconnect_from_peer, "listening_peer"); |
202 | testbed_to_svc[0] = | 209 | testbed_to_svc[0] = |
203 | GNUNET_TESTBED_service_connect (NULL, test_peers[0].testbed_peer, | 210 | GNUNET_TESTBED_service_connect (NULL, test_peers[0].testbed_peer, |
204 | "cadet", | 211 | "cadet", |
205 | &check_test_readyness, NULL, | 212 | &check_test_readyness, NULL, |
206 | &setup_initiating_peer, | 213 | &setup_initiating_peer, |
207 | &disconnect_from_peer, NULL); | 214 | &disconnect_from_peer, "initiating_peer"); |
208 | } | 215 | } |
209 | } | 216 | } |
210 | 217 | ||