Minor changes to make tests pass/no-skip again.

This commit is contained in:
Marcello Stanisci 2018-11-19 23:02:37 +01:00
parent 423f05970a
commit 368f3a9a66
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
8 changed files with 32 additions and 10 deletions

View File

@ -498,14 +498,19 @@ int
main (int argc,
char * const *argv)
{
if (1)
return 77; // FIXME: test not yet ready
/* These environment variables get in the way... */
unsetenv ("XDG_DATA_HOME");
unsetenv ("XDG_CONFIG_HOME");
GNUNET_log_setup ("test-auditor-api",
"INFO",
NULL);
if (1)
{
TALER_LOG_WARNING ("Test not yet ready\n");
return 77; // FIXME: test not yet ready
}
if (NULL == (fakebank_url
/* Check fakebank port is available and config cares
* about bank url. */

View File

@ -153,6 +153,7 @@ postgres_drop_tables (void *cls)
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 auditor_exchanges CASCADE;"),
GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS deposit_confirmations CASCADE;"),
GNUNET_PQ_EXECUTE_STATEMENT_END
};
PGconn *conn;

View File

@ -1481,7 +1481,7 @@ request_keys (void *cls)
kr));
kr->job = GNUNET_CURL_job_add (exchange->ctx,
eh,
GNUNET_NO,
GNUNET_YES,
&keys_completed_cb,
kr);
exchange->kr = kr;

View File

@ -60,6 +60,11 @@ static char *fakebank_url;
*/
static char *exchange_url;
/**
* Auditor URL, unused but needed to achieve compilation.
*/
static char *auditor_url;
/**
* Twister process.
*/
@ -367,6 +372,7 @@ main (int argc,
TALER_TESTING_cleanup_files (CONFIG_FILE);
switch (TALER_TESTING_prepare_exchange (CONFIG_FILE,
&auditor_url,
&exchange_url))
{
case GNUNET_SYSERR:
@ -381,7 +387,8 @@ main (int argc,
(CONFIG_FILE)))
return 77;
ret = TALER_TESTING_setup_with_exchange (&run, NULL,
ret = TALER_TESTING_setup_with_exchange (&run,
NULL,
CONFIG_FILE);
purge_process (twisterd);
GNUNET_free (twister_url);

View File

@ -67,8 +67,11 @@ BASE_URL = "http://localhost:8888/"
[exchangedb-postgres]
DB_CONN_STR = "postgres:///talercheck"
[auditor]
BASE_URL = "http://the.auditor/"
[auditordb-postgres]
DB_CONN_STR = "postgres:///talercheck"
CONFIG = "postgres:///talercheck"
[account-2]
URL = payto://x-taler-bank/localhost:8082/2

View File

@ -113,7 +113,9 @@ auditor_iter (void *cls,
}
if (size < sizeof (struct AuditorFileHeaderP))
{
GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Unrecognized size for file `%s', skipping\n",
filename);
return GNUNET_OK;
}
af = GNUNET_malloc (size);

View File

@ -1228,7 +1228,8 @@ interpret (struct PERF_TALER_EXCHANGEDB_interpreter_state *state)
data = &state->cmd[source_index].exposed;
ret = state->plugin->have_deposit (state->plugin->cls,
state->session,
data->data.deposit);
data->data.deposit,
GNUNET_YES);
GNUNET_assert (0 >= ret);
}
break;

View File

@ -1942,7 +1942,8 @@ run (void *cls)
FAILIF (1 !=
plugin->have_deposit (plugin->cls,
session,
&deposit));
&deposit,
GNUNET_YES));
{
struct GNUNET_TIME_Absolute start_range;
struct GNUNET_TIME_Absolute end_range;
@ -2032,13 +2033,15 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
plugin->have_deposit (plugin->cls,
session,
&deposit2));
&deposit2,
GNUNET_YES));
deposit2.merchant_pub = deposit.merchant_pub;
RND_BLK (&deposit2.coin.coin_pub); /* should fail if coin is different */
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
plugin->have_deposit (plugin->cls,
session,
&deposit2));
&deposit2,
GNUNET_YES));
FAILIF (GNUNET_OK !=
test_melting (session));