LCOV - code coverage report
Current view: top level - testing - test_auditor_api.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 127 127 100.0 %
Date: 2025-06-05 21:03:14 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /*
       2             :   This file is part of TALER
       3             :   Copyright (C) 2014-2020 Taler Systems SA
       4             : 
       5             :   TALER is free software; you can redistribute it and/or modify
       6             :   it under the terms of the GNU General Public License as
       7             :   published by the Free Software Foundation; either version 3, or
       8             :   (at your option) any later version.
       9             : 
      10             :   TALER is distributed in the hope that it will be useful, but
      11             :   WITHOUT ANY WARRANTY; without even the implied warranty of
      12             :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13             :   GNU General Public License for more details.
      14             : 
      15             :   You should have received a copy of the GNU General Public
      16             :   License along with TALER; see the file COPYING.  If not, see
      17             :   <http://www.gnu.org/licenses/>
      18             : */
      19             : /**
      20             :  * @file testing/test_auditor_api.c
      21             :  * @brief testcase to test auditor's HTTP API interface
      22             :  * @author Christian Grothoff
      23             :  * @author Marcello Stanisci
      24             :  */
      25             : #include "platform.h"
      26             : #include "taler_util.h"
      27             : #include "taler_signatures.h"
      28             : #include "taler_exchange_service.h"
      29             : #include "taler_auditor_service.h"
      30             : #include "taler_json_lib.h"
      31             : #include <gnunet/gnunet_util_lib.h>
      32             : #include <gnunet/gnunet_testing_lib.h>
      33             : #include <microhttpd.h>
      34             : #include "taler_bank_service.h"
      35             : #include "taler_fakebank_lib.h"
      36             : #include "taler_testing_lib.h"
      37             : 
      38             : 
      39             : /**
      40             :  * Configuration file we use.  One (big) configuration is used
      41             :  * for the various components for this test.
      42             :  */
      43             : static char *config_file;
      44             : 
      45             : static char *config_file_expire_reserve_now;
      46             : 
      47             : /**
      48             :  * Our credentials.
      49             :  */
      50             : static struct TALER_TESTING_Credentials cred;
      51             : 
      52             : /**
      53             :  * Execute the taler-exchange-wirewatch command with
      54             :  * our configuration file.
      55             :  *
      56             :  * @param label label to use for the command.
      57             :  */
      58             : #define CMD_EXEC_WIREWATCH(label) \
      59             :         TALER_TESTING_cmd_exec_wirewatch2 (label, config_file, \
      60             :                                            "exchange-account-2")
      61             : 
      62             : /**
      63             :  * Execute the taler-exchange-aggregator, closer and transfer commands with
      64             :  * our configuration file.
      65             :  *
      66             :  * @param label label to use for the command.
      67             :  */
      68             : #define CMD_EXEC_AGGREGATOR(label) \
      69             :         TALER_TESTING_cmd_sleep (label "-sleep", 1), \
      70             :         TALER_TESTING_cmd_exec_aggregator (label, config_file), \
      71             :         TALER_TESTING_cmd_exec_transfer (label, config_file)
      72             : 
      73             : /**
      74             :  * Run wire transfer of funds from some user's account to the
      75             :  * exchange.
      76             :  *
      77             :  * @param label label to use for the command.
      78             :  * @param amount amount to transfer, i.e. "EUR:1"
      79             :  */
      80             : #define CMD_TRANSFER_TO_EXCHANGE(label,amount) \
      81             :         TALER_TESTING_cmd_admin_add_incoming (label, amount,           \
      82             :                                               &cred.ba,       \
      83             :                                               cred.user42_payto)
      84             : 
      85             : /**
      86             :  * Run the taler-auditor.
      87             :  *
      88             :  * @param label label to use for the command.
      89             :  */
      90             : #define CMD_RUN_AUDITOR(label) \
      91             :         TALER_TESTING_cmd_exec_auditor (label, config_file)
      92             : 
      93             : 
      94             : /**
      95             :  * Main function that will tell the interpreter what commands to
      96             :  * run.
      97             :  *
      98             :  * @param cls closure
      99             :  */
     100             : static void
     101           2 : run (void *cls,
     102             :      struct TALER_TESTING_Interpreter *is)
     103             : {
     104             :   /**
     105             :    * Test withdraw.
     106             :    */
     107             :   struct TALER_TESTING_Command withdraw[] = {
     108             :     /**
     109             :      * Move money to the exchange's bank account.
     110             :      */
     111           2 :     CMD_TRANSFER_TO_EXCHANGE ("create-reserve-1",
     112             :                               "EUR:5.01"),
     113           2 :     TALER_TESTING_cmd_check_bank_admin_transfer
     114             :       ("check-create-reserve-1",
     115             :       "EUR:5.01", cred.user42_payto, cred.exchange_payto,
     116             :       "create-reserve-1"),
     117             :     /**
     118             :      * Make a reserve exist, according to the previous transfer.
     119             :      */
     120           2 :     CMD_EXEC_WIREWATCH ("wirewatch-1"),
     121             :     /**
     122             :      * Withdraw EUR:5.
     123             :      */
     124           2 :     TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1",
     125             :                                        "create-reserve-1",
     126             :                                        "EUR:5",
     127             :                                        0, /* age restriction off */
     128             :                                        MHD_HTTP_OK),
     129           2 :     TALER_TESTING_cmd_end ()
     130             :   };
     131             : 
     132             :   struct TALER_TESTING_Command spend[] = {
     133             :     /**
     134             :      * Spend the coin.
     135             :      */
     136           2 :     TALER_TESTING_cmd_deposit ("deposit-simple",
     137             :                                "withdraw-coin-1",
     138             :                                0,
     139             :                                cred.user42_payto,
     140             :                                "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     141           2 :                                GNUNET_TIME_UNIT_ZERO,
     142             :                                "EUR:5",
     143             :                                MHD_HTTP_OK),
     144           2 :     TALER_TESTING_cmd_end ()
     145             :   };
     146             : 
     147             :   struct TALER_TESTING_Command refresh[] = {
     148             :     /* Fill reserve with EUR:5, 1ct is for fees.  NOTE: the old
     149             :      * test-suite gave a account number of _424_ to the user at
     150             :      * this step; to type less, here the _42_ number is reused.
     151             :      * Does this change the tests semantics? *///
     152           2 :     CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve-1",
     153             :                               "EUR:5.01"),
     154           2 :     TALER_TESTING_cmd_check_bank_admin_transfer
     155             :       ("check-refresh-create-reserve-1",
     156             :       "EUR:5.01", cred.user42_payto, cred.exchange_payto,
     157             :       "refresh-create-reserve-1"),
     158             :     /**
     159             :      * Make previous command effective.
     160             :      */
     161           2 :     CMD_EXEC_WIREWATCH ("wirewatch-2"),
     162             :     /**
     163             :      * Withdraw EUR:5.
     164             :      */
     165           2 :     TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin-1",
     166             :                                        "refresh-create-reserve-1",
     167             :                                        "EUR:5",
     168             :                                        0, /* age restriction off */
     169             :                                        MHD_HTTP_OK),
     170             :     /**
     171             :      * Try to partially spend (deposit) 1 EUR of the 5 EUR coin (in
     172             :      * full) Merchant receives EUR:0.99 due to 1 ct deposit fee.
     173             :      */
     174           2 :     TALER_TESTING_cmd_deposit ("refresh-deposit-partial",
     175             :                                "refresh-withdraw-coin-1",
     176             :                                0,
     177             :                                cred.user42_payto,
     178             :                                "{\"items\":[{\"name\":\"ice\",\"value\":\"EUR:1\"}]}",
     179           2 :                                GNUNET_TIME_UNIT_ZERO,
     180             :                                "EUR:1",
     181             :                                MHD_HTTP_OK),
     182             :     /**
     183             :      * Melt the rest of the coin's value (EUR:4.00 = 3x EUR:1.03 + 7x
     184             :      * EUR:0.13)
     185             :      */
     186           2 :     TALER_TESTING_cmd_melt_double ("refresh-melt-1",
     187             :                                    "refresh-withdraw-coin-1",
     188             :                                    MHD_HTTP_OK,
     189             :                                    NULL),
     190             :     /**
     191             :      * Complete (successful) melt operation, and withdraw the coins
     192             :      */
     193           2 :     TALER_TESTING_cmd_melt_reveal ("refresh-reveal-1",
     194             :                                    "refresh-melt-1",
     195             :                                    MHD_HTTP_OK),
     196             :     /**
     197             :      * Try to spend a refreshed EUR:0.1 coin
     198             :      */
     199           2 :     TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-1b",
     200             :                                "refresh-reveal-1",
     201             :                                3,
     202             :                                cred.user43_payto,
     203             :                                "{\"items\":[{\"name\":\"ice cream\",\"value\":3}]}",
     204           2 :                                GNUNET_TIME_UNIT_ZERO,
     205             :                                "EUR:0.1",
     206             :                                MHD_HTTP_OK),
     207           2 :     TALER_TESTING_cmd_end ()
     208             :   };
     209             : 
     210             :   struct TALER_TESTING_Command track[] = {
     211             :     /**
     212             :      * Run transfers. Note that _actual_ aggregation will NOT
     213             :      * happen here, as each deposit operation is run with a
     214             :      * fresh merchant public key! NOTE: this comment comes
     215             :      * "verbatim" from the old test-suite, and IMO does not explain
     216             :      * a lot! */
     217           2 :     CMD_EXEC_AGGREGATOR ("run-aggregator"),
     218             : 
     219             :     /**
     220             :      * Check all the transfers took place.
     221             :      */
     222           2 :     TALER_TESTING_cmd_check_bank_transfer (
     223             :       "check_bank_transfer-499c",
     224           2 :       cred.exchange_url,
     225             :       "EUR:4.98",
     226             :       cred.exchange_payto,
     227             :       cred.user42_payto),
     228           2 :     TALER_TESTING_cmd_check_bank_transfer (
     229             :       "check_bank_transfer-99c1",
     230           2 :       cred.exchange_url,
     231             :       "EUR:0.98",
     232             :       cred.exchange_payto,
     233             :       cred.user42_payto),
     234           2 :     TALER_TESTING_cmd_check_bank_transfer (
     235             :       "check_bank_transfer-99c",
     236           2 :       cred.exchange_url,
     237             :       "EUR:0.08",
     238             :       cred.exchange_payto,
     239             :       cred.user43_payto),
     240             : 
     241             :     /* The following transactions got originated within
     242             :      * the "massive deposit confirms" batch.  */
     243           2 :     TALER_TESTING_cmd_check_bank_transfer (
     244             :       "check-massive-transfer-1",
     245           2 :       cred.exchange_url,
     246             :       "EUR:0.98",
     247             :       cred.exchange_payto, cred.user43_payto),
     248           2 :     TALER_TESTING_cmd_check_bank_transfer
     249             :       ("check-massive-transfer-2",
     250           2 :       cred.exchange_url,
     251             :       "EUR:0.98",
     252             :       cred.exchange_payto, cred.user43_payto),
     253           2 :     TALER_TESTING_cmd_check_bank_transfer
     254             :       ("check-massive-transfer-3",
     255           2 :       cred.exchange_url,
     256             :       "EUR:0.98",
     257             :       cred.exchange_payto, cred.user43_payto),
     258           2 :     TALER_TESTING_cmd_check_bank_transfer
     259             :       ("check-massive-transfer-4",
     260           2 :       cred.exchange_url,
     261             :       "EUR:0.98",
     262             :       cred.exchange_payto, cred.user43_payto),
     263           2 :     TALER_TESTING_cmd_check_bank_transfer
     264             :       ("check-massive-transfer-5",
     265           2 :       cred.exchange_url,
     266             :       "EUR:0.98",
     267             :       cred.exchange_payto, cred.user43_payto),
     268           2 :     TALER_TESTING_cmd_check_bank_transfer
     269             :       ("check-massive-transfer-6",
     270           2 :       cred.exchange_url,
     271             :       "EUR:0.98",
     272             :       cred.exchange_payto, cred.user43_payto),
     273           2 :     TALER_TESTING_cmd_check_bank_transfer
     274             :       ("check-massive-transfer-7",
     275           2 :       cred.exchange_url,
     276             :       "EUR:0.98",
     277             :       cred.exchange_payto, cred.user43_payto),
     278           2 :     TALER_TESTING_cmd_check_bank_transfer
     279             :       ("check-massive-transfer-8",
     280           2 :       cred.exchange_url,
     281             :       "EUR:0.98",
     282             :       cred.exchange_payto, cred.user43_payto),
     283           2 :     TALER_TESTING_cmd_check_bank_transfer
     284             :       ("check-massive-transfer-9",
     285           2 :       cred.exchange_url,
     286             :       "EUR:0.98",
     287             :       cred.exchange_payto, cred.user43_payto),
     288           2 :     TALER_TESTING_cmd_check_bank_transfer
     289             :       ("check-massive-transfer-10",
     290           2 :       cred.exchange_url,
     291             :       "EUR:0.98",
     292             :       cred.exchange_payto, cred.user43_payto),
     293           2 :     TALER_TESTING_cmd_check_bank_empty ("check_bank_empty"),
     294           2 :     TALER_TESTING_cmd_end ()
     295             :   };
     296             : 
     297             :   /**
     298             :    * This block checks whether a wire deadline
     299             :    * very far in the future does NOT get aggregated now.
     300             :    */
     301             :   struct TALER_TESTING_Command unaggregation[] = {
     302           2 :     TALER_TESTING_cmd_check_bank_empty ("far-future-aggregation-a"),
     303           2 :     CMD_TRANSFER_TO_EXCHANGE ("create-reserve-unaggregated",
     304             :                               "EUR:5.01"),
     305           2 :     CMD_EXEC_WIREWATCH ("wirewatch-unaggregated"),
     306             :     /* "consume" reserve creation transfer.  */
     307           2 :     TALER_TESTING_cmd_check_bank_admin_transfer (
     308             :       "check_bank_transfer-unaggregated",
     309             :       "EUR:5.01",
     310             :       cred.user42_payto,
     311             :       cred.exchange_payto,
     312             :       "create-reserve-unaggregated"),
     313           2 :     TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-unaggregated",
     314             :                                        "create-reserve-unaggregated",
     315             :                                        "EUR:5",
     316             :                                        0, /* age restriction off */
     317             :                                        MHD_HTTP_OK),
     318           2 :     TALER_TESTING_cmd_deposit ("deposit-unaggregated",
     319             :                                "withdraw-coin-unaggregated",
     320             :                                0,
     321             :                                cred.user43_payto,
     322             :                                "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     323             :                                GNUNET_TIME_relative_multiply
     324             :                                  (GNUNET_TIME_UNIT_YEARS,
     325             :                                  3000),
     326             :                                "EUR:5",
     327             :                                MHD_HTTP_OK),
     328           2 :     CMD_EXEC_AGGREGATOR ("aggregation-attempt"),
     329           2 :     TALER_TESTING_cmd_check_bank_empty ("far-future-aggregation-b"),
     330           2 :     TALER_TESTING_cmd_end ()
     331             :   };
     332             : 
     333             :   struct TALER_TESTING_Command refund[] = {
     334             :     /**
     335             :      * Fill reserve with EUR:5.01, as withdraw fee is 1 ct per config.
     336             :      */
     337           2 :     CMD_TRANSFER_TO_EXCHANGE ("create-reserve-r1",
     338             :                               "EUR:5.01"),
     339             :     /**
     340             :      * Run wire-watch to trigger the reserve creation.
     341             :      */
     342           2 :     CMD_EXEC_WIREWATCH ("wirewatch-3"),
     343             :     /**
     344             :      * Withdraw a 5 EUR coin, at fee of 1 ct
     345             :      */
     346           2 :     TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r1",
     347             :                                        "create-reserve-r1",
     348             :                                        "EUR:5",
     349             :                                        0, /* age restriction off */
     350             :                                        MHD_HTTP_OK),
     351             :     /**
     352             :      * Spend 5 EUR of the 5 EUR coin (in full). Merchant would
     353             :      * receive EUR:4.99 due to 1 ct deposit fee.
     354             :      */
     355           2 :     TALER_TESTING_cmd_deposit ("deposit-refund-1",
     356             :                                "withdraw-coin-r1",
     357             :                                0,
     358             :                                cred.user42_payto,
     359             :                                "{\"items\":[{\"name\":\"ice\",\"value\":\"EUR:5\"}]}",
     360             :                                GNUNET_TIME_UNIT_MINUTES,
     361             :                                "EUR:5",
     362             :                                MHD_HTTP_OK),
     363             : 
     364           2 :     TALER_TESTING_cmd_refund ("refund-ok",
     365             :                               MHD_HTTP_OK,
     366             :                               "EUR:5",
     367             :                               "deposit-refund-1"),
     368             :     /**
     369             :      * Spend 4.99 EUR of the refunded 4.99 EUR coin (1ct gone
     370             :      * due to refund) (merchant would receive EUR:4.98 due to
     371             :      * 1 ct deposit fee) */
     372           2 :     TALER_TESTING_cmd_deposit ("deposit-refund-2",
     373             :                                "withdraw-coin-r1",
     374             :                                0,
     375             :                                cred.user42_payto,
     376             :                                "{\"items\":[{\"name\":\"more\",\"value\":\"EUR:5\"}]}",
     377           2 :                                GNUNET_TIME_UNIT_ZERO,
     378             :                                "EUR:4.99",
     379             :                                MHD_HTTP_OK),
     380             :     /**
     381             :      * Run transfers. This will do the transfer as refund deadline was
     382             :      * 0.
     383             :      */
     384           2 :     CMD_EXEC_AGGREGATOR ("run-aggregator-3"),
     385           2 :     TALER_TESTING_cmd_end ()
     386             :   };
     387             : 
     388             : #if FIXME_9828
     389             :   struct TALER_TESTING_Command recoup[] = {
     390             :     /**
     391             :      * Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
     392             :      * config.
     393             :      */
     394             :     CMD_TRANSFER_TO_EXCHANGE ("recoup-create-reserve-1",
     395             :                               "EUR:5.01"),
     396             :     /**
     397             :      * Run wire-watch to trigger the reserve creation.
     398             :      */
     399             :     CMD_EXEC_WIREWATCH ("wirewatch-4"),
     400             :     /**
     401             :      * Withdraw a 5 EUR coin, at fee of 1 ct
     402             :      */
     403             :     TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-1",
     404             :                                        "recoup-create-reserve-1",
     405             :                                        "EUR:5",
     406             :                                        0, /* age restriction off */
     407             :                                        MHD_HTTP_OK),
     408             :     TALER_TESTING_cmd_revoke ("revoke-1",
     409             :                               MHD_HTTP_OK,
     410             :                               "recoup-withdraw-coin-1",
     411             :                               config_file),
     412             :     TALER_TESTING_cmd_recoup ("recoup-1",
     413             :                               MHD_HTTP_OK,
     414             :                               "recoup-withdraw-coin-1",
     415             :                               "EUR:5"),
     416             :     /**
     417             :      * Re-withdraw from this reserve
     418             :      */
     419             :     TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2",
     420             :                                        "recoup-create-reserve-1",
     421             :                                        "EUR:1",
     422             :                                        0, /* age restriction off */
     423             :                                        MHD_HTTP_OK),
     424             :     /**
     425             :      * These commands should close the reserve because the aggregator
     426             :      * is given a config file that overrides the reserve expiration
     427             :      * time (making it now-ish)
     428             :      */
     429             :     CMD_TRANSFER_TO_EXCHANGE ("short-lived-reserve",
     430             :                               "EUR:5.01"),
     431             :     TALER_TESTING_cmd_exec_wirewatch2 ("short-lived-aggregation",
     432             :                                        config_file_expire_reserve_now,
     433             :                                        "exchange-account-2"),
     434             :     TALER_TESTING_cmd_exec_aggregator ("close-reserves",
     435             :                                        config_file_expire_reserve_now),
     436             :     /**
     437             :      * Fill reserve with EUR:2.02, as withdraw fee is 1 ct per
     438             :      * config, then withdraw two coin, partially spend one, and
     439             :      * then have the rest paid back.  Check deposit of other coin
     440             :      * fails.  (Do not use EUR:5 here as the EUR:5 coin was
     441             :      * revoked and we did not bother to create a new one...)
     442             :      */CMD_TRANSFER_TO_EXCHANGE ("recoup-create-reserve-2",
     443             :                               "EUR:2.02"),
     444             :     /**
     445             :      * Make previous command effective.
     446             :      */
     447             :     CMD_EXEC_WIREWATCH ("wirewatch-5"),
     448             :     /**
     449             :      * Withdraw a 1 EUR coin, at fee of 1 ct
     450             :      */
     451             :     TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2a",
     452             :                                        "recoup-create-reserve-2",
     453             :                                        "EUR:1",
     454             :                                        0, /* age restriction off */
     455             :                                        MHD_HTTP_OK),
     456             :     /**
     457             :      * Withdraw a 1 EUR coin, at fee of 1 ct
     458             :      */
     459             :     TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2b",
     460             :                                        "recoup-create-reserve-2",
     461             :                                        "EUR:1",
     462             :                                        0, /* age restriction off */
     463             :                                        MHD_HTTP_OK),
     464             :     TALER_TESTING_cmd_deposit ("recoup-deposit-partial",
     465             :                                "recoup-withdraw-coin-2a",
     466             :                                0,
     467             :                                cred.user42_payto,
     468             :                                "{\"items\":[{\"name\":\"more ice cream\",\"value\":1}]}",
     469             :                                GNUNET_TIME_UNIT_ZERO,
     470             :                                "EUR:0.5",
     471             :                                MHD_HTTP_OK),
     472             :     TALER_TESTING_cmd_revoke ("revoke-2",
     473             :                               MHD_HTTP_OK,
     474             :                               "recoup-withdraw-coin-2a",
     475             :                               config_file),
     476             :     TALER_TESTING_cmd_recoup ("recoup-2",
     477             :                               MHD_HTTP_OK,
     478             :                               "recoup-withdraw-coin-2a",
     479             :                               "EUR:0.5"),
     480             :     TALER_TESTING_cmd_end ()
     481             :   };
     482             : #endif
     483             : 
     484             :   struct TALER_TESTING_Command massive_deposit_confirms[] = {
     485             : 
     486             :     /**
     487             :      * Move money to the exchange's bank account.
     488             :      */
     489           2 :     CMD_TRANSFER_TO_EXCHANGE ("massive-reserve",
     490             :                               "EUR:10.10"),
     491           2 :     TALER_TESTING_cmd_check_bank_admin_transfer (
     492             :       "check-massive-transfer",
     493             :       "EUR:10.10",
     494             :       cred.user42_payto,
     495             :       cred.exchange_payto,
     496             :       "massive-reserve"),
     497           2 :     CMD_EXEC_WIREWATCH ("massive-wirewatch"),
     498           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-1",
     499             :                                        "massive-reserve",
     500             :                                        "EUR:1",
     501             :                                        0, /* age restriction off */
     502             :                                        MHD_HTTP_OK),
     503           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-2",
     504             :                                        "massive-reserve",
     505             :                                        "EUR:1",
     506             :                                        0, /* age restriction off */
     507             :                                        MHD_HTTP_OK),
     508           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-3",
     509             :                                        "massive-reserve",
     510             :                                        "EUR:1",
     511             :                                        0, /* age restriction off */
     512             :                                        MHD_HTTP_OK),
     513           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-4",
     514             :                                        "massive-reserve",
     515             :                                        "EUR:1",
     516             :                                        0, /* age restriction off */
     517             :                                        MHD_HTTP_OK),
     518           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-5",
     519             :                                        "massive-reserve",
     520             :                                        "EUR:1",
     521             :                                        0, /* age restriction off */
     522             :                                        MHD_HTTP_OK),
     523           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-6",
     524             :                                        "massive-reserve",
     525             :                                        "EUR:1",
     526             :                                        0, /* age restriction off */
     527             :                                        MHD_HTTP_OK),
     528           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-7",
     529             :                                        "massive-reserve",
     530             :                                        "EUR:1",
     531             :                                        0, /* age restriction off */
     532             :                                        MHD_HTTP_OK),
     533           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-8",
     534             :                                        "massive-reserve",
     535             :                                        "EUR:1",
     536             :                                        0, /* age restriction off */
     537             :                                        MHD_HTTP_OK),
     538           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-9",
     539             :                                        "massive-reserve",
     540             :                                        "EUR:1",
     541             :                                        0, /* age restriction off */
     542             :                                        MHD_HTTP_OK),
     543           2 :     TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-10",
     544             :                                        "massive-reserve",
     545             :                                        "EUR:1",
     546             :                                        0, /* age restriction off */
     547             :                                        MHD_HTTP_OK),
     548           2 :     TALER_TESTING_cmd_deposit (
     549             :       "massive-deposit-1",
     550             :       "massive-withdraw-1",
     551             :       0,
     552             :       cred.user43_payto,
     553             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     554           2 :       GNUNET_TIME_UNIT_ZERO,
     555             :       "EUR:1",
     556             :       MHD_HTTP_OK),
     557           2 :     TALER_TESTING_cmd_deposit
     558             :       ("massive-deposit-2",
     559             :       "massive-withdraw-2",
     560             :       0,
     561             :       cred.user43_payto,
     562             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     563           2 :       GNUNET_TIME_UNIT_ZERO,
     564             :       "EUR:1",
     565             :       MHD_HTTP_OK),
     566           2 :     TALER_TESTING_cmd_deposit
     567             :       ("massive-deposit-3",
     568             :       "massive-withdraw-3",
     569             :       0,
     570             :       cred.user43_payto,
     571             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     572           2 :       GNUNET_TIME_UNIT_ZERO,
     573             :       "EUR:1",
     574             :       MHD_HTTP_OK),
     575           2 :     TALER_TESTING_cmd_deposit
     576             :       ("massive-deposit-4",
     577             :       "massive-withdraw-4",
     578             :       0,
     579             :       cred.user43_payto,
     580             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     581           2 :       GNUNET_TIME_UNIT_ZERO,
     582             :       "EUR:1",
     583             :       MHD_HTTP_OK),
     584           2 :     TALER_TESTING_cmd_deposit
     585             :       ("massive-deposit-5",
     586             :       "massive-withdraw-5",
     587             :       0,
     588             :       cred.user43_payto,
     589             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     590           2 :       GNUNET_TIME_UNIT_ZERO,
     591             :       "EUR:1",
     592             :       MHD_HTTP_OK),
     593           2 :     TALER_TESTING_cmd_deposit
     594             :       ("massive-deposit-6",
     595             :       "massive-withdraw-6",
     596             :       0,
     597             :       cred.user43_payto,
     598             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     599           2 :       GNUNET_TIME_UNIT_ZERO,
     600             :       "EUR:1",
     601             :       MHD_HTTP_OK),
     602           2 :     TALER_TESTING_cmd_deposit
     603             :       ("massive-deposit-7",
     604             :       "massive-withdraw-7",
     605             :       0,
     606             :       cred.user43_payto,
     607             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     608           2 :       GNUNET_TIME_UNIT_ZERO,
     609             :       "EUR:1",
     610             :       MHD_HTTP_OK),
     611           2 :     TALER_TESTING_cmd_deposit
     612             :       ("massive-deposit-8",
     613             :       "massive-withdraw-8",
     614             :       0,
     615             :       cred.user43_payto,
     616             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     617           2 :       GNUNET_TIME_UNIT_ZERO,
     618             :       "EUR:1",
     619             :       MHD_HTTP_OK),
     620           2 :     TALER_TESTING_cmd_deposit
     621             :       ("massive-deposit-9",
     622             :       "massive-withdraw-9",
     623             :       0,
     624             :       cred.user43_payto,
     625             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     626           2 :       GNUNET_TIME_UNIT_ZERO,
     627             :       "EUR:1",
     628             :       MHD_HTTP_OK),
     629           2 :     TALER_TESTING_cmd_deposit (
     630             :       "massive-deposit-10",
     631             :       "massive-withdraw-10",
     632             :       0,
     633             :       cred.user43_payto,
     634             :       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
     635           2 :       GNUNET_TIME_UNIT_ZERO,
     636             :       "EUR:1",
     637             :       MHD_HTTP_OK),
     638           2 :     TALER_TESTING_cmd_deposit_confirmation ("deposit-confirmation",
     639             :                                             "massive-deposit-10",
     640             :                                             1,
     641             :                                             "EUR:0.99",
     642             :                                             MHD_HTTP_OK),
     643             :     // CMD_RUN_AUDITOR ("massive-auditor"),
     644             : 
     645           2 :     TALER_TESTING_cmd_end ()
     646             :   };
     647             : 
     648             :   struct TALER_TESTING_Command commands[] = {
     649           2 :     TALER_TESTING_cmd_run_fakebank ("run-fakebank",
     650           2 :                                     cred.cfg,
     651             :                                     "exchange-account-2"),
     652           2 :     TALER_TESTING_cmd_system_start ("start-taler",
     653             :                                     config_file,
     654             :                                     "-u", "exchange-account-2",
     655             :                                     "-ea",
     656             :                                     NULL),
     657           2 :     TALER_TESTING_cmd_get_exchange ("get-exchange",
     658           2 :                                     cred.cfg,
     659             :                                     NULL,
     660             :                                     true,
     661             :                                     true),
     662           2 :     TALER_TESTING_cmd_get_auditor ("get-auditor",
     663           2 :                                    cred.cfg,
     664             :                                    true),
     665           2 :     TALER_TESTING_cmd_exec_auditor_offline ("auditor-offline",
     666             :                                             config_file),
     667             :     // CMD_RUN_AUDITOR ("virgin-auditor"),
     668           2 :     TALER_TESTING_cmd_batch ("massive-deposit-confirms",
     669             :                              massive_deposit_confirms),
     670           2 :     TALER_TESTING_cmd_batch ("withdraw",
     671             :                              withdraw),
     672           2 :     TALER_TESTING_cmd_batch ("spend",
     673             :                              spend),
     674           2 :     TALER_TESTING_cmd_batch ("refresh",
     675             :                              refresh),
     676           2 :     TALER_TESTING_cmd_batch ("track",
     677             :                              track),
     678           2 :     TALER_TESTING_cmd_batch ("unaggregation",
     679             :                              unaggregation),
     680           2 :     TALER_TESTING_cmd_batch ("refund",
     681             :                              refund),
     682             : #if FIXME_9828
     683             :     TALER_TESTING_cmd_batch ("recoup",
     684             :                              recoup),
     685             : #endif
     686             :     // CMD_RUN_AUDITOR ("normal-auditor"),
     687           2 :     TALER_TESTING_cmd_end ()
     688             :   };
     689             : 
     690             :   (void) cls;
     691           2 :   TALER_TESTING_run (is,
     692             :                      commands);
     693           2 : }
     694             : 
     695             : 
     696             : int
     697           2 : main (int argc,
     698             :       char *const *argv)
     699             : {
     700             :   (void) argc;
     701             :   {
     702             :     char *cipher;
     703             : 
     704           2 :     cipher = GNUNET_STRINGS_get_suffix_from_binary_name (argv[0]);
     705           2 :     GNUNET_assert (NULL != cipher);
     706           2 :     GNUNET_asprintf (&config_file,
     707             :                      "test_auditor_api-%s.conf",
     708             :                      cipher);
     709           2 :     GNUNET_asprintf (&config_file_expire_reserve_now,
     710             :                      "test_auditor_api_expire_reserve_now-%s.conf",
     711             :                      cipher);
     712           2 :     GNUNET_free (cipher);
     713             :   }
     714           2 :   return TALER_TESTING_main (argv,
     715             :                              "INFO",
     716             :                              config_file,
     717             :                              "exchange-account-2",
     718             :                              TALER_TESTING_BS_FAKEBANK,
     719             :                              &cred,
     720             :                              &run,
     721             :                              NULL);
     722             : }
     723             : 
     724             : 
     725             : /* end of test_auditor_api.c */

Generated by: LCOV version 1.16