diff options
| author | Christian Grothoff <christian@grothoff.org> | 2018-11-11 15:46:06 +0100 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2018-11-11 15:46:06 +0100 | 
| commit | debe0d05ade761127ac98ee47bc23a6f47d77d37 (patch) | |
| tree | a39325192a8809c21158219304184887c90a11c4 /src/include | |
| parent | 277f90bf2ba38e1e33ab761e2052f0807730364b (diff) | |
improve auditor support in libtalertesting
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/taler_auditordb_plugin.h | 2 | ||||
| -rw-r--r-- | src/include/taler_testing_auditor_lib.h | 38 | ||||
| -rw-r--r-- | src/include/taler_testing_lib.h | 90 | 
3 files changed, 91 insertions, 39 deletions
| diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h index 92494ab3..aa280b1b 100644 --- a/src/include/taler_auditordb_plugin.h +++ b/src/include/taler_auditordb_plugin.h @@ -540,7 +540,7 @@ struct TALER_AUDITORDB_Plugin    /** -   * Get information about a deposit confirmations from the database. +   * Get information about deposit confirmations from the database.     *     * @param cls the @e cls of this struct with the plugin-specific state     * @param session connection to the database diff --git a/src/include/taler_testing_auditor_lib.h b/src/include/taler_testing_auditor_lib.h index e091c9f8..2a11b74c 100644 --- a/src/include/taler_testing_auditor_lib.h +++ b/src/include/taler_testing_auditor_lib.h @@ -36,42 +36,4 @@  /* ********************* Helper functions ********************* */ -/** - * Wait for the auditor to have started. Waits for at - * most 10s, after that returns 77 to indicate an error. - * - * @param base_url what URL should we expect the exchange - *        to be running at - * @return 0 on success - */ -int -TALER_TESTING_AUDITOR_wait_auditor_ready (const char *base_url); - - -/** - * Remove files from previous runs - */ -void -TALER_TESTING_AUDITOR_cleanup_files (const char *config_name); - - -/** - * Initialize scheduler loop and curl context for the testcase - * including starting and stopping the auditor and exchange using the - * given configuration file. - * - * @param main_cb routine containing all the commands to run. - * @param main_cb_cls closure for @a main_cb, typically NULL. - * @param config_file configuration file for the test-suite. - * - * @return #GNUNET_OK if all is okay, != #GNUNET_OK otherwise. - *         non-#GNUNET_OK codes are #GNUNET_SYSERR most of the - *         time. - */ -int -TALER_TESTING_AUDITOR_setup_with_auditor (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 e278cfff..cbc28f53 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -213,6 +213,22 @@ TALER_TESTING_run_auditor_sign (const char *config_filename,  /** + * Run `taler-auditor-exchange`. + * + * @param config_filename configuration file to use + * @param exchange_master_pub master public key of the exchange + * @param exchange_base_url what is the base URL of the exchange + * @param do_remove #GNUNET_NO to add exchange, #GNUNET_YES to remove + * @return #GNUNET_OK on success + */ +int +TALER_TESTING_run_auditor_exchange (const char *config_filename, +                                    const char *exchange_master_pub, +                                    const char *exchange_base_url, +                                    int do_remove); + + +/**   * Test port in URL string for availability.   */  int @@ -565,6 +581,42 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,  /** + * Closure for #TALER_TESTING_setup_with_exchange_cfg(). + */ +struct TALER_TESTING_SetupContext +{ +  /** +   * Main function of the test to run. +   */ +  TALER_TESTING_Main main_cb; + +  /** +   * Closure for @e main_cb. +   */ +  void *main_cb_cls; + +  /** +   * Name of the configuration file. +   */ +  const char *config_filename; +}; + + +/** + * Initialize scheduler loop and curl context for the test case + * including starting and stopping the exchange using the given + * configuration file. + * + * @param cls must be a `struct TALER_TESTING_SetupContext *` + * @param cfg configuration to use. + * @return #GNUNET_OK if no errors occurred. + */ +int +TALER_TESTING_setup_with_exchange_cfg (void *cls, +                                       const struct GNUNET_CONFIGURATION_Handle *cfg); + + +/**   * Initialize scheduler loop and curl context for the test case   * including starting and stopping the exchange using the given   * configuration file. @@ -584,6 +636,44 @@ TALER_TESTING_setup_with_exchange (TALER_TESTING_Main main_cb,                                     void *main_cb_cls,                                     const char *config_file); + +/** + * Initialize scheduler loop and curl context for the test case + * including starting and stopping the auditor and exchange using the + * given configuration file. + * + * @param cls must be a `struct TALER_TESTING_SetupContext *` + * @param cfg configuration to use. + * @return #GNUNET_OK if no errors occurred. + */ +int +TALER_TESTING_setup_with_auditor_and_exchange_cfg (void *cls, +                                                   const struct GNUNET_CONFIGURATION_Handle *cfg); + + +/** + * Initialize scheduler loop and curl context for the test case + * including starting and stopping the auditor and exchange using the + * given configuration file. + * + * @param main_cb main method. + * @param main_cb_cls main method closure. + * @param config_filename configuration file name.  Is is used + *        by both this function and the exchange itself.  In the + *        first case it gives out the exchange port number and + *        the exchange base URL so as to check whether the port + *        is available and the exchange responds when requested + *        at its base URL. + * @return #GNUNET_OK if no errors occurred. + */ +int +TALER_TESTING_setup_with_auditor_and_exchange (TALER_TESTING_Main main_cb, +                                               void *main_cb_cls, +                                               const char *config_file); + + + +  /* ************** Specific interpreter commands ************ */  /** | 
