From 8d5f42fe0cff134120e462c7e905403f7d38b9d6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 12 Mar 2020 10:53:49 +0100 Subject: add separate commands for closer/transfer steps, modify test cases to use new commands --- src/testing/test_taler_exchange_aggregator.c | 97 ++++++++++++++++------------ 1 file changed, 55 insertions(+), 42 deletions(-) (limited to 'src/testing/test_taler_exchange_aggregator.c') diff --git a/src/testing/test_taler_exchange_aggregator.c b/src/testing/test_taler_exchange_aggregator.c index 2e8a35ce2..66cdecffa 100644 --- a/src/testing/test_taler_exchange_aggregator.c +++ b/src/testing/test_taler_exchange_aggregator.c @@ -58,6 +58,19 @@ static char *config_filename; #define USER42_ACCOUNT "42" +/** + * Execute the taler-exchange-aggregator, closer and transfer commands with + * our configuration file. + * + * @param label label to use for the command. + * @param cfg_fn configuration file to use + */ +#define CMD_EXEC_AGGREGATOR(label, cfg_fn) \ + TALER_TESTING_cmd_exec_aggregator (label "-aggregator", cfg_fn), \ + TALER_TESTING_cmd_exec_closer (label "-closer", cfg_fn), \ + TALER_TESTING_cmd_exec_transfer (label "-transfer", cfg_fn) + + /** * Collects all the tests. */ @@ -68,8 +81,8 @@ run (void *cls, struct TALER_TESTING_Command all[] = { // check no aggregation happens on a empty database - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-on-empty-db", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-on-empty-db", + config_filename), TALER_TESTING_cmd_check_bank_empty ("expect-empty-transactions-on-start"), /* check aggregation happens on the simplest case: @@ -81,8 +94,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:1", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-on-deposit-1", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-on-deposit-1", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-1", ec.exchange_url, @@ -108,8 +121,8 @@ run (void *cls, "EUR:1", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-2", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-2", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-2", ec.exchange_url, @@ -140,8 +153,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:1", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-3", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-3", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-3a", ec.exchange_url, @@ -179,15 +192,15 @@ run (void *cls, 5), "EUR:0.2", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-4-early", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-4-early", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-4-fast"), TALER_TESTING_cmd_sleep ("wait (5s)", 5), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-4-delayed", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-4-delayed", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-4", ec.exchange_url, "EUR:0.19", @@ -214,15 +227,15 @@ run (void *cls, 5), "EUR:0.2", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-5-early", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-5-early", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-5-early"), TALER_TESTING_cmd_sleep ("wait (5s)", 5), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-5-delayed", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-5-delayed", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-5", ec.exchange_url, "EUR:0.19", @@ -236,8 +249,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.102", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-6a-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-6a-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-6a-tiny"), TALER_TESTING_cmd_insert_deposit ("do-deposit-6b", @@ -254,8 +267,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.102", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-6c-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-6c-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-6c-tiny"), TALER_TESTING_cmd_insert_deposit ("do-deposit-6d", @@ -265,8 +278,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.102", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-6d-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-6d-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-6d-tiny"), TALER_TESTING_cmd_insert_deposit ("do-deposit-6e", @@ -276,8 +289,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.112", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-6e", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-6e", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-6", ec.exchange_url, "EUR:0.01", @@ -292,8 +305,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.109", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-7a-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-7a-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-7a-tiny"), TALER_TESTING_cmd_insert_deposit ("do-deposit-7b", @@ -303,8 +316,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.119", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-7-profit", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-7-profit", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-7", ec.exchange_url, "EUR:0.01", @@ -319,8 +332,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.122", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-7-loss", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-7-loss", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-7", ec.exchange_url, "EUR:0.01", @@ -337,8 +350,8 @@ run (void *cls, 5), "EUR:0.109", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-8a-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-8a-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-8a-tiny"), TALER_TESTING_cmd_insert_deposit ("do-deposit-8b", @@ -350,8 +363,8 @@ run (void *cls, 5), "EUR:0.109", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-8b-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-8b-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-8b-tiny"), @@ -363,8 +376,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.122", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-8", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-8", + config_filename), TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-8", ec.exchange_url, "EUR:0.03", @@ -381,8 +394,8 @@ run (void *cls, 5), "EUR:0.104", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-9a-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-9a-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-9a-tiny"), TALER_TESTING_cmd_insert_deposit ("do-deposit-9b", @@ -394,8 +407,8 @@ run (void *cls, 5), "EUR:0.105", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-9b-tiny", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-9b-tiny", + config_filename), TALER_TESTING_cmd_check_bank_empty ( "expect-empty-transactions-after-9b-tiny"), @@ -407,8 +420,8 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, "EUR:0.112", "EUR:0.1"), - TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-9", - config_filename), + CMD_EXEC_AGGREGATOR ("run-aggregator-deposit-9", + config_filename), /* 0.009 + 0.009 + 0.022 - 0.001 - 0.002 - 0.008 = 0.029 => 0.02 */ TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-9", ec.exchange_url, -- cgit v1.2.3