[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] branch master updated (207c975 -> 9f8b6a6)
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] branch master updated (207c975 -> 9f8b6a6) |
Date: |
Wed, 25 Jul 2018 13:08:25 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a change to branch master
in repository exchange.
from 207c975 Benchmark.
new 7aee3dd Benchmark uses fakebank now.
new d7789d0 Fix segfault.
new 7a1d4e4 no ApiKey for benchmark
new 2393e26 Use proper exchange preparator (benchmark)
new 9f8b6a6 Prefer strncpy()
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/benchmark/taler-exchange-benchmark-new.c | 64 +++++++++-------------------
1 file changed, 21 insertions(+), 43 deletions(-)
diff --git a/src/benchmark/taler-exchange-benchmark-new.c
b/src/benchmark/taler-exchange-benchmark-new.c
index 9cdd26d..abe57b1 100644
--- a/src/benchmark/taler-exchange-benchmark-new.c
+++ b/src/benchmark/taler-exchange-benchmark-new.c
@@ -74,11 +74,16 @@ enum BenchmarkError {
#define CMD_TRANSFER_TO_EXCHANGE(label,amount) \
TALER_TESTING_cmd_fakebank_transfer (label, amount, \
- bank_url, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \
+ fakebank_url, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \
USER_LOGIN_NAME, USER_LOGIN_PASS, EXCHANGE_URL)
/**
+ * Exchange URL; never used, just needed by exchange preparator.
+ */
+static char *exchange_url;
+
+/**
* Time snapshot taken right before executing the CMDs.
*/
static struct GNUNET_TIME_Absolute start_time;
@@ -95,11 +100,6 @@ static struct GNUNET_TIME_Relative duration;
static unsigned int result;
/**
- * Bank process.
- */
-static struct GNUNET_OS_Process *bankd;
-
-/**
* How many refreshes got executed.
*/
static unsigned int howmany_refreshes;
@@ -125,9 +125,9 @@ static char *logfile;
static char *cfg_filename;
/**
- * Bank base URL.
+ * Fake bank base URL.
*/
-static char *bank_url;
+static char *fakebank_url;
/**
* Currency used.
@@ -182,7 +182,6 @@ static void
run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
- #define APIKEY_SANDBOX "Authorization: ApiKey sandbox"
struct TALER_Amount total_reserve_amount;
struct TALER_Amount withdraw_fee;
char *withdraw_fee_str;
@@ -192,19 +191,16 @@ run (void *cls,
howmany_coins + /* All units */
1 /* End CMD */];
- /* Will be freed by testing-lib. */
- GNUNET_assert
- (GNUNET_OK == GNUNET_CURL_append_header
- (is->ctx, APIKEY_SANDBOX));
-
ALLOCATE_AMOUNTS
(AMOUNT_5,
AMOUNT_4,
AMOUNT_1);
- strcpy (total_reserve_amount.currency,
- currency);
total_reserve_amount.value = 5 * howmany_coins;
+ strncpy (total_reserve_amount.currency,
+ currency,
+ TALER_CURRENCY_LEN);
+
GNUNET_asprintf (&withdraw_fee_str,
"%s:0.1",
currency);
@@ -306,27 +302,14 @@ run (void *cls,
unit);
}
all_commands[1 + howmany_coins] = TALER_TESTING_cmd_end ();
-
start_time = GNUNET_TIME_absolute_get ();
- TALER_TESTING_run (is,
- all_commands);
+ TALER_TESTING_run_with_fakebank (is,
+ all_commands,
+ fakebank_url);
result = 1;
}
/**
- * Send SIGTERM and wait for process termination.
- *
- * @param process process to terminate.
- */
-void
-terminate_process (struct GNUNET_OS_Process *process)
-{
- GNUNET_OS_process_kill (process, SIGTERM);
- GNUNET_OS_process_wait (process);
- GNUNET_OS_process_destroy (process);
-}
-
-/**
* The main function of the serve tool
*
* @param argc number of arguments from the command line
@@ -369,8 +352,9 @@ main (int argc,
('b',
"bank-url",
"BU",
- "bank base url, mandatory",
- &bank_url),
+ "bank base url, mandatory,"
+ " must match exchange's escrow bank",
+ &fakebank_url),
GNUNET_GETOPT_option_string
('l',
@@ -420,27 +404,21 @@ main (int argc,
}
GNUNET_CONFIGURATION_destroy (cfg);
- if (NULL == bank_url)
+ if (NULL == fakebank_url)
{
TALER_LOG_ERROR ("Option -b is mandatory!\n");
return MISSING_BANK_URL;
}
- if (NULL == (bankd = TALER_TESTING_run_bank
+ GNUNET_assert (GNUNET_OK == TALER_TESTING_prepare_exchange
(cfg_filename,
- bank_url)))
- {
- TALER_LOG_ERROR ("Failed to run the bank\n");
- return FAILED_TO_LAUNCH_BANK;
- }
-
+ &exchange_url)); // never used, we do all via handle.
result = TALER_TESTING_setup_with_exchange
(run,
NULL,
cfg_filename);
duration = GNUNET_TIME_absolute_get_duration (start_time);
- terminate_process (bankd);
TALER_LOG_INFO ("Executed W=%u, D=%u, R=%u, operations in %s\n",
howmany_coins,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-exchange] branch master updated (207c975 -> 9f8b6a6),
gnunet <=
- [GNUnet-SVN] [taler-exchange] 02/05: Fix segfault., gnunet, 2018/07/25
- [GNUnet-SVN] [taler-exchange] 01/05: Benchmark uses fakebank now., gnunet, 2018/07/25
- [GNUnet-SVN] [taler-exchange] 04/05: Use proper exchange preparator (benchmark), gnunet, 2018/07/25
- [GNUnet-SVN] [taler-exchange] 05/05: Prefer strncpy(), gnunet, 2018/07/25
- [GNUnet-SVN] [taler-exchange] 03/05: no ApiKey for benchmark, gnunet, 2018/07/25