diff options
Diffstat (limited to 'src/testing/test_auditor_api_version.c')
-rw-r--r-- | src/testing/test_auditor_api_version.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/testing/test_auditor_api_version.c b/src/testing/test_auditor_api_version.c index 7b96525ac..dcd542ad8 100644 --- a/src/testing/test_auditor_api_version.c +++ b/src/testing/test_auditor_api_version.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018 Taler Systems SA + Copyright (C) 2014-2023 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 @@ -39,9 +39,9 @@ * Configuration file we use. One (big) configuration is used * for the various components for this test. */ -#define CONFIG_FILE "test_auditor_api.conf" +#define CONFIG_FILE "test_auditor_api-rsa.conf" -static struct TALER_AUDITOR_Handle *ah; +static struct TALER_AUDITOR_GetConfigHandle *ah; static struct GNUNET_CURL_Context *ctx; @@ -51,6 +51,7 @@ static int global_ret; static struct GNUNET_SCHEDULER_Task *tt; + static void do_shutdown (void *cls) { @@ -61,7 +62,11 @@ do_shutdown (void *cls) GNUNET_SCHEDULER_cancel (tt); tt = NULL; } - TALER_AUDITOR_disconnect (ah); + if (NULL != ah) + { + TALER_AUDITOR_get_config_cancel (ah); + ah = NULL; + } GNUNET_CURL_fini (ctx); GNUNET_CURL_gnunet_rc_destroy (rc); } @@ -81,19 +86,16 @@ do_timeout (void *cls) * Function called with information about the auditor. * * @param cls closure - * @param hr http response details - * @param vi basic information about the auditor - * @param compat protocol compatibility information + * @param vr response details */ static void version_cb (void *cls, - const struct TALER_AUDITOR_HttpResponse *hr, - const struct TALER_AUDITOR_VersionInformation *vi, - enum TALER_AUDITOR_VersionCompatibility compat) + const struct TALER_AUDITOR_ConfigResponse *vr) { - (void) hr; - if ( (NULL != vi) && - (TALER_AUDITOR_VC_MATCH == compat) ) + (void) cls; + ah = NULL; + if ( (MHD_HTTP_OK == vr->hr.http_status) && + (TALER_AUDITOR_VC_MATCH == vr->details.ok.compat) ) global_ret = 0; else global_ret = 2; @@ -116,10 +118,10 @@ run (void *cls) ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule, &rc); rc = GNUNET_CURL_gnunet_rc_create (ctx); - ah = TALER_AUDITOR_connect (ctx, - auditor_url, - &version_cb, - NULL); + ah = TALER_AUDITOR_get_config (ctx, + auditor_url, + &version_cb, + NULL); GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); tt = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, @@ -134,6 +136,8 @@ main (int argc, { struct GNUNET_OS_Process *proc; + (void) argc; + (void) argv; /* These environment variables get in the way... */ unsetenv ("XDG_DATA_HOME"); unsetenv ("XDG_CONFIG_HOME"); @@ -145,15 +149,16 @@ main (int argc, "taler-auditor-httpd", "taler-auditor-httpd", "-c", CONFIG_FILE, + "-L", "INFO", NULL); if (NULL == proc) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed to run `taler-auditor-httpd`," - " is your PATH correct?\n"); + "Failed to run `taler-auditor-httpd`, is your PATH correct?\n"); return 77; } - if (0 != TALER_TESTING_wait_auditor_ready ("http://localhost:8083/")) + global_ret = TALER_TESTING_wait_httpd_ready ("http://localhost:8083/"); + if (0 != global_ret) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to launch `taler-auditor-httpd`\n"); @@ -163,7 +168,8 @@ main (int argc, GNUNET_SCHEDULER_run (&run, NULL); } - GNUNET_OS_process_kill (proc, SIGTERM); + GNUNET_OS_process_kill (proc, + SIGTERM); GNUNET_OS_process_wait (proc); GNUNET_OS_process_destroy (proc); return global_ret; |