test_auditor_api.c (26498B)
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 struct TALER_TESTING_Command recoup[] = { 386 /** 387 * Fill reserve with EUR:5.01, as withdraw fee is 1 ct per 388 * config. 389 */ 390 CMD_TRANSFER_TO_EXCHANGE ("recoup-create-reserve-1", 391 "EUR:5.01"), 392 /** 393 * Run wire-watch to trigger the reserve creation. 394 */ 395 CMD_EXEC_WIREWATCH ("wirewatch-4"), 396 /** 397 * Withdraw a 5 EUR coin, at fee of 1 ct 398 */ 399 TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-1", 400 "recoup-create-reserve-1", 401 "EUR:5", 402 0, /* age restriction off */ 403 MHD_HTTP_OK), 404 TALER_TESTING_cmd_revoke ("revoke-1", 405 MHD_HTTP_OK, 406 "recoup-withdraw-coin-1", 407 config_file), 408 TALER_TESTING_cmd_recoup ("recoup-1", 409 MHD_HTTP_OK, 410 "recoup-withdraw-coin-1", 411 "EUR:5"), 412 /** 413 * Re-withdraw from this reserve 414 */ 415 TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2", 416 "recoup-create-reserve-1", 417 "EUR:1", 418 0, /* age restriction off */ 419 MHD_HTTP_OK), 420 /** 421 * These commands should close the reserve because the aggregator 422 * is given a config file that overrides the reserve expiration 423 * time (making it now-ish) 424 */ 425 CMD_TRANSFER_TO_EXCHANGE ("short-lived-reserve", 426 "EUR:5.01"), 427 TALER_TESTING_cmd_exec_wirewatch2 ("short-lived-aggregation", 428 config_file_expire_reserve_now, 429 "exchange-account-2"), 430 TALER_TESTING_cmd_exec_aggregator ("close-reserves", 431 config_file_expire_reserve_now), 432 /** 433 * Fill reserve with EUR:2.02, as withdraw fee is 1 ct per 434 * config, then withdraw two coin, partially spend one, and 435 * then have the rest paid back. Check deposit of other coin 436 * fails. (Do not use EUR:5 here as the EUR:5 coin was 437 * revoked and we did not bother to create a new one...) 438 */CMD_TRANSFER_TO_EXCHANGE ("recoup-create-reserve-2", 439 "EUR:2.02"), 440 /** 441 * Make previous command effective. 442 */ 443 CMD_EXEC_WIREWATCH ("wirewatch-5"), 444 /** 445 * Withdraw a 1 EUR coin, at fee of 1 ct 446 */ 447 TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2a", 448 "recoup-create-reserve-2", 449 "EUR:1", 450 0, /* age restriction off */ 451 MHD_HTTP_OK), 452 /** 453 * Withdraw a 1 EUR coin, at fee of 1 ct 454 */ 455 TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2b", 456 "recoup-create-reserve-2", 457 "EUR:1", 458 0, /* age restriction off */ 459 MHD_HTTP_OK), 460 TALER_TESTING_cmd_deposit ("recoup-deposit-partial", 461 "recoup-withdraw-coin-2a", 462 0, 463 cred.user42_payto, 464 "{\"items\":[{\"name\":\"more ice cream\",\"value\":1}]}", 465 GNUNET_TIME_UNIT_ZERO, 466 "EUR:0.5", 467 MHD_HTTP_OK), 468 TALER_TESTING_cmd_revoke ("revoke-2", 469 MHD_HTTP_OK, 470 "recoup-withdraw-coin-2a", 471 config_file), 472 TALER_TESTING_cmd_recoup ("recoup-2", 473 MHD_HTTP_OK, 474 "recoup-withdraw-coin-2a", 475 "EUR:0.5"), 476 TALER_TESTING_cmd_end () 477 }; 478 479 struct TALER_TESTING_Command massive_deposit_confirms[] = { 480 481 /** 482 * Move money to the exchange's bank account. 483 */ 484 CMD_TRANSFER_TO_EXCHANGE ("massive-reserve", 485 "EUR:10.10"), 486 TALER_TESTING_cmd_check_bank_admin_transfer ( 487 "check-massive-transfer", 488 "EUR:10.10", 489 cred.user42_payto, 490 cred.exchange_payto, 491 "massive-reserve"), 492 CMD_EXEC_WIREWATCH ("massive-wirewatch"), 493 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-1", 494 "massive-reserve", 495 "EUR:1", 496 0, /* age restriction off */ 497 MHD_HTTP_OK), 498 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-2", 499 "massive-reserve", 500 "EUR:1", 501 0, /* age restriction off */ 502 MHD_HTTP_OK), 503 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-3", 504 "massive-reserve", 505 "EUR:1", 506 0, /* age restriction off */ 507 MHD_HTTP_OK), 508 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-4", 509 "massive-reserve", 510 "EUR:1", 511 0, /* age restriction off */ 512 MHD_HTTP_OK), 513 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-5", 514 "massive-reserve", 515 "EUR:1", 516 0, /* age restriction off */ 517 MHD_HTTP_OK), 518 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-6", 519 "massive-reserve", 520 "EUR:1", 521 0, /* age restriction off */ 522 MHD_HTTP_OK), 523 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-7", 524 "massive-reserve", 525 "EUR:1", 526 0, /* age restriction off */ 527 MHD_HTTP_OK), 528 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-8", 529 "massive-reserve", 530 "EUR:1", 531 0, /* age restriction off */ 532 MHD_HTTP_OK), 533 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-9", 534 "massive-reserve", 535 "EUR:1", 536 0, /* age restriction off */ 537 MHD_HTTP_OK), 538 TALER_TESTING_cmd_withdraw_amount ("massive-withdraw-10", 539 "massive-reserve", 540 "EUR:1", 541 0, /* age restriction off */ 542 MHD_HTTP_OK), 543 TALER_TESTING_cmd_deposit ( 544 "massive-deposit-1", 545 "massive-withdraw-1", 546 0, 547 cred.user43_payto, 548 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 549 GNUNET_TIME_UNIT_ZERO, 550 "EUR:1", 551 MHD_HTTP_OK), 552 TALER_TESTING_cmd_deposit 553 ("massive-deposit-2", 554 "massive-withdraw-2", 555 0, 556 cred.user43_payto, 557 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 558 GNUNET_TIME_UNIT_ZERO, 559 "EUR:1", 560 MHD_HTTP_OK), 561 TALER_TESTING_cmd_deposit 562 ("massive-deposit-3", 563 "massive-withdraw-3", 564 0, 565 cred.user43_payto, 566 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 567 GNUNET_TIME_UNIT_ZERO, 568 "EUR:1", 569 MHD_HTTP_OK), 570 TALER_TESTING_cmd_deposit 571 ("massive-deposit-4", 572 "massive-withdraw-4", 573 0, 574 cred.user43_payto, 575 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 576 GNUNET_TIME_UNIT_ZERO, 577 "EUR:1", 578 MHD_HTTP_OK), 579 TALER_TESTING_cmd_deposit 580 ("massive-deposit-5", 581 "massive-withdraw-5", 582 0, 583 cred.user43_payto, 584 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 585 GNUNET_TIME_UNIT_ZERO, 586 "EUR:1", 587 MHD_HTTP_OK), 588 TALER_TESTING_cmd_deposit 589 ("massive-deposit-6", 590 "massive-withdraw-6", 591 0, 592 cred.user43_payto, 593 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 594 GNUNET_TIME_UNIT_ZERO, 595 "EUR:1", 596 MHD_HTTP_OK), 597 TALER_TESTING_cmd_deposit 598 ("massive-deposit-7", 599 "massive-withdraw-7", 600 0, 601 cred.user43_payto, 602 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 603 GNUNET_TIME_UNIT_ZERO, 604 "EUR:1", 605 MHD_HTTP_OK), 606 TALER_TESTING_cmd_deposit 607 ("massive-deposit-8", 608 "massive-withdraw-8", 609 0, 610 cred.user43_payto, 611 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 612 GNUNET_TIME_UNIT_ZERO, 613 "EUR:1", 614 MHD_HTTP_OK), 615 TALER_TESTING_cmd_deposit 616 ("massive-deposit-9", 617 "massive-withdraw-9", 618 0, 619 cred.user43_payto, 620 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 621 GNUNET_TIME_UNIT_ZERO, 622 "EUR:1", 623 MHD_HTTP_OK), 624 TALER_TESTING_cmd_deposit ( 625 "massive-deposit-10", 626 "massive-withdraw-10", 627 0, 628 cred.user43_payto, 629 "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}", 630 GNUNET_TIME_UNIT_ZERO, 631 "EUR:1", 632 MHD_HTTP_OK), 633 TALER_TESTING_cmd_deposit_confirmation ("deposit-confirmation", 634 "massive-deposit-10", 635 1, 636 "EUR:0.99", 637 MHD_HTTP_NO_CONTENT), 638 // CMD_RUN_AUDITOR ("massive-auditor"), 639 640 TALER_TESTING_cmd_end () 641 }; 642 643 struct TALER_TESTING_Command commands[] = { 644 TALER_TESTING_cmd_run_fakebank ("run-fakebank", 645 cred.cfg, 646 "exchange-account-2"), 647 TALER_TESTING_cmd_system_start ("start-taler", 648 config_file, 649 "-u", "exchange-account-2", 650 "-ea", 651 NULL), 652 TALER_TESTING_cmd_get_exchange ("get-exchange", 653 cred.cfg, 654 NULL, 655 true, 656 true), 657 TALER_TESTING_cmd_get_auditor ("get-auditor", 658 cred.cfg, 659 true), 660 TALER_TESTING_cmd_exec_auditor_offline ("auditor-offline", 661 config_file), 662 // CMD_RUN_AUDITOR ("virgin-auditor"), 663 TALER_TESTING_cmd_batch ("massive-deposit-confirms", 664 massive_deposit_confirms), 665 TALER_TESTING_cmd_batch ("withdraw", 666 withdraw), 667 TALER_TESTING_cmd_batch ("spend", 668 spend), 669 TALER_TESTING_cmd_batch ("refresh", 670 refresh), 671 TALER_TESTING_cmd_batch ("track", 672 track), 673 TALER_TESTING_cmd_batch ("unaggregation", 674 unaggregation), 675 TALER_TESTING_cmd_batch ("refund", 676 refund), 677 TALER_TESTING_cmd_batch ("recoup", 678 recoup), 679 // CMD_RUN_AUDITOR ("normal-auditor"), 680 TALER_TESTING_cmd_end () 681 }; 682 683 (void) cls; 684 TALER_TESTING_run (is, 685 commands); 686 } 687 688 689 int 690 main (int argc, 691 char *const *argv) 692 { 693 (void) argc; 694 { 695 char *cipher; 696 697 cipher = GNUNET_STRINGS_get_suffix_from_binary_name (argv[0]); 698 GNUNET_assert (NULL != cipher); 699 GNUNET_asprintf (&config_file, 700 "test_auditor_api-%s.conf", 701 cipher); 702 GNUNET_asprintf (&config_file_expire_reserve_now, 703 "test_auditor_api_expire_reserve_now-%s.conf", 704 cipher); 705 GNUNET_free (cipher); 706 } 707 return TALER_TESTING_main (argv, 708 "INFO", 709 config_file, 710 "exchange-account-2", 711 TALER_TESTING_BS_FAKEBANK, 712 &cred, 713 &run, 714 NULL); 715 } 716 717 718 /* end of test_auditor_api.c */