log more nicely if authentication failed; do use new changepassword_unsafe to set bank pw -- and not others; do show stderr output of pybank in test cases
This commit is contained in:
parent
afc72f1f47
commit
a79b67c726
@ -21,18 +21,7 @@ taler-bank-manage -c $1 --with-db $2 django provide_accounts
|
|||||||
taler-bank-manage -c $1 --with-db $2 django add_bank_account 42
|
taler-bank-manage -c $1 --with-db $2 django add_bank_account 42
|
||||||
taler-bank-manage -c $1 --with-db $2 django add_bank_account 43
|
taler-bank-manage -c $1 --with-db $2 django add_bank_account 43
|
||||||
|
|
||||||
# This is 'x' hashed by Django
|
taler-bank-manage -c $1 --with-db $2 django changepassword_unsafe Exchange x
|
||||||
PW_HASH='pbkdf2_sha256$180000$RBYjEO0WzE1z$x2Avt35TkOL2pMHvts3B1U1NIJalXZf95WnJhGFOAUs='
|
|
||||||
|
|
||||||
# hack password hash directly into the database:
|
|
||||||
echo "UPDATE auth_user SET password='$PW_HASH'" | psql -Aqt $2
|
|
||||||
|
|
||||||
|
|
||||||
# Note that calling
|
|
||||||
# taler-bank-manage -c $1 --with-db $2 django changepassword Bank x
|
|
||||||
# does not work: (1) it always insists on going interactive, and (2)
|
|
||||||
# rejects 'x' as a password.
|
|
||||||
|
|
||||||
|
|
||||||
# Now run Django for good
|
# Now run Django for good
|
||||||
exec taler-bank-manage -c $1 --with-db $2 $3
|
exec taler-bank-manage -c $1 --with-db $2 $3
|
||||||
|
@ -220,8 +220,28 @@ confirmation_cb (void *cls,
|
|||||||
fts->reserve_history.details.in_details.wire_reference_size
|
fts->reserve_history.details.in_details.wire_reference_size
|
||||||
= sizeof (fts->row_id_nbo);
|
= sizeof (fts->row_id_nbo);
|
||||||
fts->aih = NULL;
|
fts->aih = NULL;
|
||||||
if (MHD_HTTP_OK != http_status)
|
switch (http_status)
|
||||||
{
|
{
|
||||||
|
case MHD_HTTP_OK:
|
||||||
|
fts->serial_id = serial_id;
|
||||||
|
fts->timestamp = timestamp;
|
||||||
|
TALER_TESTING_interpreter_next (is);
|
||||||
|
return;
|
||||||
|
case MHD_HTTP_UNAUTHORIZED:
|
||||||
|
switch (fts->auth.method)
|
||||||
|
{
|
||||||
|
case TALER_BANK_AUTH_NONE:
|
||||||
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
|
"Authentication required, but none configure.\n");
|
||||||
|
break;
|
||||||
|
case TALER_BANK_AUTH_BASIC:
|
||||||
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
|
"Basic authentication (%s) failed.\n",
|
||||||
|
fts->auth.details.basic.username);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
if (0 != fts->do_retry)
|
if (0 != fts->do_retry)
|
||||||
{
|
{
|
||||||
fts->do_retry--;
|
fts->do_retry--;
|
||||||
@ -229,8 +249,8 @@ confirmation_cb (void *cls,
|
|||||||
(TALER_EC_DB_COMMIT_FAILED_ON_RETRY == ec) ||
|
(TALER_EC_DB_COMMIT_FAILED_ON_RETRY == ec) ||
|
||||||
(MHD_HTTP_INTERNAL_SERVER_ERROR == http_status) )
|
(MHD_HTTP_INTERNAL_SERVER_ERROR == http_status) )
|
||||||
{
|
{
|
||||||
GNUNET_log
|
GNUNET_log (
|
||||||
(GNUNET_ERROR_TYPE_INFO,
|
GNUNET_ERROR_TYPE_INFO,
|
||||||
"Retrying fakebank transfer failed with %u/%d\n",
|
"Retrying fakebank transfer failed with %u/%d\n",
|
||||||
http_status,
|
http_status,
|
||||||
(int) ec);
|
(int) ec);
|
||||||
@ -241,25 +261,21 @@ confirmation_cb (void *cls,
|
|||||||
fts->backoff = GNUNET_TIME_randomized_backoff (fts->backoff,
|
fts->backoff = GNUNET_TIME_randomized_backoff (fts->backoff,
|
||||||
MAX_BACKOFF);
|
MAX_BACKOFF);
|
||||||
fts->is->commands[fts->is->ip].num_tries++;
|
fts->is->commands[fts->is->ip].num_tries++;
|
||||||
fts->retry_task = GNUNET_SCHEDULER_add_delayed
|
fts->retry_task = GNUNET_SCHEDULER_add_delayed (
|
||||||
(fts->backoff,
|
fts->backoff,
|
||||||
&do_retry,
|
&do_retry,
|
||||||
fts);
|
fts);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GNUNET_break (0);
|
break;
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
|
||||||
"Fakebank returned HTTP status %u/%d\n",
|
|
||||||
http_status,
|
|
||||||
(int) ec);
|
|
||||||
TALER_TESTING_interpreter_fail (is);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
GNUNET_break (0);
|
||||||
fts->serial_id = serial_id;
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
fts->timestamp = timestamp;
|
"Fakebank returned HTTP status %u/%d\n",
|
||||||
TALER_TESTING_interpreter_next (is);
|
http_status,
|
||||||
|
(int) ec);
|
||||||
|
TALER_TESTING_interpreter_fail (is);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ TALER_TESTING_run_libeufin (const struct TALER_TESTING_BankConfiguration *bc)
|
|||||||
char *curl_check_cmd;
|
char *curl_check_cmd;
|
||||||
|
|
||||||
nexus_proc = GNUNET_OS_start_process (
|
nexus_proc = GNUNET_OS_start_process (
|
||||||
GNUNET_OS_INHERIT_STD_NONE,
|
GNUNET_OS_INHERIT_STD_ERR,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
"libeufin-nexus",
|
"libeufin-nexus",
|
||||||
"libeufin-nexus",
|
"libeufin-nexus",
|
||||||
@ -165,7 +165,7 @@ TALER_TESTING_run_libeufin (const struct TALER_TESTING_BankConfiguration *bc)
|
|||||||
fprintf (stderr, "\n");
|
fprintf (stderr, "\n");
|
||||||
|
|
||||||
sandbox_proc = GNUNET_OS_start_process (
|
sandbox_proc = GNUNET_OS_start_process (
|
||||||
GNUNET_OS_INHERIT_STD_NONE,
|
GNUNET_OS_INHERIT_STD_ERR,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
"libeufin-sandbox",
|
"libeufin-sandbox",
|
||||||
"libeufin-sandbox",
|
"libeufin-sandbox",
|
||||||
@ -268,7 +268,7 @@ TALER_TESTING_run_bank (const char *config_filename,
|
|||||||
}
|
}
|
||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
bank_proc = GNUNET_OS_start_process (
|
bank_proc = GNUNET_OS_start_process (
|
||||||
GNUNET_OS_INHERIT_STD_NONE,
|
GNUNET_OS_INHERIT_STD_ERR,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
"taler-bank-manage-testing",
|
"taler-bank-manage-testing",
|
||||||
"taler-bank-manage-testing",
|
"taler-bank-manage-testing",
|
||||||
@ -524,9 +524,11 @@ TALER_TESTING_prepare_bank (const char *config_filename,
|
|||||||
/* DB preparation */
|
/* DB preparation */
|
||||||
if (GNUNET_YES == reset_db)
|
if (GNUNET_YES == reset_db)
|
||||||
{
|
{
|
||||||
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
|
"Flushing bank database\n");
|
||||||
if (NULL ==
|
if (NULL ==
|
||||||
(dbreset_proc = GNUNET_OS_start_process (
|
(dbreset_proc = GNUNET_OS_start_process (
|
||||||
GNUNET_OS_INHERIT_STD_NONE,
|
GNUNET_OS_INHERIT_STD_ERR,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
"taler-bank-manage",
|
"taler-bank-manage",
|
||||||
"taler-bank-manage",
|
"taler-bank-manage",
|
||||||
@ -542,7 +544,6 @@ TALER_TESTING_prepare_bank (const char *config_filename,
|
|||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_free (database);
|
|
||||||
|
|
||||||
if (GNUNET_SYSERR ==
|
if (GNUNET_SYSERR ==
|
||||||
GNUNET_OS_process_wait_status (dbreset_proc,
|
GNUNET_OS_process_wait_status (dbreset_proc,
|
||||||
@ -552,17 +553,21 @@ TALER_TESTING_prepare_bank (const char *config_filename,
|
|||||||
GNUNET_OS_process_destroy (dbreset_proc);
|
GNUNET_OS_process_destroy (dbreset_proc);
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
|
GNUNET_free (database);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (type == GNUNET_OS_PROCESS_EXITED) &&
|
if ( (type == GNUNET_OS_PROCESS_EXITED) &&
|
||||||
(0 != code) )
|
(0 != code) )
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Failed to setup database\n");
|
"Failed to setup database `%s'\n",
|
||||||
|
database);
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
|
GNUNET_free (database);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
GNUNET_free (database);
|
||||||
if ( (type != GNUNET_OS_PROCESS_EXITED) ||
|
if ( (type != GNUNET_OS_PROCESS_EXITED) ||
|
||||||
(0 != code) )
|
(0 != code) )
|
||||||
{
|
{
|
||||||
@ -591,11 +596,14 @@ TALER_TESTING_prepare_bank (const char *config_filename,
|
|||||||
"Using pybank %s on port %u\n",
|
"Using pybank %s on port %u\n",
|
||||||
bc->exchange_auth.wire_gateway_url,
|
bc->exchange_auth.wire_gateway_url,
|
||||||
(unsigned int) port);
|
(unsigned int) port);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "exchange payto: %s\n",
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
|
"exchange payto: %s\n",
|
||||||
bc->exchange_payto);
|
bc->exchange_payto);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "user42_payto: %s\n",
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
|
"user42_payto: %s\n",
|
||||||
bc->user42_payto);
|
bc->user42_payto);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "user42_payto: %s\n",
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
|
"user43_payto: %s\n",
|
||||||
bc->user43_payto);
|
bc->user43_payto);
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user