[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] 04/04: add --test option to taler-exchange
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] 04/04: add --test option to taler-exchange-wirewatch |
Date: |
Sun, 11 Jun 2017 11:57:52 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit 1eb739c670ffdb3363f54b1efdcb8343cb1bd272
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jun 11 11:57:05 2017 +0200
add --test option to taler-exchange-wirewatch
---
doc/taler-exchange-wirewatch.1 | 3 +++
src/exchange/taler-exchange-wirewatch.c | 16 ++++++++++++++++
src/exchange/test_taler_exchange_wirewatch.c | 1 +
3 files changed, 20 insertions(+)
diff --git a/doc/taler-exchange-wirewatch.1 b/doc/taler-exchange-wirewatch.1
index 72006e6..41a4afa 100644
--- a/doc/taler-exchange-wirewatch.1
+++ b/doc/taler-exchange-wirewatch.1
@@ -19,6 +19,9 @@ Use the specified wire plugin and its configuration to talk
to the bank.
.IP "\-h, \-\-help"
Print short help on options.
.B
+.IP "\-T, \-\-test"
+Run in test mode and exit when idle.
+.B
.IP "\-v, \-\-version"
Print version information.
.B
diff --git a/src/exchange/taler-exchange-wirewatch.c
b/src/exchange/taler-exchange-wirewatch.c
index a300921..0a7923a 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -95,6 +95,11 @@ static char *type;
static int delay;
/**
+ * Are we run in testing mode and should only do one pass?
+ */
+static int test_mode;
+
+/**
* Next task to run, if any.
*/
static struct GNUNET_SCHEDULER_Task *task;
@@ -234,6 +239,12 @@ history_cb (void *cls,
start_off = last_row_off;
start_off_size = last_row_off_size;
}
+ if ( (GNUNET_YES == delay) &&
+ (test_mode) )
+ {
+ GNUNET_SCHEDULER_shutdown ();
+ return GNUNET_OK;
+ }
if (GNUNET_YES == delay)
task = GNUNET_SCHEDULER_add_delayed (DELAY,
&find_transfers,
@@ -289,6 +300,7 @@ find_transfers (void *cls)
struct TALER_EXCHANGEDB_Session *session;
int ret;
+ task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Checking for incoming wire transfers\n");
@@ -389,6 +401,10 @@ main (int argc,
"PLUGINNAME",
"which wire plugin to use",
&type),
+ GNUNET_GETOPT_option_flag ('T',
+ "test",
+ "run in test mode and exit when idle",
+ &test_mode),
GNUNET_GETOPT_OPTION_END
};
diff --git a/src/exchange/test_taler_exchange_wirewatch.c
b/src/exchange/test_taler_exchange_wirewatch.c
index 2b13cf8..cf3cd49 100644
--- a/src/exchange/test_taler_exchange_wirewatch.c
+++ b/src/exchange/test_taler_exchange_wirewatch.c
@@ -486,6 +486,7 @@ interpreter (void *cls)
"taler-exchange-wirewatch",
"-c", config_filename,
"-t", "test",
+ "-T", /* run in test mode, exit instead of
looping */
NULL);
if (NULL == cmd->details.wirewatch.wirewatch_proc)
{
--
To stop receiving notification emails like this one, please contact
address@hidden