aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-07 23:11:20 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-07 23:11:20 +0200
commit9725b7d42505d7820fea6e28a638c06b7e81f893 (patch)
treee1a3233e8f2dbe4f61a6c1d1cff4d83f98563594 /src/include
parent0e2148d63b85025c37d4212162a522e47445acab (diff)
major libtalertesting API refactoring, including no longer having taler-specific logic in the test engine core
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_merchant_testing_lib.h88
1 files changed, 39 insertions, 49 deletions
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h
index 0233fdc7..4d00834d 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -36,33 +36,17 @@
#define MERCHANT_FAIL() \
do {GNUNET_break (0); return NULL; } while (0)
+
/**
- * Prepare the merchant execution. Create tables and check if
- * the port is available.
+ * Extract hostname (and port) from merchant base URL.
*
- * @param config_filename configuration filename.
- * @return the base url, or NULL upon errors. Must be freed
- * by the caller.
+ * @param merchant_url full merchant URL (e.g. "http://host:8080/foo/bar/")
+ * @return just the hostname and port ("hostname:8080")
*/
char *
-TALER_TESTING_prepare_merchant (const char *config_filename);
+TALER_MERCHANT_TESTING_extract_host (const char *merchant_url);
-/**
- * Start the merchant backend process. Assume the port
- * is available and the database is clean. Use the "prepare
- * merchant" function to do such tasks.
- *
- * @param config_filename configuration filename.
- * @param merchant_url merchant base URL, used to check
- * if the merchant was started right.
- * @return the process, or NULL if the process could not
- * be started.
- */
-struct GNUNET_OS_Process *
-TALER_TESTING_run_merchant (const char *config_filename,
- const char *merchant_url);
-
/* ************** Specific interpreter commands ************ */
@@ -532,6 +516,7 @@ TALER_TESTING_cmd_merchant_delete_product (const char *label,
* Make the "proposal" command.
*
* @param label command label
+ * @param cfg configuration to use
* @param merchant_url base URL of the merchant serving
* the proposal request.
* @param http_status expected HTTP status.
@@ -544,6 +529,7 @@ TALER_TESTING_cmd_merchant_delete_product (const char *label,
struct TALER_TESTING_Command
TALER_TESTING_cmd_merchant_post_orders (
const char *label,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *merchant_url,
unsigned int http_status,
const char *order_id,
@@ -551,6 +537,7 @@ TALER_TESTING_cmd_merchant_post_orders (
struct GNUNET_TIME_Timestamp pay_deadline,
const char *amount);
+
/**
* Make the "proposal" command AVOIDING claiming the order.
*
@@ -574,10 +561,12 @@ TALER_TESTING_cmd_merchant_post_orders_no_claim (
struct GNUNET_TIME_Timestamp pay_deadline,
const char *amount);
+
/**
* Make the "proposal" command.
*
* @param label command label
+ * @param cfg configuration to use
* @param merchant_url base URL of the merchant serving
* the proposal request.
* @param http_status expected HTTP status.
@@ -599,6 +588,7 @@ TALER_TESTING_cmd_merchant_post_orders_no_claim (
struct TALER_TESTING_Command
TALER_TESTING_cmd_merchant_post_orders2 (
const char *label,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *merchant_url,
unsigned int http_status,
const char *order_id,
@@ -1901,17 +1891,17 @@ TALER_TESTING_cmd_checkserver2 (const char *label,
op (claim_nonce, const struct GNUNET_CRYPTO_EddsaPublicKey) \
op (tip_id, const struct TALER_TipIdentifierP) \
op (pickup_id, const struct TALER_PickupIdentifierP) \
- op (instance_name, const char *) \
- op (instance_id, const char *) \
+ op (instance_name, const char) \
+ op (instance_id, const char) \
op (address, const json_t) \
- op (product_description, const char *) \
- op (product_image, const char *) \
+ op (product_description, const char) \
+ op (product_image, const char) \
op (product_stock, const int64_t) \
- op (product_unit, const char *) \
- op (product_id, const char *) \
- op (reason, const char *) \
- op (lock_uuid, const char *) \
- op (auth_token, const char *) \
+ op (product_unit, const char) \
+ op (product_id, const char) \
+ op (reason, const char) \
+ op (lock_uuid, const char) \
+ op (auth_token, const char) \
op (paths_length, const uint32_t) \
op (payto_length, const uint32_t) \
op (num_planchets, const uint32_t) \
@@ -1928,20 +1918,20 @@ TALER_TESTING_cmd_checkserver2 (const char *label,
op (order_terms, const json_t) \
op (h_contract_terms, const struct TALER_PrivateContractHashP) \
op (h_wire, const struct TALER_MerchantWireHashP) \
- op (proposal_reference, const char *) \
- op (template_description, const char *) \
- op (template_pos_key, const char *) \
+ op (proposal_reference, const char) \
+ op (template_description, const char) \
+ op (template_pos_key, const char) \
op (template_pos_alg, const enum TALER_MerchantConfirmationAlgorithm) \
- op (template_id, const char *) \
+ op (template_id, const char) \
op (template_contract, const json_t) \
- op (event_type, const char *) \
- op (webhook_id, const char *) \
- op (merchant_base_url, const char *) \
- op (url, const char *) \
- op (http_method, const char *) \
- op (header_template, const char *) \
- op (body_template, const char *) \
- op (summary, const char *)
+ op (event_type, const char) \
+ op (webhook_id, const char) \
+ op (merchant_base_url, const char) \
+ op (url, const char) \
+ op (http_method, const char) \
+ op (header_template, const char) \
+ op (body_template, const char) \
+ op (summary, const char)
/**
@@ -1950,15 +1940,15 @@ TALER_TESTING_cmd_checkserver2 (const char *label,
* @param op macro to call
*/
#define TALER_MERCHANT_TESTING_INDEXED_TRAITS(op) \
- op (coin_reference, const char *) \
- op (paths, const char *) \
- op (payto_uris, const char *) \
+ op (coin_reference, const char) \
+ op (paths, const char) \
+ op (payto_uris, const char) \
op (h_wires, const struct TALER_MerchantWireHashP) \
op (amounts, const struct TALER_Amount) \
- op (urls, const char *) \
- op (http_methods, const char *) \
- op (http_header, const char *) \
- op (http_body, const void *) \
+ op (urls, const char) \
+ op (http_methods, const char) \
+ op (http_header, const char) \
+ op (http_body, const void) \
op (http_body_size, const size_t) \
op (planchet_secrets, const struct TALER_PlanchetMasterSecretP)