add option to be selective about dropping the exchange list
This commit is contained in:
parent
e56ed85f4f
commit
a98825675b
4
src/auditor-lib/.gitignore
vendored
4
src/auditor-lib/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
test_auditor_api
|
|
||||||
test_exchange_api_home/.local/share/taler/auditors/
|
|
||||||
test_exchange_api_home/.local/share/taler/exchange/live-keys/
|
|
||||||
auditor.in
|
|
@ -64,7 +64,8 @@ run (void *cls,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (reset_db)
|
if (reset_db)
|
||||||
(void) plugin->drop_tables (plugin->cls);
|
(void) plugin->drop_tables (plugin->cls,
|
||||||
|
GNUNET_YES);
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
plugin->create_tables (plugin->cls))
|
plugin->create_tables (plugin->cls))
|
||||||
{
|
{
|
||||||
|
@ -4529,7 +4529,8 @@ run (void *cls,
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"Full audit restart requested, dropping old audit data.\n");
|
"Full audit restart requested, dropping old audit data.\n");
|
||||||
GNUNET_break (GNUNET_OK ==
|
GNUNET_break (GNUNET_OK ==
|
||||||
adb->drop_tables (adb->cls));
|
adb->drop_tables (adb->cls,
|
||||||
|
GNUNET_NO));
|
||||||
TALER_AUDITORDB_plugin_unload (adb);
|
TALER_AUDITORDB_plugin_unload (adb);
|
||||||
if (NULL ==
|
if (NULL ==
|
||||||
(adb = TALER_AUDITORDB_plugin_load (cfg)))
|
(adb = TALER_AUDITORDB_plugin_load (cfg)))
|
||||||
|
@ -1605,7 +1605,8 @@ run (void *cls,
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"Full audit restart requested, dropping old audit data.\n");
|
"Full audit restart requested, dropping old audit data.\n");
|
||||||
GNUNET_break (GNUNET_OK ==
|
GNUNET_break (GNUNET_OK ==
|
||||||
adb->drop_tables (adb->cls));
|
adb->drop_tables (adb->cls,
|
||||||
|
GNUNET_NO));
|
||||||
TALER_AUDITORDB_plugin_unload (adb);
|
TALER_AUDITORDB_plugin_unload (adb);
|
||||||
if (NULL ==
|
if (NULL ==
|
||||||
(adb = TALER_AUDITORDB_plugin_load (cfg)))
|
(adb = TALER_AUDITORDB_plugin_load (cfg)))
|
||||||
|
@ -131,10 +131,12 @@ connect_to_postgres (struct PostgresClosure *pc)
|
|||||||
* Drop all Taler tables. This should only be used by testcases.
|
* Drop all Taler tables. This should only be used by testcases.
|
||||||
*
|
*
|
||||||
* @param cls the `struct PostgresClosure` with the plugin-specific state
|
* @param cls the `struct PostgresClosure` with the plugin-specific state
|
||||||
|
* @param drop_exchangelist should we also drop the exchange table?
|
||||||
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
|
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
postgres_drop_tables (void *cls)
|
postgres_drop_tables (void *cls,
|
||||||
|
int drop_exchangelist)
|
||||||
{
|
{
|
||||||
struct PostgresClosure *pc = cls;
|
struct PostgresClosure *pc = cls;
|
||||||
struct GNUNET_PQ_ExecuteStatement es[] = {
|
struct GNUNET_PQ_ExecuteStatement es[] = {
|
||||||
@ -152,10 +154,13 @@ postgres_drop_tables (void *cls)
|
|||||||
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS auditor_progress_deposit_confirmation;"),
|
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS auditor_progress_deposit_confirmation;"),
|
||||||
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS auditor_progress_coin;"),
|
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS auditor_progress_coin;"),
|
||||||
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS wire_auditor_progress;"),
|
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS wire_auditor_progress;"),
|
||||||
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS auditor_exchanges CASCADE;"),
|
|
||||||
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS deposit_confirmations CASCADE;"),
|
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS deposit_confirmations CASCADE;"),
|
||||||
GNUNET_PQ_EXECUTE_STATEMENT_END
|
GNUNET_PQ_EXECUTE_STATEMENT_END
|
||||||
};
|
};
|
||||||
|
struct GNUNET_PQ_ExecuteStatement esx[] = {
|
||||||
|
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS auditor_exchanges CASCADE;"),
|
||||||
|
GNUNET_PQ_EXECUTE_STATEMENT_END
|
||||||
|
};
|
||||||
PGconn *conn;
|
PGconn *conn;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -166,6 +171,10 @@ postgres_drop_tables (void *cls)
|
|||||||
"Dropping ALL tables\n");
|
"Dropping ALL tables\n");
|
||||||
ret = GNUNET_PQ_exec_statements (conn,
|
ret = GNUNET_PQ_exec_statements (conn,
|
||||||
es);
|
es);
|
||||||
|
if ( (ret >= 0) &&
|
||||||
|
(drop_exchangelist) )
|
||||||
|
ret = GNUNET_PQ_exec_statements (conn,
|
||||||
|
esx);
|
||||||
/* TODO: we probably need a bit more fine-grained control
|
/* TODO: we probably need a bit more fine-grained control
|
||||||
over drops for the '-r' option of taler-auditor; also,
|
over drops for the '-r' option of taler-auditor; also,
|
||||||
for the testcase, we currently fail to drop the
|
for the testcase, we currently fail to drop the
|
||||||
|
@ -401,10 +401,12 @@ struct TALER_AUDITORDB_Plugin
|
|||||||
* Drop the Taler tables. This should only be used in testcases.
|
* Drop the Taler tables. This should only be used in testcases.
|
||||||
*
|
*
|
||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
* @param cls the @e cls of this struct with the plugin-specific state
|
||||||
|
* @param drop_exchangelist should we also drop the list of audited exchanges
|
||||||
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
|
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
(*drop_tables) (void *cls);
|
(*drop_tables) (void *cls,
|
||||||
|
int drop_exchangelist);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -292,77 +292,66 @@ run (void *cls,
|
|||||||
"EUR:10.10",
|
"EUR:10.10",
|
||||||
42,
|
42,
|
||||||
2),
|
2),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-1",
|
("check-massive-transfer-1",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-2",
|
("check-massive-transfer-2",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-3",
|
("check-massive-transfer-3",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-4",
|
("check-massive-transfer-4",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-5",
|
("check-massive-transfer-5",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-6",
|
("check-massive-transfer-6",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-7",
|
("check-massive-transfer-7",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-8",
|
("check-massive-transfer-8",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-9",
|
("check-massive-transfer-9",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_transfer
|
TALER_TESTING_cmd_check_bank_transfer
|
||||||
("check-massive-transfer-10",
|
("check-massive-transfer-10",
|
||||||
exchange_url,
|
exchange_url,
|
||||||
"EUR:0.98",
|
"EUR:0.98",
|
||||||
2,
|
2,
|
||||||
43),
|
43),
|
||||||
|
|
||||||
TALER_TESTING_cmd_check_bank_empty ("check_bank_empty"),
|
TALER_TESTING_cmd_check_bank_empty ("check_bank_empty"),
|
||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
@ -559,9 +548,7 @@ run (void *cls,
|
|||||||
*/
|
*/
|
||||||
CMD_TRANSFER_TO_EXCHANGE ("massive-reserve",
|
CMD_TRANSFER_TO_EXCHANGE ("massive-reserve",
|
||||||
"EUR:10.10"),
|
"EUR:10.10"),
|
||||||
|
|
||||||
CMD_EXEC_WIREWATCH ("massive-wirewatch"),
|
CMD_EXEC_WIREWATCH ("massive-wirewatch"),
|
||||||
|
|
||||||
TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-1",
|
TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-1",
|
||||||
"massive-reserve",
|
"massive-reserve",
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
@ -622,7 +609,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-2",
|
("massive-deposit-2",
|
||||||
"massive-withdraw-2",
|
"massive-withdraw-2",
|
||||||
@ -634,7 +620,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-3",
|
("massive-deposit-3",
|
||||||
"massive-withdraw-3",
|
"massive-withdraw-3",
|
||||||
@ -646,7 +631,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-4",
|
("massive-deposit-4",
|
||||||
"massive-withdraw-4",
|
"massive-withdraw-4",
|
||||||
@ -658,7 +642,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-5",
|
("massive-deposit-5",
|
||||||
"massive-withdraw-5",
|
"massive-withdraw-5",
|
||||||
@ -670,7 +653,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-6",
|
("massive-deposit-6",
|
||||||
"massive-withdraw-6",
|
"massive-withdraw-6",
|
||||||
@ -682,7 +664,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-7",
|
("massive-deposit-7",
|
||||||
"massive-withdraw-7",
|
"massive-withdraw-7",
|
||||||
@ -694,7 +675,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-8",
|
("massive-deposit-8",
|
||||||
"massive-withdraw-8",
|
"massive-withdraw-8",
|
||||||
@ -706,7 +686,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-9",
|
("massive-deposit-9",
|
||||||
"massive-withdraw-9",
|
"massive-withdraw-9",
|
||||||
@ -718,8 +697,6 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
|
|
||||||
TALER_TESTING_cmd_deposit
|
TALER_TESTING_cmd_deposit
|
||||||
("massive-deposit-10",
|
("massive-deposit-10",
|
||||||
"massive-withdraw-10",
|
"massive-withdraw-10",
|
||||||
@ -731,14 +708,12 @@ run (void *cls,
|
|||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
"EUR:1",
|
"EUR:1",
|
||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
|
|
||||||
CMD_RUN_AUDITOR("massive-auditor"),
|
CMD_RUN_AUDITOR("massive-auditor"),
|
||||||
|
|
||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TALER_TESTING_Command commands[] = {
|
struct TALER_TESTING_Command commands[] = {
|
||||||
|
|
||||||
CMD_RUN_AUDITOR ("virgin-auditor"),
|
CMD_RUN_AUDITOR ("virgin-auditor"),
|
||||||
CMD_RUN_WIRE_AUDITOR ("virgin-wire-auditor"),
|
CMD_RUN_WIRE_AUDITOR ("virgin-wire-auditor"),
|
||||||
TALER_TESTING_cmd_exchanges_with_url ("check-exchange",
|
TALER_TESTING_cmd_exchanges_with_url ("check-exchange",
|
||||||
|
Loading…
Reference in New Issue
Block a user