diff options
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/Makefile.am | 5 | ||||
-rw-r--r-- | src/exchangedb/pg_insert_wire.c | 4 | ||||
-rw-r--r-- | src/exchangedb/pg_insert_wire.h | 4 | ||||
-rw-r--r-- | src/exchangedb/pg_update_wire.c | 4 | ||||
-rw-r--r-- | src/exchangedb/pg_update_wire.h | 4 | ||||
-rwxr-xr-x | src/exchangedb/test_idempotency.sh | 11 |
6 files changed, 24 insertions, 8 deletions
diff --git a/src/exchangedb/Makefile.am b/src/exchangedb/Makefile.am index 4df9cb406..c2e87e5da 100644 --- a/src/exchangedb/Makefile.am +++ b/src/exchangedb/Makefile.am @@ -65,6 +65,9 @@ exchange-0004.sql: exchange-0004.sql.in 0004-*.sql gcc -E -P -undef - < exchange-0004.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ chmod ugo-w $@ +check_SCRIPTS = \ + test_idempotency.sh + EXTRA_DIST = \ exchangedb.conf \ exchangedb-postgres.conf \ @@ -72,6 +75,7 @@ EXTRA_DIST = \ test-exchange-db-postgres.conf \ $(sqlinputs) \ $(sql_DATA) \ + $(check_SCRIPTS) \ pg_template.h pg_template.c \ pg_template.sh @@ -311,6 +315,7 @@ noinst_PROGRAMS = \ AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH; TESTS = \ + $(check_SCRIPTS) \ $(check_PROGRAMS) test_exchangedb_postgres_SOURCES = \ diff --git a/src/exchangedb/pg_insert_wire.c b/src/exchangedb/pg_insert_wire.c index 8329a04af..066143b92 100644 --- a/src/exchangedb/pg_insert_wire.c +++ b/src/exchangedb/pg_insert_wire.c @@ -30,8 +30,8 @@ enum GNUNET_DB_QueryStatus TEH_PG_insert_wire (void *cls, const char *payto_uri, const char *conversion_url, - json_t *debit_restrictions, - json_t *credit_restrictions, + const json_t *debit_restrictions, + const json_t *credit_restrictions, struct GNUNET_TIME_Timestamp start_date, const struct TALER_MasterSignatureP *master_sig) { diff --git a/src/exchangedb/pg_insert_wire.h b/src/exchangedb/pg_insert_wire.h index c949327d7..358946719 100644 --- a/src/exchangedb/pg_insert_wire.h +++ b/src/exchangedb/pg_insert_wire.h @@ -42,8 +42,8 @@ enum GNUNET_DB_QueryStatus TEH_PG_insert_wire (void *cls, const char *payto_uri, const char *conversion_url, - json_t *debit_restrictions, - json_t *credit_restrictions, + const json_t *debit_restrictions, + const json_t *credit_restrictions, struct GNUNET_TIME_Timestamp start_date, const struct TALER_MasterSignatureP *master_sig); diff --git a/src/exchangedb/pg_update_wire.c b/src/exchangedb/pg_update_wire.c index 0c4ec7b58..f3b074686 100644 --- a/src/exchangedb/pg_update_wire.c +++ b/src/exchangedb/pg_update_wire.c @@ -30,8 +30,8 @@ enum GNUNET_DB_QueryStatus TEH_PG_update_wire (void *cls, const char *payto_uri, const char *conversion_url, - json_t *debit_restrictions, - json_t *credit_restrictions, + const json_t *debit_restrictions, + const json_t *credit_restrictions, struct GNUNET_TIME_Timestamp change_date, bool enabled) { diff --git a/src/exchangedb/pg_update_wire.h b/src/exchangedb/pg_update_wire.h index 360b8845a..ecdbc405a 100644 --- a/src/exchangedb/pg_update_wire.h +++ b/src/exchangedb/pg_update_wire.h @@ -43,8 +43,8 @@ enum GNUNET_DB_QueryStatus TEH_PG_update_wire (void *cls, const char *payto_uri, const char *conversion_url, - json_t *debit_restrictions, - json_t *credit_restrictions, + const json_t *debit_restrictions, + const json_t *credit_restrictions, struct GNUNET_TIME_Timestamp change_date, bool enabled); diff --git a/src/exchangedb/test_idempotency.sh b/src/exchangedb/test_idempotency.sh new file mode 100755 index 000000000..6ab5d1332 --- /dev/null +++ b/src/exchangedb/test_idempotency.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# This file is in the public domain. +set -eu +echo "Initializing DB" +taler-exchange-dbinit -r test-exchange-db-postgres.conf +echo "Re-initializing DB" +taler-exchange-dbinit test-exchange-db-postgres.conf +echo "Re-loading procedures" +psql talercheck < procedures.sql +echo "Test PASSED" +exit 0 |