diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/Makefile.am | 1 | ||||
-rw-r--r-- | src/include/taler_auditor_service.h | 6 | ||||
-rw-r--r-- | src/include/taler_curl_lib.h | 4 | ||||
-rw-r--r-- | src/include/taler_exchangedb_plugin.h | 2 | ||||
-rw-r--r-- | src/include/taler_mhd_lib.h | 1 | ||||
-rw-r--r-- | src/include/taler_testing_auditor_lib.h | 172 | ||||
-rw-r--r-- | src/include/taler_testing_lib.h | 131 |
7 files changed, 137 insertions, 180 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 08ed62ec7..b8ea0d175 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -16,7 +16,6 @@ talerinclude_HEADERS = \ taler_exchangedb_plugin.h \ taler_fakebank_lib.h \ taler_json_lib.h \ - taler_testing_auditor_lib.h \ taler_testing_lib.h \ taler_util.h \ taler_mhd_lib.h \ diff --git a/src/include/taler_auditor_service.h b/src/include/taler_auditor_service.h index 012db8ba1..486e7cc4b 100644 --- a/src/include/taler_auditor_service.h +++ b/src/include/taler_auditor_service.h @@ -246,7 +246,7 @@ TALER_AUDITOR_deposit_confirmation (struct TALER_AUDITOR_Handle *auditor, * Cancel a deposit-confirmation permission request. This function cannot be used * on a request handle if a response is already served for it. * - * @param deposit-confirmation the deposit-confirmation permission request handle + * @param deposit_confirmation the deposit-confirmation permission request handle */ void TALER_AUDITOR_deposit_confirmation_cancel (struct @@ -316,10 +316,10 @@ TALER_AUDITOR_list_exchanges (struct TALER_AUDITOR_Handle *auditor, /** - * Cancel a deposit-confirmation permission request. This function cannot be used + * Cancel a list exchanges request. This function cannot be used * on a request handle if a response is already served for it. * - * @param deposit-confirmation the deposit-confirmation permission request handle + * @param leh the list exchanges request handle */ void TALER_AUDITOR_list_exchanges_cancel (struct diff --git a/src/include/taler_curl_lib.h b/src/include/taler_curl_lib.h index a38c0fce1..9fa0005a8 100644 --- a/src/include/taler_curl_lib.h +++ b/src/include/taler_curl_lib.h @@ -54,7 +54,7 @@ struct TALER_CURL_PostContext * Add the @a body as POST data to the easy handle in * @a ctx. * - * @param ctx[in,out] a request context (updated) + * @param[in,out] ctx a request context (updated) * @param eh easy handle to use * @param body JSON body to add to @e ctx * @return #GNUNET_OK on success #GNUNET_SYSERR on failure @@ -68,7 +68,7 @@ TALER_curl_easy_post (struct TALER_CURL_PostContext *ctx, /** * Free the data in @a ctx. * - * @param ctx[in] a request context (updated) + * @param[in] ctx a request context (updated) */ void TALER_curl_easy_post_finished (struct TALER_CURL_PostContext *ctx); diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 451650d09..27dcc3440 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1543,7 +1543,7 @@ typedef void /** * Function called with information about the exchange's denomination keys. * - * @parma cls closure + * @param cls closure * @param denom_pub public key of the denomination * @param issue detailed information about the denomination (value, expiration times, fees) */ diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h index e82d8d75f..fdf60d561 100644 --- a/src/include/taler_mhd_lib.h +++ b/src/include/taler_mhd_lib.h @@ -204,7 +204,6 @@ TALER_MHD_reply_agpl (struct MHD_Connection *connection, * Function to call to handle the request by sending * back static data. * - * @param rh context of the handler * @param connection the MHD connection to handle * @param http_status status code to return * @param mime_type content-type to use diff --git a/src/include/taler_testing_auditor_lib.h b/src/include/taler_testing_auditor_lib.h deleted file mode 100644 index b12cce986..000000000 --- a/src/include/taler_testing_auditor_lib.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - This file is part of TALER - (C) 2018 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 3, or - (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with TALER; see the file COPYING. If not, see - <http://www.gnu.org/licenses/> -*/ - -/** - * @file include/taler_testing_auditor_lib.h - * @brief API for writing an interpreter to test Taler components - * @author Christian Grothoff <christian@grothoff.org> - * @author Marcello Stanisci - */ -#ifndef TALER_TESTING_AUDITOR_LIB_H -#define TALER_TESTING_AUDITOR_LIB_H - -#include "taler_util.h" -#include "taler_exchange_service.h" -#include <gnunet/gnunet_json_lib.h> -#include "taler_json_lib.h" -#include <microhttpd.h> - - -/* ********************* Commands ********************* */ - -/** - * Make the "exec-auditor" CMD. - * - * @param label command label. - * @param config_filename configuration filename. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_auditor (const char *label, - const char *config_filename); - - -/** - * Make the "exec-auditor-dbinit" CMD. Always run with the "-r" option. - * - * @param label command label. - * @param config_filename configuration filename. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_auditor_dbinit (const char *label, - const char *config_filename); - - -/** - * Make the "exec wire-auditor" CMD. - * - * @param label command label. - * @param config_filename configuration filename. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_wire_auditor (const char *label, - const char *config_filename); - - -/** - * Create a "deposit-confirmation" command. - * - * @param label command label. - * @param auditor auditor connection. - * @param deposit_reference reference to any operation that can - * provide a coin. - * @param coin_index if @a deposit_reference offers an array of - * coins, this parameter selects which one in that array. - * This value is currently ignored, as only one-coin - * deposits are implemented. - * @param amount_without_fee deposited amount without the fee - * @param expected_response_code expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_deposit_confirmation (const char *label, - struct TALER_AUDITOR_Handle *auditor, - const char *deposit_reference, - unsigned int coin_index, - const char *amount_without_fee, - unsigned int expected_response_code); - - -/** - * Modify a deposit confirmation command to enable retries when we get - * transient errors from the auditor. - * - * @param cmd a deposit confirmation command - * @return the command with retries enabled - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_deposit_confirmation_with_retry (struct TALER_TESTING_Command - cmd); - - -/** - * Create a "list exchanges" command. - * - * @param label command label. - * @param auditor auditor connection. - * @param expected_response_code expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exchanges (const char *label, - struct TALER_AUDITOR_Handle *auditor, - unsigned int expected_response_code); - - -/** - * Create a "list exchanges" command and check whether - * a particular exchange belongs to the returned bundle. - * - * @param label command label. - * @param auditor auditor connection. - * @param expected_response_code expected HTTP response code. - * @param exchange_url URL of the exchange supposed to - * be included in the response. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exchanges_with_url (const char *label, - unsigned int expected_response_code, - const char *exchange_url); - -/** - * Modify an exchanges command to enable retries when we get - * transient errors from the auditor. - * - * @param cmd a deposit confirmation command - * @return the command with retries enabled - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exchanges_with_retry (struct TALER_TESTING_Command cmd); - - -/* ********************* Helper functions ********************* */ - - -/** - * Install signal handlers plus schedules the main wrapper - * around the "run" method. - * - * @param main_cb the "run" method which contains all the - * commands. - * @param main_cb_cls a closure for "run", typically NULL. - * @param config_filename configuration filename. - * @return #GNUNET_OK if all is okay, != #GNUNET_OK otherwise. - * non-GNUNET_OK codes are #GNUNET_SYSERR most of the - * times. - */ -int -TALER_TESTING_AUDITOR_setup (TALER_TESTING_Main main_cb, - void *main_cb_cls, - const char *config_filename); - - -#endif diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 060bbd0a7..6af1b6b90 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -657,6 +657,24 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb, /** + * Install signal handlers plus schedules the main wrapper + * around the "run" method. + * + * @param main_cb the "run" method which contains all the + * commands. + * @param main_cb_cls a closure for "run", typically NULL. + * @param config_filename configuration filename. + * @return #GNUNET_OK if all is okay, != #GNUNET_OK otherwise. + * non-GNUNET_OK codes are #GNUNET_SYSERR most of the + * times. + */ +int +TALER_TESTING_auditor_setup (TALER_TESTING_Main main_cb, + void *main_cb_cls, + const char *config_filename); + + +/** * Closure for #TALER_TESTING_setup_with_exchange_cfg(). */ struct TALER_TESTING_SetupContext @@ -868,6 +886,119 @@ TALER_TESTING_cmd_transfer (const char *label, const char *exchange_base_url); +/** + * Make the "exec-auditor" CMD. + * + * @param label command label. + * @param config_filename configuration filename. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exec_auditor (const char *label, + const char *config_filename); + + +/** + * Make the "exec-auditor-dbinit" CMD. Always run with the "-r" option. + * + * @param label command label. + * @param config_filename configuration filename. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exec_auditor_dbinit (const char *label, + const char *config_filename); + + +/** + * Make the "exec wire-auditor" CMD. + * + * @param label command label. + * @param config_filename configuration filename. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exec_wire_auditor (const char *label, + const char *config_filename); + + +/** + * Create a "deposit-confirmation" command. + * + * @param label command label. + * @param auditor auditor connection. + * @param deposit_reference reference to any operation that can + * provide a coin. + * @param coin_index if @a deposit_reference offers an array of + * coins, this parameter selects which one in that array. + * This value is currently ignored, as only one-coin + * deposits are implemented. + * @param amount_without_fee deposited amount without the fee + * @param expected_response_code expected HTTP response code. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_deposit_confirmation (const char *label, + struct TALER_AUDITOR_Handle *auditor, + const char *deposit_reference, + unsigned int coin_index, + const char *amount_without_fee, + unsigned int expected_response_code); + + +/** + * Modify a deposit confirmation command to enable retries when we get + * transient errors from the auditor. + * + * @param cmd a deposit confirmation command + * @return the command with retries enabled + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_deposit_confirmation_with_retry (struct TALER_TESTING_Command + cmd); + + +/** + * Create a "list exchanges" command. + * + * @param label command label. + * @param auditor auditor connection. + * @param expected_response_code expected HTTP response code. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exchanges (const char *label, + struct TALER_AUDITOR_Handle *auditor, + unsigned int expected_response_code); + + +/** + * Create a "list exchanges" command and check whether + * a particular exchange belongs to the returned bundle. + * + * @param label command label. + * @param auditor auditor connection. + * @param expected_response_code expected HTTP response code. + * @param exchange_url URL of the exchange supposed to + * be included in the response. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exchanges_with_url (const char *label, + unsigned int expected_response_code, + const char *exchange_url); + +/** + * Modify an exchanges command to enable retries when we get + * transient errors from the auditor. + * + * @param cmd a deposit confirmation command + * @return the command with retries enabled + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_exchanges_with_retry (struct TALER_TESTING_Command cmd); + + /* ***** Commands ONLY for testing (/admin-API) **** */ /** |