diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-31 20:57:10 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-31 20:57:10 +0000 |
commit | e4470b481f70375bdc0f7fe2fdce7e7c831b496b (patch) | |
tree | 412e27c871316dab9b92ad42ae80c0c98da3ed5b /src/testing | |
parent | 36291b73fab94a984ae4f7314f983e18492238be (diff) | |
download | gnunet-e4470b481f70375bdc0f7fe2fdce7e7c831b496b.tar.gz gnunet-e4470b481f70375bdc0f7fe2fdce7e7c831b496b.zip |
- doc & improvements
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index a96df9674..f4584db30 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -190,12 +190,17 @@ struct GNUNET_TESTING_Peer | |||
190 | */ | 190 | */ |
191 | struct GNUNET_CONFIGURATION_Handle *cfg; | 191 | struct GNUNET_CONFIGURATION_Handle *cfg; |
192 | 192 | ||
193 | /** | ||
194 | * The callback to call if asynchronous functions are used for peer/service | ||
195 | * start/stop requests | ||
196 | */ | ||
193 | GNUNET_TESTING_PeerStatusCallback cb; | 197 | GNUNET_TESTING_PeerStatusCallback cb; |
194 | 198 | ||
199 | /** | ||
200 | * The closure for the above callback | ||
201 | */ | ||
195 | void *cb_cls; | 202 | void *cb_cls; |
196 | 203 | ||
197 | struct GNUNET_ARM_MonitorHandle *mh; | ||
198 | |||
199 | /** | 204 | /** |
200 | * The cached identity of this peer. Will be populated on call to | 205 | * The cached identity of this peer. Will be populated on call to |
201 | * GNUNET_TESTING_peer_get_identity() | 206 | * GNUNET_TESTING_peer_get_identity() |
@@ -979,7 +984,6 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, | |||
979 | } | 984 | } |
980 | peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer)); | 985 | peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer)); |
981 | peer->cfgfile = config_filename; /* Free in peer_destroy */ | 986 | peer->cfgfile = config_filename; /* Free in peer_destroy */ |
982 | peer->cfg = GNUNET_CONFIGURATION_dup (cfg); | ||
983 | libexec_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 987 | libexec_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
984 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string(cfg, "arm", "PREFIX", &peer->main_binary)) | 988 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string(cfg, "arm", "PREFIX", &peer->main_binary)) |
985 | { | 989 | { |
@@ -1029,6 +1033,7 @@ GNUNET_TESTING_peer_configure2 (struct GNUNET_TESTING_System *system, | |||
1029 | emsg); | 1033 | emsg); |
1030 | if (NULL == peer) | 1034 | if (NULL == peer) |
1031 | return NULL; | 1035 | return NULL; |
1036 | peer->cfg = GNUNET_CONFIGURATION_dup (cfg); | ||
1032 | peer->cb = status_cb; | 1037 | peer->cb = status_cb; |
1033 | peer->cb_cls = cls; | 1038 | peer->cb_cls = cls; |
1034 | return peer; | 1039 | return peer; |
@@ -1193,10 +1198,10 @@ GNUNET_TESTING_peer_start2 (struct GNUNET_TESTING_Peer *peer, | |||
1193 | return GNUNET_SYSERR; | 1198 | return GNUNET_SYSERR; |
1194 | } | 1199 | } |
1195 | GNUNET_assert (NULL != peer->cb); | 1200 | GNUNET_assert (NULL != peer->cb); |
1201 | GNUNET_assert (NULL != peer->cfg); | ||
1196 | peer->ah = GNUNET_ARM_connect (peer->cfg, &conn_status, peer); | 1202 | peer->ah = GNUNET_ARM_connect (peer->cfg, &conn_status, peer); |
1197 | if (NULL == peer->ah) | 1203 | if (NULL == peer->ah) |
1198 | return GNUNET_SYSERR; | 1204 | return GNUNET_SYSERR; |
1199 | //GNUNET_TESTING_peer_service_start (peer, "arm", &arm_start_result_cb, peer); | ||
1200 | GNUNET_TESTING_peer_service_start (peer, "arm", timeout, NULL, NULL); | 1205 | GNUNET_TESTING_peer_service_start (peer, "arm", timeout, NULL, NULL); |
1201 | return GNUNET_OK; | 1206 | return GNUNET_OK; |
1202 | } | 1207 | } |
@@ -1303,7 +1308,8 @@ GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer) | |||
1303 | if (NULL != peer->ah) | 1308 | if (NULL != peer->ah) |
1304 | GNUNET_ARM_disconnect_and_free (peer->ah); | 1309 | GNUNET_ARM_disconnect_and_free (peer->ah); |
1305 | GNUNET_free (peer->cfgfile); | 1310 | GNUNET_free (peer->cfgfile); |
1306 | GNUNET_CONFIGURATION_destroy (peer->cfg); | 1311 | if (NULL != peer->cfg) |
1312 | GNUNET_CONFIGURATION_destroy (peer->cfg); | ||
1307 | GNUNET_free (peer->main_binary); | 1313 | GNUNET_free (peer->main_binary); |
1308 | GNUNET_free (peer->args); | 1314 | GNUNET_free (peer->args); |
1309 | GNUNET_free_non_null (peer->id); | 1315 | GNUNET_free_non_null (peer->id); |