exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

test_auditor_api.c (26534B)


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