[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: get test to build
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: get test to build |
Date: |
Sat, 13 Feb 2021 14:01:56 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 73bcaa2 get test to build
73bcaa2 is described below
commit 73bcaa27e4cb901d7887be9ec73e930283138ca5
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Feb 13 14:01:53 2021 +0100
get test to build
---
src/include/anastasis_testing_lib.h | 3 +-
src/testing/test_anastasis_api.c | 76 +++++++--------------
src/testing/testing_api_cmd_keyshare_lookup.c | 79 ++++++++++------------
src/testing/testing_api_trait_payment_identifier.c | 58 ----------------
4 files changed, 62 insertions(+), 154 deletions(-)
diff --git a/src/include/anastasis_testing_lib.h
b/src/include/anastasis_testing_lib.h
index fac4a0f..49deddf 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -452,10 +452,10 @@ ANASTASIS_TESTING_cmd_truth_store (const char *label,
* @param label command label
* @param anastasis_url base URL of the ANASTASIS serving
* the keyshare lookup request.
- * @param http_status expected HTTP status.
* @param answer (response to challenge)
* @param payment_ref reference to the payment request
* @param upload_ref reference to upload command
+ * @param ksdd expected status
* @return the command
*/
struct TALER_TESTING_Command
@@ -463,7 +463,6 @@ ANASTASIS_TESTING_cmd_keyshare_lookup (
const char *label,
const char *anastasis_url,
const char *answer,
- const struct ANASTASIS_CRYPTO_TruthKeyP *key,
const char *payment_ref,
const char *upload_ref,
int lookup_mode,
diff --git a/src/testing/test_anastasis_api.c b/src/testing/test_anastasis_api.c
index 32dccfa..9fff2ba 100644
--- a/src/testing/test_anastasis_api.c
+++ b/src/testing/test_anastasis_api.c
@@ -97,11 +97,6 @@ static struct GNUNET_OS_Process *merchantd;
*/
static struct GNUNET_OS_Process *anastasisd;
-/**
- * Code for answering challenge
- */
-static char *answer_str;
-
/**
* Execute the taler-exchange-wirewatch command with our configuration
@@ -206,42 +201,38 @@ run (void *cls,
"truth-store-1",
anastasis_url,
NULL,
- MHD_HTTP_NO_CONTENT,
+ "question",
+ "Truth mime",
+ strlen ("The-Answer"),
+ "The-Answer",
ANASTASIS_TESTING_TSO_NONE,
- ANASTASIS_TESTING_make_truth_example (
- "question",
- "Truth mime",
- ANASTASIS_TESTING_make_hashed_answer ("Hashed-Answer",
- strlen ("Hashed-Answer")),
- ANASTASIS_TESTING_make_truthkey ("Truth-Key"))),
+ MHD_HTTP_OK),
ANASTASIS_TESTING_cmd_keyshare_lookup (
"keyshare-lookup-1",
anastasis_url,
- MHD_HTTP_OK,
- answer_str,
- ANASTASIS_TESTING_make_truthkey ("Truth-Key"),
- NULL,
+ "The-Answer",
+ NULL, /* payment ref */
"truth-store-1",
- 0),
+ 0,
+ ANASTASIS_KSD_SUCCESS),
ANASTASIS_TESTING_cmd_truth_store (
"truth-store-2",
anastasis_url,
NULL,
- MHD_HTTP_NO_CONTENT,
+ "question",
+ "Truth mime",
+ strlen ("Answer-2"),
+ "Answer-2",
ANASTASIS_TESTING_TSO_NONE,
- ANASTASIS_TESTING_make_truth_example (
- "file",
- "Truth mime",
- ANASTASIS_TESTING_make_hashed_answer ("Hashed-Answer-2",
- strlen ("Hashed-Answer-2")),
- ANASTASIS_TESTING_make_truthkey ("Truth-Key-2"))),
- ANASTASIS_TESTING_cmd_challenge_run (
+ MHD_HTTP_OK),
+ ANASTASIS_TESTING_cmd_keyshare_lookup (
"challenge-run-1",
anastasis_url,
- MHD_HTTP_PAYMENT_REQUIRED,
- ANASTASIS_TESTING_make_truthkey ("Truth-Key-2"),
- "truth-store-2",
- NULL),
+ "The-Answer",
+ NULL,
+ "truth-store-1",
+ 0,
+ ANASTASIS_KSD_PAYMENT_REQUIRED),
/* what would we have to pay? */
TALER_TESTING_cmd_merchant_claim_order ("fetch-proposal-2",
merchant_url,
@@ -257,22 +248,15 @@ run (void *cls,
"EUR:1.01",
"EUR:1",
NULL),
- ANASTASIS_TESTING_cmd_challenge_run (
- "challenge-run-2",
- anastasis_url,
- MHD_HTTP_OK,
- ANASTASIS_TESTING_make_truthkey ("Truth-Key-2"),
- "truth-store-2",
- "challenge-run-1"),
+
ANASTASIS_TESTING_cmd_keyshare_lookup (
- "keyshare-lookup-2",
- anastasis_url,
- MHD_HTTP_OK,
"challenge-run-2",
- ANASTASIS_TESTING_make_truthkey ("Truth-Key-2"),
+ anastasis_url,
+ "The-Answer",
"challenge-run-1",
- "truth-store-2",
- 1),
+ "truth-store-1",
+ 0,
+ ANASTASIS_KSD_SUCCESS),
TALER_TESTING_cmd_end ()
};
@@ -321,7 +305,6 @@ int
main (int argc,
char *const *argv)
{
- struct GNUNET_HashCode hash;
int ret;
/* These environment variables get in the way... */
@@ -377,16 +360,9 @@ main (int argc,
GNUNET_OS_process_destroy (merchantd);
return 1;
}
- hash = ANASTASIS_TESTING_make_hashed_answer ("Hashed-Answer",
- strlen ("Hashed-Answer"));
- answer_str = GNUNET_STRINGS_data_to_string_alloc (
- &hash,
- sizeof(struct GNUNET_HashCode));
-
ret = TALER_TESTING_setup_with_exchange (&run,
NULL,
CONFIG_FILE);
- GNUNET_free (answer_str);
GNUNET_OS_process_kill (merchantd,
SIGTERM);
GNUNET_OS_process_kill (anastasisd,
diff --git a/src/testing/testing_api_cmd_keyshare_lookup.c
b/src/testing/testing_api_cmd_keyshare_lookup.c
index d86e867..83179d6 100644
--- a/src/testing/testing_api_cmd_keyshare_lookup.c
+++ b/src/testing/testing_api_cmd_keyshare_lookup.c
@@ -57,16 +57,6 @@ struct KeyShareLookupState
*/
const char *answer;
- /**
- * Key to decrypt truth
- */
- struct ANASTASIS_CRYPTO_TruthKeyP truth_key;
-
- /**
- * Identification of the Truth Object
- */
- const struct ANASTASIS_CRYPTO_TruthUUIDP *truth_uuid;
-
/**
* Reference to upload command we expect to lookup.
*/
@@ -77,11 +67,6 @@ struct KeyShareLookupState
*/
const char *payment_reference;
- /**
- * Payment secret used for the payment
- */
- struct ANASTASIS_PaymentSecretP payment_secret;
-
/**
* Mode for the lookup(0 = question, 1 = code based)
*/
@@ -117,15 +102,18 @@ keyshare_lookup_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct KeyShareLookupState *ksls = cls;
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key;
+ const struct ANASTASIS_CRYPTO_TruthUUIDP *truth_uuid;
+ const struct ANASTASIS_PaymentSecretP *payment_secret;
ksls->is = is;
if (NULL != ksls->upload_reference)
{
const struct TALER_TESTING_Command *upload_cmd;
- upload_cmd = TALER_TESTING_interpreter_lookup_command
- (is,
- ksls->upload_reference);
+ upload_cmd = TALER_TESTING_interpreter_lookup_command (
+ is,
+ ksls->upload_reference);
if (NULL == upload_cmd)
{
GNUNET_break (0);
@@ -136,13 +124,28 @@ keyshare_lookup_run (void *cls,
if (GNUNET_OK !=
ANASTASIS_TESTING_get_trait_truth_uuid (upload_cmd,
0,
- &ksls->truth_uuid))
+ &truth_uuid))
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (ksls->is);
+ return;
+ }
+ if (NULL == truth_uuid)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (ksls->is);
+ return;
+ }
+ if (GNUNET_OK !=
+ ANASTASIS_TESTING_get_trait_truth_key (upload_cmd,
+ 0,
+ &truth_key))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ksls->is);
return;
}
- if (NULL == ksls->truth_uuid)
+ if (NULL == truth_key)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ksls->is);
@@ -155,9 +158,8 @@ keyshare_lookup_run (void *cls,
{
const struct TALER_TESTING_Command *download_cmd;
- download_cmd = TALER_TESTING_interpreter_lookup_command
- (is,
- ksls->answer);
+ download_cmd = TALER_TESTING_interpreter_lookup_command (is,
+ ksls->answer);
if (NULL == download_cmd)
{
GNUNET_break (0);
@@ -188,33 +190,24 @@ keyshare_lookup_run (void *cls,
if (NULL != ksls->payment_reference)
{
- const char *order_id;
const struct TALER_TESTING_Command *payment_cmd;
payment_cmd = TALER_TESTING_interpreter_lookup_command
(is,
ksls->payment_reference);
if (GNUNET_OK !=
- TALER_TESTING_get_trait_order_id (payment_cmd,
- 0,
- &order_id))
+ ANASTASIS_TESTING_get_trait_payment_secret (payment_cmd,
+ 0,
+ &payment_secret))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ksls->is);
return;
}
-
- if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (order_id,
- strlen (order_id),
- &ksls->payment_secret,
- sizeof (struct
- ANASTASIS_PaymentSecretP)))
- {
- GNUNET_break_op (0);
- TALER_TESTING_interpreter_fail (ksls->is);
- return;
- }
+ }
+ else
+ {
+ payment_secret = NULL;
}
{
@@ -226,9 +219,9 @@ keyshare_lookup_run (void *cls,
ksls->kslo = ANASTASIS_keyshare_lookup (is->ctx,
ksls->anastasis_url,
- ksls->truth_uuid,
- &ksls->truth_key,
- &ksls->payment_secret,
+ truth_uuid,
+ truth_key,
+ payment_secret,
&h_answer,
&keyshare_lookup_cb,
ksls);
@@ -265,7 +258,6 @@ ANASTASIS_TESTING_cmd_keyshare_lookup (
const char *label,
const char *anastasis_url,
const char *answer,
- const struct ANASTASIS_CRYPTO_TruthKeyP *key,
const char *payment_ref,
const char *upload_ref,
int lookup_mode,
@@ -280,7 +272,6 @@ ANASTASIS_TESTING_cmd_keyshare_lookup (
ksls->upload_reference = upload_ref;
ksls->payment_reference = payment_ref;
ksls->answer = answer;
- ksls->truth_key = *key;
ksls->lookup_mode = lookup_mode;
{
struct TALER_TESTING_Command cmd = {
diff --git a/src/testing/testing_api_trait_payment_identifier.c
b/src/testing/testing_api_trait_payment_identifier.c
deleted file mode 100644
index 6824f87..0000000
--- a/src/testing/testing_api_trait_payment_identifier.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2019 Taler Systems SA
-
- 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 Foundation; either version 3, or (at your
- option) any later version.
-
- TALER is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with TALER; see the file COPYING. If not, see
- <http://www.gnu.org/licenses/>
-*/
-/**
- * @file lib/testing_api_trait_payment_secret.c
- * @brief traits to offer a payment identifier
- * @author Dennis Neufeld
- */
-#include "platform.h"
-#include "anastasis_testing_lib.h"
-
-#define ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET \
- "anastasis-payment_secret"
-
-
-int
-ANASTASIS_TESTING_get_trait_payment_secret
- (const struct TALER_TESTING_Command *cmd,
- unsigned int index,
- const struct ANASTASIS_PaymentSecretP **payment_secret)
-{
- return cmd->traits (cmd->cls,
- (const void **) payment_secret,
- ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET,
- index);
-}
-
-
-struct TALER_TESTING_Trait
-ANASTASIS_TESTING_make_trait_payment_secret
- (unsigned int index,
- const struct ANASTASIS_PaymentSecretP *h)
-{
- struct TALER_TESTING_Trait ret = {
- .index = index,
- .trait_name = ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET,
- .ptr = (const void *) h
- };
- return ret;
-}
-
-
-/* end of testing_api_trait_payment_secret.c */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: get test to build,
gnunet <=