summaryrefslogtreecommitdiff
path: root/src/exchange-lib/test_exchange_api_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange-lib/test_exchange_api_new.c')
-rw-r--r--src/exchange-lib/test_exchange_api_new.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/exchange-lib/test_exchange_api_new.c b/src/exchange-lib/test_exchange_api_new.c
index 0e4800002..75f5fe6a1 100644
--- a/src/exchange-lib/test_exchange_api_new.c
+++ b/src/exchange-lib/test_exchange_api_new.c
@@ -42,6 +42,8 @@
*/
#define CONFIG_FILE "test_exchange_api.conf"
+#define CONFIG_FILE_EXPIRE_RESERVE_NOW "test_exchange_api_expire_reserve_now.conf"
+
/**
* Is the configuration file is set to include wire format 'ebics'?
* Requires that EBICS /history function is implemented, which it
@@ -639,6 +641,47 @@ run (void *cls,
MHD_HTTP_OK),
/**
+ * These commands should close the reserve because
+ * the aggregator is given a config file that ovverrides
+ * the reserve expiration time (making it now-ish)
+ */
+ CMD_TRANSFER_TO_EXCHANGE
+ ("short-lived-reserve",
+ "EUR:5.01"),
+
+ TALER_TESTING_cmd_exec_wirewatch
+ ("short-lived-aggregation",
+ CONFIG_FILE_EXPIRE_RESERVE_NOW),
+
+ TALER_TESTING_cmd_exec_aggregator
+ ("close-reserves",
+ CONFIG_FILE_EXPIRE_RESERVE_NOW),
+
+ TALER_TESTING_cmd_withdraw_amount
+ ("expired-withdraw",
+ is->exchange,
+ "short-lived-reserve",
+ "EUR:1",
+ MHD_HTTP_FORBIDDEN),
+
+ /* Should also test a "insufficient funds" error
+ * after payback happened. */
+
+ TALER_TESTING_cmd_check_bank_transfer
+ ("check_bank_short-lived_transfer",
+ exchange_url,
+ "EUR:5.01",
+ 42,
+ 2),
+
+ TALER_TESTING_cmd_check_bank_transfer
+ ("check_bank_short-lived_reimburse",
+ exchange_url,
+ "EUR:5",
+ 2,
+ 42),
+
+ /**
* Fill reserve with EUR:2.02, as withdraw fee is 1 ct per
* config, then withdraw two coin, partially spend one, and
* then have the rest paid back. Check deposit of other coin