diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-05-17 17:47:32 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-05-17 17:47:32 +0200 |
commit | 0bb06fab55268fef7d2d2ed01976852e16a9ecc9 (patch) | |
tree | 4dc2ffb9080106be6722edcbba66cfe70cb2af55 /src/bank-lib | |
parent | b09104aecf53fe261e8502d4cb2b5c5774dae063 (diff) | |
download | exchange-0bb06fab55268fef7d2d2ed01976852e16a9ecc9.tar.xz |
bank-lib looks first into env to get checkdb's name
Diffstat (limited to 'src/bank-lib')
-rw-r--r-- | src/bank-lib/test_bank_api.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c index 850b25ff6..5cf518355 100644 --- a/src/bank-lib/test_bank_api.c +++ b/src/bank-lib/test_bank_api.c @@ -111,6 +111,8 @@ main (int argc, struct GNUNET_OS_Process *bankd; unsigned int cnt; int result; + char *defaultdb = "postgres:///talercheck"; + char *dbconn; if (GNUNET_OK != GNUNET_NETWORK_test_port_free (IPPROTO_TCP, @@ -125,7 +127,12 @@ main (int argc, "WARNING", NULL); - if (0 != system ("taler-bank-manage --with-db=postgres:///talercheck django flush --no-input")) + if (NULL == (dbconn = getenv ("TALER_EXCHANGEDB_POSTGRES_CONFIG"))) + dbconn = defaultdb; + char *purgedb_cmd; + GNUNET_asprintf (&purgedb_cmd, "taler-bank-manage --with-db=%s django flush --no-input", + dbconn); + if (0 != system (purgedb_cmd)) { fprintf (stderr, "Could not purge database 'talercheck'\n"); @@ -137,7 +144,7 @@ main (int argc, NULL, NULL, NULL, "taler-bank-manage", "taler-bank-manage", - "--with-db", "postgres:///talercheck", + "--with-db", dbconn, "serve-http", "--port", "8080", NULL); |