summaryrefslogtreecommitdiff
path: root/src/bank-lib/test_bank_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-24 13:41:21 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-24 13:42:02 +0100
commit7ebacc6fbdbcec3123016303cf998c44d485bca7 (patch)
treeb5b5c59a414243e8bc595c49f91a648d8bf82c59 /src/bank-lib/test_bank_api.c
parent6050dad63e269971fac86955393e6b68b8f1908a (diff)
downloadexchange-7ebacc6fbdbcec3123016303cf998c44d485bca7.tar.gz
exchange-7ebacc6fbdbcec3123016303cf998c44d485bca7.tar.bz2
exchange-7ebacc6fbdbcec3123016303cf998c44d485bca7.zip
merge aggregator
Diffstat (limited to 'src/bank-lib/test_bank_api.c')
-rw-r--r--src/bank-lib/test_bank_api.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index 88ca2fd24..28b0b6dca 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2016 GNUnet e.V.
+ Copyright (C) 2016, 2017 GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -71,6 +71,15 @@ main (int argc,
unsigned int cnt;
int result;
+ if (GNUNET_OK !=
+ GNUNET_NETWORK_test_port_free (IPPROTO_TCP,
+ 8081))
+ {
+ fprintf (stderr,
+ "Required port %u not available, skipping.\n",
+ 8081);
+ return 77;
+ }
GNUNET_log_setup ("test-bank-api",
"WARNING",
NULL);
@@ -83,6 +92,12 @@ main (int argc,
"serve-http",
"--port", "8081",
NULL);
+ if (NULL == bankd_admin)
+ {
+ fprintf (stderr,
+ "Failed to launch `taler-bank-manage' for admin, skipping test\n");
+ return 77; /* report 'skip' */
+ }
bankd = GNUNET_OS_start_process (GNUNET_NO,
GNUNET_OS_INHERIT_STD_ALL,
NULL, NULL, NULL,
@@ -92,12 +107,14 @@ main (int argc,
"--port", "8080",
NULL);
-
- if ((NULL == bankd_admin) || (NULL == bankd))
+ if (NULL == bankd)
{
- /*FIXME: More accurate error message?*/
fprintf (stderr,
- "taler-bank-manage not found, skipping test\n");
+ "Failed to launch taler-bank-manage, skipping test\n");
+ GNUNET_OS_process_kill (bankd_admin,
+ SIGTERM);
+ GNUNET_OS_process_wait (bankd_admin);
+ GNUNET_OS_process_destroy (bankd_admin);
return 77; /* report 'skip' */
}
/* give child time to start and bind against the socket */
@@ -134,6 +151,8 @@ main (int argc,
SIGTERM);
GNUNET_OS_process_wait (bankd);
GNUNET_OS_process_destroy (bankd);
+ GNUNET_OS_process_wait (bankd_admin);
+ GNUNET_OS_process_destroy (bankd_admin);
if (cnt > 30)
{
fprintf (stderr,