diff options
Diffstat (limited to 'src/bank-lib/test_bank_api.c')
-rw-r--r-- | src/bank-lib/test_bank_api.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c index 043234560..6ad47c825 100644 --- a/src/bank-lib/test_bank_api.c +++ b/src/bank-lib/test_bank_api.c | |||
@@ -1,21 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of TALER | 2 | This file is part of TALER |
3 | Copyright (C) 2016, 2017 GNUnet e.V. | 3 | Copyright (C) 2016, 2017, 2019 GNUnet e.V. |
4 | 4 | ||
5 | TALER is free software; you can redistribute it and/or modify | 5 | TALER is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as | 6 | it under the terms of the GNU General Public License as |
7 | published by the Free Software Foundation; either version 3, | 7 | published by the Free Software Foundation; either version 3, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | TALER is distributed in the hope that it will be useful, | 10 | TALER is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty |
12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
13 | the GNU General Public License for more details. | 13 | the GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public | 15 | You should have received a copy of the GNU General Public |
16 | License along with TALER; see the file COPYING. If not, see | 16 | License along with TALER; see the file COPYING. If not, see |
17 | <http://www.gnu.org/licenses/> | 17 | <http://www.gnu.org/licenses/> |
18 | */ | 18 | */ |
19 | /** | 19 | /** |
20 | * @file bank/test_bank_api.c | 20 | * @file bank/test_bank_api.c |
21 | * @brief testcase to test bank's HTTP API interface | 21 | * @brief testcase to test bank's HTTP API interface |
@@ -156,15 +156,20 @@ main (int argc, | |||
156 | 156 | ||
157 | if (NULL == (dbconn = getenv ("TALER_EXCHANGEDB_POSTGRES_CONFIG"))) | 157 | if (NULL == (dbconn = getenv ("TALER_EXCHANGEDB_POSTGRES_CONFIG"))) |
158 | dbconn = defaultdb; | 158 | dbconn = defaultdb; |
159 | char *purgedb_cmd; | ||
160 | GNUNET_asprintf (&purgedb_cmd, | ||
161 | "taler-bank-manage -c bank.conf --with-db=%s django flush --no-input", | ||
162 | dbconn); | ||
163 | if (0 != system (purgedb_cmd)) | ||
164 | { | 159 | { |
165 | fprintf (stderr, | 160 | char *purgedb_cmd; |
166 | "Could not purge database\n"); | 161 | |
167 | return 77; | 162 | GNUNET_asprintf (&purgedb_cmd, |
163 | "taler-bank-manage -c bank.conf --with-db=%s django flush --no-input", | ||
164 | dbconn); | ||
165 | if (0 != system (purgedb_cmd)) | ||
166 | { | ||
167 | fprintf (stderr, | ||
168 | "Could not purge database\n"); | ||
169 | GNUNET_free (purgedb_cmd); | ||
170 | return 77; | ||
171 | } | ||
172 | GNUNET_free (purgedb_cmd); | ||
168 | } | 173 | } |
169 | 174 | ||
170 | bankd = GNUNET_OS_start_process (GNUNET_NO, | 175 | bankd = GNUNET_OS_start_process (GNUNET_NO, |
@@ -182,7 +187,7 @@ main (int argc, | |||
182 | { | 187 | { |
183 | fprintf (stderr, | 188 | fprintf (stderr, |
184 | "Failed to launch taler-bank-manage, skipping test\n"); | 189 | "Failed to launch taler-bank-manage, skipping test\n"); |
185 | return 77; /* report 'skip' */ | 190 | return 77; /* report 'skip' */ |
186 | } | 191 | } |
187 | /* give child time to start and bind against the socket */ | 192 | /* give child time to start and bind against the socket */ |
188 | fprintf (stderr, | 193 | fprintf (stderr, |