summaryrefslogtreecommitdiff
path: root/src/exchange-lib/testing_api_helpers.c
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-02-28 16:15:18 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-02-28 16:15:18 +0100
commited8dfac6db0cff37b69876e70da5b0341b50926f (patch)
treee0ff8aadcd20d09905d0b16e1f76d833dd62e272 /src/exchange-lib/testing_api_helpers.c
parent6b7ad9c50d5e6b5b7ffc88435d13625afd965f86 (diff)
downloadexchange-ed8dfac6db0cff37b69876e70da5b0341b50926f.tar.gz
exchange-ed8dfac6db0cff37b69876e70da5b0341b50926f.tar.bz2
exchange-ed8dfac6db0cff37b69876e70da5b0341b50926f.zip
helpers return exchange base url from config.
Diffstat (limited to 'src/exchange-lib/testing_api_helpers.c')
-rw-r--r--src/exchange-lib/testing_api_helpers.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/exchange-lib/testing_api_helpers.c b/src/exchange-lib/testing_api_helpers.c
index 690c222c9..50ee5e2ca 100644
--- a/src/exchange-lib/testing_api_helpers.c
+++ b/src/exchange-lib/testing_api_helpers.c
@@ -73,11 +73,15 @@ TALER_TESTING_cleanup_files (const char *config_name)
* launch the exchange process itself.
*
* @param config_filename configuration file to use
+ * @param base_url[out] will be set to the exchange base url,
+ * if the config has any; otherwise it will be set to
+ * NULL.
* @return #GNUNET_OK on success, #GNUNET_NO if test should be
* skipped, #GNUNET_SYSERR on test failure
*/
int
-TALER_TESTING_prepare_exchange (const char *config_filename)
+TALER_TESTING_prepare_exchange (const char *config_filename,
+ char **base_url)
{
struct GNUNET_OS_Process *proc;
enum GNUNET_OS_ProcessStatusType type;
@@ -110,6 +114,18 @@ TALER_TESTING_prepare_exchange (const char *config_filename)
(cfg, config_filename))
return GNUNET_SYSERR;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "exchange",
+ "BASE_URL",
+ base_url))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
+ "exchange",
+ "BASE_URL");
+ *base_url = NULL;
+ }
+
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
"paths",