gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated (877f49d -> c2ae934)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (877f49d -> c2ae934)
Date: Tue, 26 Jun 2018 12:51:27 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a change to branch master
in repository merchant.

    from 877f49d  Fix #5364.
     new 963957e  Splitting tests, up to refund
     new 8eb86b4  Splitting tests, up to tip
     new c4c978b  Splitting tests, _actually_ up to tip
     new c2ae934  Finish splitting main "lib" test cases.

The 4 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/lib/test_merchant_api_new.c | 227 ++++++++++++++++++++++++++--------------
 src/lib/testing_api_cmd_tip.c   |   9 +-
 2 files changed, 155 insertions(+), 81 deletions(-)

diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index 7500981..301802a 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -150,12 +150,7 @@ static void
 run (void *cls,
      struct TALER_TESTING_Interpreter *is)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Merchant serves at `%s'\n",
-              merchant_url);
-
-  struct TALER_TESTING_Command commands[] = {
-
+  struct TALER_TESTING_Command pay[] = {
     /**
      * Move money to the exchange's bank account.
      */
@@ -170,19 +165,24 @@ run (void *cls,
     TALER_TESTING_cmd_check_bank_transfer
       ("check_bank_transfer-2",
        EXCHANGE_URL,
-       "EUR:10.02", USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO),
+       "EUR:10.02",
+       USER_ACCOUNT_NO,
+       EXCHANGE_ACCOUNT_NO),
 
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1",
-                                       is->exchange,
-                                       "create-reserve-1",
-                                       "EUR:5",
-                                       MHD_HTTP_OK),
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-1",
+       is->exchange,
+       "create-reserve-1",
+       "EUR:5",
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-2",
+       is->exchange,
+       "create-reserve-1",
+       "EUR:5",
+       MHD_HTTP_OK),
 
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-2",
-                                       is->exchange,
-                                       "create-reserve-1",
-                                       "EUR:5",
-                                       MHD_HTTP_OK),
     /**
      * Check the reserve is depleted.
      */
@@ -220,7 +220,6 @@ run (void *cls,
                                      MHD_HTTP_OK,
                                      "create-proposal-1",
                                      GNUNET_NO),
-
     TALER_TESTING_cmd_pay ("deposit-simple",
                            merchant_url,
                            is->ctx,
@@ -254,6 +253,26 @@ run (void *cls,
                            "EUR:4.99",
                            "EUR:0.01"),
 
+    TALER_TESTING_cmd_check_bank_empty
+      ("check_bank_empty-1"),
+
+    CMD_EXEC_AGGREGATOR ("run-aggregator"),
+
+    TALER_TESTING_cmd_check_bank_transfer
+      ("check_bank_transfer-498c",
+       EXCHANGE_URL,
+       "EUR:4.98",
+       EXCHANGE_ACCOUNT_NO,
+       MERCHANT_ACCOUNT_NO),
+
+    TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-2"),
+
+    TALER_TESTING_cmd_end ()
+  };
+
+
+  struct TALER_TESTING_Command double_spending[] = {
+
     TALER_TESTING_cmd_proposal
       ("create-proposal-2",
        merchant_url,
@@ -276,6 +295,13 @@ run (void *cls,
                          \"value\":\"{EUR:5}\"} ] }",
         NULL),
 
+    TALER_TESTING_cmd_proposal_lookup ("fetch-proposal-2",
+                                       is->ctx,
+                                       merchant_url,
+                                       MHD_HTTP_OK,
+                                       "create-proposal-2",
+                                       NULL),
+
     TALER_TESTING_cmd_pay ("deposit-double-2",
                            merchant_url,
                            is->ctx,
@@ -305,6 +331,37 @@ run (void *cls,
                                10, // start
                                10), // nrows
 
+
+    TALER_TESTING_cmd_end ()
+  };
+
+  struct TALER_TESTING_Command track[] = {
+
+    TALER_TESTING_cmd_merchant_track_transaction
+      ("track-transaction-1",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "check_bank_transfer-498c",
+       "deposit-simple",
+       "EUR:0.01"),
+
+    TALER_TESTING_cmd_merchant_track_transfer
+      ("track-transfer-1",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "check_bank_transfer-498c",
+       "deposit-simple"),
+
+    TALER_TESTING_cmd_merchant_track_transfer
+      ("track-transfer-again",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "check_bank_transfer-498c",
+       "deposit-simple"),
+
     TALER_TESTING_cmd_fakebank_transfer
       ("create-reserve-2",
        "EUR:1",
@@ -327,14 +384,18 @@ run (void *cls,
     CMD_EXEC_WIREWATCH ("wirewatch-2"),
 
     TALER_TESTING_cmd_check_bank_transfer
-      ("check_bank_transfer-2",
+      ("check_bank_transfer-2a",
        EXCHANGE_URL,
-       "EUR:1", USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO),
+       "EUR:1",
+       USER_ACCOUNT_NO,
+       EXCHANGE_ACCOUNT_NO),
 
     TALER_TESTING_cmd_check_bank_transfer
-      ("check_bank_transfer-2",
+      ("check_bank_transfer-2b",
        EXCHANGE_URL,
-       "EUR:4.01", USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO),
+       "EUR:4.01",
+       USER_ACCOUNT_NO,
+       EXCHANGE_ACCOUNT_NO),
 
     TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-2",
                                        is->exchange,
@@ -342,49 +403,6 @@ run (void *cls,
                                        "EUR:5",
                                        MHD_HTTP_OK),
 
-    TALER_TESTING_cmd_proposal_lookup ("fetch-proposal-2",
-                                       is->ctx,
-                                       merchant_url,
-                                       MHD_HTTP_OK,
-                                       "create-proposal-2",
-                                       NULL),
-
-    TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-1"),
-
-    CMD_EXEC_AGGREGATOR ("run-aggregator"),
-    TALER_TESTING_cmd_check_bank_transfer
-      ("check_bank_transfer-498c",
-       EXCHANGE_URL,
-       "EUR:4.98",
-       EXCHANGE_ACCOUNT_NO,
-       MERCHANT_ACCOUNT_NO),
-    TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-2"),
-
-    TALER_TESTING_cmd_merchant_track_transaction
-      ("track-transaction-1",
-       merchant_url,
-       is->ctx,
-       MHD_HTTP_OK,
-       "check_bank_transfer-498c",
-       "deposit-simple",
-       "EUR:0.01"),
-
-    TALER_TESTING_cmd_merchant_track_transfer
-      ("track-transfer-1",
-       merchant_url,
-       is->ctx,
-       MHD_HTTP_OK,
-       "check_bank_transfer-498c",
-       "deposit-simple"),
-
-    TALER_TESTING_cmd_merchant_track_transfer
-      ("track-transfer-again",
-       merchant_url,
-       is->ctx,
-       MHD_HTTP_OK,
-       "check_bank_transfer-498c",
-       "deposit-simple"),
-
     TALER_TESTING_cmd_pay ("deposit-simple-2",
                            merchant_url,
                            is->ctx,
@@ -396,6 +414,7 @@ run (void *cls,
                            "EUR:0.01"),
 
     CMD_EXEC_AGGREGATOR ("run-aggregator-2"),
+
     TALER_TESTING_cmd_check_bank_transfer
       ("check_bank_transfer-498c-2",
        EXCHANGE_URL,
@@ -444,17 +463,11 @@ run (void *cls,
                                10,
                                10),
 
-    TALER_TESTING_cmd_history
-      ("history-2",
-       merchant_url,
-       is->ctx,
-       MHD_HTTP_OK,
-       GNUNET_TIME_absolute_add (GNUNET_TIME_UNIT_ZERO_ABS,
-                                 GNUNET_TIME_UNIT_MICROSECONDS),
-       /* zero results expected, time too ancient. */
-       0,
-       10,
-       10),
+
+    TALER_TESTING_cmd_end ()
+  };
+
+  struct TALER_TESTING_Command refund[] = {
 
     TALER_TESTING_cmd_refund_increase
       ("refund-increase-1",
@@ -612,6 +625,12 @@ run (void *cls,
         * coin "set", but the HTTP response code is 200 OK.  */
        "EUR:0"),
 
+    TALER_TESTING_cmd_end ()
+  };
+
+
+  struct TALER_TESTING_Command tip[] = {
+
     /* Test tipping.  */
     TALER_TESTING_cmd_fakebank_transfer_with_instance
       ("create-reserve-tip-1",
@@ -625,7 +644,6 @@ run (void *cls,
        EXCHANGE_URL,
        CONFIG_FILE),
 
-
     CMD_EXEC_WIREWATCH ("wirewatch-3"),
 
     TALER_TESTING_cmd_check_bank_transfer
@@ -651,7 +669,6 @@ run (void *cls,
                                      "tip 2",
                                      "EUR:5.01"),
 
-
     /* This command tests the authorization of tip
      * against a reserve that does not exist.  This is
      * implemented by passing a "tip instance" that
@@ -837,7 +854,11 @@ run (void *cls,
     TALER_TESTING_cmd_check_bank_empty
     ("check_bank_empty-at-tips"),
 
-    /* pay again logic.  */
+    TALER_TESTING_cmd_end ()
+  };
+
+  struct TALER_TESTING_Command pay_again[] = {
+
     TALER_TESTING_cmd_fakebank_transfer
       ("create-reserve-10",
        "EUR:10.02",
@@ -924,7 +945,10 @@ run (void *cls,
 
     TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-10"),
 
-    /* pay abort */
+    TALER_TESTING_cmd_end ()
+  };
+
+  struct TALER_TESTING_Command pay_abort[] = {
     CMD_TRANSFER_TO_EXCHANGE ("create-reserve-11",
                               "EUR:10.02"),
 
@@ -1015,6 +1039,49 @@ run (void *cls,
 
     TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-11"),
 
+    TALER_TESTING_cmd_end ()
+  };
+
+
+
+  struct TALER_TESTING_Command commands[] = {
+
+    TALER_TESTING_cmd_batch ("pay",
+                             pay),
+
+    TALER_TESTING_cmd_batch ("double-spending",
+                             double_spending),
+
+    TALER_TESTING_cmd_batch ("track",
+                             track),
+
+    /**
+     * Just a weird /history request, not really tied to
+     * any CMDs chunk.
+     */
+    TALER_TESTING_cmd_history
+      ("history-2",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       GNUNET_TIME_absolute_add (GNUNET_TIME_UNIT_ZERO_ABS,
+                                 GNUNET_TIME_UNIT_MICROSECONDS),
+       /* zero results expected, time too ancient. */
+       0,
+       10,
+       10),
+
+    TALER_TESTING_cmd_batch ("refund",
+                             refund),
+
+    TALER_TESTING_cmd_batch ("tip",
+                             tip),
+
+    TALER_TESTING_cmd_batch ("pay-again",
+                             pay_again),
+
+    TALER_TESTING_cmd_batch ("pay-abort",
+                             pay_abort),
     /**
      * End the suite.  Fixme: better to have a label for this
      * too, as it shows a "(null)" token on logs.
diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c
index ec747fa..f90afeb 100644
--- a/src/lib/testing_api_cmd_tip.c
+++ b/src/lib/testing_api_cmd_tip.c
@@ -772,6 +772,11 @@ struct WithdrawHandle
    */
   unsigned int off;
 
+  
+  /**
+   * Internal state of the "pickup" CMD.
+   */
+  struct TipPickupState *tps;
 };
 
 /**
@@ -796,7 +801,8 @@ pickup_withdraw_cb (void *cls,
 {
   struct WithdrawHandle *wh = cls;
   struct TALER_TESTING_Interpreter *is = wh->is;
-  struct TipPickupState *tps = is->commands[is->ip].cls;
+
+  struct TipPickupState *tps = wh->tps;
 
   wh->wsh = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -904,6 +910,7 @@ pickup_cb (void *cls,
 
     wh->off = i;
     wh->is = tps->is;
+    wh->tps = tps;
     GNUNET_assert
       ( (NULL == wh->wsh) &&
         ( (NULL == tps->sigs) ||

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]