From 925c210d978cd0e3dfc718d9e4c65ad713a817b9 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Thu, 15 Apr 2021 15:35:28 +0200 Subject: - added handling of asynchronous task to testing ng. added testbed commands for setting up test invironment (atm wihtout the use of the ne async handling) --- src/testbed/testbed_api_cmd_peer.c | 40 ++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'src/testbed/testbed_api_cmd_peer.c') diff --git a/src/testbed/testbed_api_cmd_peer.c b/src/testbed/testbed_api_cmd_peer.c index 4a727bc94..2e253e408 100644 --- a/src/testbed/testbed_api_cmd_peer.c +++ b/src/testbed/testbed_api_cmd_peer.c @@ -20,8 +20,8 @@ /** - * @file testbed/testbed_api_cmd_controller.c - * @brief Command to create a controller. + * @file testbed/testbed_api_cmd_peer.c + * @brief Command to create a peer. * @author t3sserakt */ #include "platform.h" @@ -54,10 +54,43 @@ peer_traits (void *cls, const char *trait, unsigned int index) { - (void) cls; + struct PeerCmdState *ps = cls; + + struct GNUNET_TESTING_Trait traits[] = { + { + .index = 0, + .trait_name = "peer", + .ptr = (const void *) ps->peer, + }, + GNUNET_TESTING_trait_end () + }; + + return GNUNET_TESTING_get_trait (traits, + ret, + trait, + index); + return GNUNET_OK; } +/** + * Offer data from trait + * + * @param cmd command to extract the controller from. + * @param peer pointer GNUNET_TESTBED_PEER + * @return #GNUNET_OK on success. + */ +int +GNUNET_TESTBED_get_trait_peer (const struct GNUNET_TESTING_Command *cmd, + struct GNUNET_TESTBED_Peer ** + peer) +{ + return cmd->traits (cmd->cls, + (const void **) peer, + "peer", + (unsigned int) 0); +} + /** * @@ -110,7 +143,6 @@ peer_started_cb (void *cls, if (NULL == emsg) { ps->peer_ready = GNUNET_YES; - GNUNET_TESTING_interpreter_next (ps->is); } else { -- cgit v1.2.3