LCOV - code coverage report
Current view: top level - testing - test_exchange_api_overlapping_keys_bug.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 19 19 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) 2018, 2019 Taler Systems SA
       4             : 
       5             :   TALER is free software; you can redistribute it and/or modify it
       6             :   under the terms of the GNU General Public License as published
       7             :   by the Free Software Foundation; either version 3, or (at your
       8             :   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             : /**
      21             :  * @file testing/test_exchange_api_overlapping_keys_bug.c
      22             :  * @brief testcase to test exchange's /keys cherry picking ability and
      23             :  *          other /keys related operations
      24             :  * @author Marcello Stanisci
      25             :  * @author Christian Grothoff
      26             :  */
      27             : 
      28             : #include "platform.h"
      29             : #include "taler_util.h"
      30             : #include "taler_signatures.h"
      31             : #include "taler_exchange_service.h"
      32             : #include "taler_json_lib.h"
      33             : #include <gnunet/gnunet_util_lib.h>
      34             : #include <gnunet/gnunet_testing_lib.h>
      35             : #include <microhttpd.h>
      36             : #include "taler_bank_service.h"
      37             : #include "taler_fakebank_lib.h"
      38             : #include "taler_testing_lib.h"
      39             : 
      40             : /**
      41             :  * Configuration file we use.  One (big) configuration is used
      42             :  * for the various components for this test.
      43             :  */
      44             : static char *config_file;
      45             : 
      46             : /**
      47             :  * Our credentials.
      48             :  */
      49             : static struct TALER_TESTING_Credentials cred;
      50             : 
      51             : 
      52             : /**
      53             :  * Main function that will tell the interpreter what commands to
      54             :  * run.
      55             :  *
      56             :  * @param cls closure
      57             :  */
      58             : static void
      59           2 : run (void *cls,
      60             :      struct TALER_TESTING_Interpreter *is)
      61             : {
      62             :   struct TALER_TESTING_Command commands[] = {
      63           2 :     TALER_TESTING_cmd_run_fakebank ("run-fakebank",
      64           2 :                                     cred.cfg,
      65             :                                     "exchange-account-2"),
      66           2 :     TALER_TESTING_cmd_system_start ("start-taler",
      67             :                                     config_file,
      68             :                                     "-e",
      69             :                                     NULL),
      70           2 :     TALER_TESTING_cmd_get_exchange ("get-exchange",
      71           2 :                                     cred.cfg,
      72             :                                     NULL,
      73             :                                     true,
      74             :                                     true),
      75           2 :     TALER_TESTING_cmd_get_exchange ("get-exchange-1",
      76           2 :                                     cred.cfg,
      77             :                                     "get-exchange",
      78             :                                     true,
      79             :                                     true),
      80           2 :     TALER_TESTING_cmd_get_exchange ("get-exchange-2",
      81           2 :                                     cred.cfg,
      82             :                                     NULL,
      83             :                                     true,
      84             :                                     true),
      85           2 :     TALER_TESTING_cmd_end ()
      86             :   };
      87             : 
      88             :   (void) cls;
      89           2 :   TALER_TESTING_run (is,
      90             :                      commands);
      91           2 : }
      92             : 
      93             : 
      94             : int
      95           2 : main (int argc,
      96             :       char *const *argv)
      97             : {
      98             :   (void) argc;
      99             :   {
     100             :     char *cipher;
     101             : 
     102           2 :     cipher = GNUNET_STRINGS_get_suffix_from_binary_name (argv[0]);
     103           2 :     GNUNET_assert (NULL != cipher);
     104           2 :     GNUNET_asprintf (&config_file,
     105             :                      "test_exchange_api_keys_cherry_picking-%s.conf",
     106             :                      cipher);
     107           2 :     GNUNET_free (cipher);
     108             :   }
     109           2 :   return TALER_TESTING_main (argv,
     110             :                              "INFO",
     111             :                              config_file,
     112             :                              "exchange-account-2",
     113             :                              TALER_TESTING_BS_FAKEBANK,
     114             :                              &cred,
     115             :                              &run,
     116             :                              NULL);
     117             : }
     118             : 
     119             : 
     120             : /* end of test_exchange_api_overlapping_keys_bug.c */

Generated by: LCOV version 1.16