diff options
Diffstat (limited to 'src/lib/testing_auditor_api_helpers.c')
-rw-r--r-- | src/lib/testing_auditor_api_helpers.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/lib/testing_auditor_api_helpers.c b/src/lib/testing_auditor_api_helpers.c index c85fe47b7..fd9de3537 100644 --- a/src/lib/testing_auditor_api_helpers.c +++ b/src/lib/testing_auditor_api_helpers.c @@ -99,6 +99,25 @@ struct MainWrapperContext /** + * Function called with information about the auditor. + * + * @param cls closure + * @param vi basic information about the auditor + * @param compat protocol compatibility information + */ +static void +auditor_version_cb + (void *cls, + const struct TALER_AUDITOR_VersionInformation *vi, + enum TALER_AUDITOR_VersionCompatibility compat) +{ + struct TALER_TESTING_Interpreter *is = cls; + + /* TODO: check vi/compat? */ + is->auditor_working = GNUNET_YES; +} + +/** * Setup the @a is 'auditor' member before running the main test loop. * * @param cls must be a `struct MainWrapperContext *` @@ -124,12 +143,23 @@ auditor_main_wrapper (void *cls, return; } + is->auditor = TALER_AUDITOR_connect (is->ctx, + auditor_base_url, + &auditor_version_cb, + is); GNUNET_free (auditor_base_url); + + if (NULL == is->auditor) + { + GNUNET_break (0); + return; + } + cc = GNUNET_new (struct CleanupContext); cc->is = is; cc->fcb = is->final_cleanup_cb; cc->fcb_cls = is->final_cleanup_cb; - is->final_cleanup_cb = NULL; + is->final_cleanup_cb = cleanup_auditor; is->final_cleanup_cb_cls = cc; mwc->main_cb (mwc->main_cb_cls, is); |