meson.build (13573B)
1 # This build file is in the public domain 2 3 pkgcfgadir = get_option('datadir') / 'taler-auditor' / 'config.d' 4 pkgcfgedir = get_option('datadir') / 'taler-exchange' / 'config.d' 5 6 # Auditor also needs to access the exchange DB, so we install 7 # the exchange configuration for it here as well! 8 install_data( 9 'exchangedb.conf', 10 'exchangedb-postgres.conf', 11 install_dir: pkgcfgadir, 12 ) 13 14 install_data( 15 'exchangedb.conf', 16 'exchangedb-postgres.conf', 17 install_dir: pkgcfgedir, 18 ) 19 20 configure_file( 21 input: 'test-exchange-db-postgres.conf', 22 output: 'test-exchange-db-postgres.conf', 23 copy: true, 24 ) 25 26 subdir('sql-schema') 27 28 test_idem = configure_file( 29 input: 'test_idempotency.sh', 30 output: 'test_idempotency.sh', 31 copy: true, 32 ) 33 34 test( 35 'test_idempotency.sh', 36 test_idem, 37 workdir: meson.current_build_dir(), 38 suite: ['exchangedb', 'installcheck'], 39 is_parallel: false, 40 ) 41 42 43 libtalerexchangedb = library( 44 'talerexchangedb', 45 [ 46 'account_history.c', 47 'bench_db.c', 48 'exchangedb_accounts.c', 49 'exchangedb_transactions.c', 50 'free_coin_transaction_list.c', 51 'free_reserve_history.c', 52 'do_persist_aml_program_result.c', 53 'abort_shard.c', 54 'insert_signkey.c', 55 'do_aggregate.c', 56 'begin_revolving_shard.c', 57 'begin_shard.c', 58 'pg.c', 59 'update_to_aml_unlocked.c', 60 'commit.c', 61 'update_shard_progress.c', 62 'compute_shard.c', 63 'get_count_known_coins.c', 64 'insert_aggregation_deferral.c', 65 'insert_aggregation_transient.c', 66 'create_tables.c', 67 'delete_aggregation_transient.c', 68 'delete_shard_locks.c', 69 'disable_rules.c', 70 'do_check_deposit_idempotent.c', 71 'do_deposit.c', 72 'do_purse_delete.c', 73 'do_purse_deposit.c', 74 'do_purse_merge.c', 75 'do_recoup.c', 76 'do_recoup_refresh.c', 77 'do_refresh.c', 78 'do_refund.c', 79 'do_reserve_open.c', 80 'do_reserve_purse.c', 81 'do_withdraw.c', 82 'do_drain_kyc_alert.c', 83 'drop_tables.c', 84 'enable_rules.c', 85 'do_insert_known_coins.c', 86 'event_listen.c', 87 'event_listen_cancel.c', 88 'event_notify.c', 89 'do_expire_purse.c', 90 'get_aggregation_transient_by_normalized_payto.c', 91 'gc.c', 92 'get_coin_denomination.c', 93 'get_coin_transactions.c', 94 'get_denomination_by_serial.c', 95 'get_denomination_pub_by_serial.c', 96 'get_denomination_info.c', 97 'get_denomination_revocation.c', 98 'get_profit_drain.c', 99 'iterate_expired_reserves.c', 100 'get_global_fee.c', 101 'iterate_global_fees.c', 102 'get_known_coin.c', 103 'get_kyc_rules.c', 104 'get_pending_legitimization_process.c', 105 'get_purse_deposit.c', 106 'get_purse_request.c', 107 'get_ready_deposit.c', 108 'get_refresh.c', 109 'get_reserve_balance.c', 110 'get_reserve_history.c', 111 'get_signature_for_known_coin.c', 112 'iterate_unfinished_close_requests.c', 113 'iterate_wire_accounts.c', 114 'get_wire_fee.c', 115 'iterate_wire_fees.c', 116 'get_wire_hash_for_contract.c', 117 'get_withdraw.c', 118 'get_exists_deposit.c', 119 'inject_auditor_triggers.c', 120 'insert_active_legitimization_measure.c', 121 'insert_aml_decision.c', 122 'insert_aml_officer.c', 123 'insert_aml_program_failure.c', 124 'insert_auditor.c', 125 'insert_auditor_denom_sig.c', 126 'insert_close_request.c', 127 'insert_contract.c', 128 'insert_denomination_info.c', 129 'insert_denomination_revocation.c', 130 'insert_profit_drain.c', 131 'insert_global_fee.c', 132 'insert_kyc_failure.c', 133 'insert_legitimization_process.c', 134 'insert_partner.c', 135 'insert_purse_request.c', 136 'insert_records_by_table.c', 137 'insert_refund.c', 138 'insert_reserve_closed.c', 139 'insert_reserve_open_deposit.c', 140 'insert_sanction_list_hit.c', 141 'insert_signkey_revocation.c', 142 'insert_successor_measure.c', 143 'insert_wire.c', 144 'insert_wire_fee.c', 145 'iterate_active_auditors.c', 146 'iterate_active_signkeys.c', 147 'iterate_auditor_denominations.c', 148 'iterate_denomination_info.c', 149 'iterate_denominations.c', 150 'iterate_kyc_references.c', 151 'iterate_reserve_close_info.c', 152 'get_kyc_provider_account.c', 153 'get_active_legitimization.c', 154 'get_aml_file_number.c', 155 'iterate_aml_history.c', 156 'iterate_aml_history_above_serial_id.c', 157 'iterate_aml_staff_above_serial_id.c', 158 'iterate_legitimization_outcomes_above_serial_id.c', 159 'get_aml_officer.c', 160 'get_auditor_status.c', 161 'get_auditor_timestamp.c', 162 'get_completed_legitimization.c', 163 'get_denomination_meta.c', 164 'get_global_fee_by_time.c', 165 'get_h_payto_by_access_token.c', 166 'iterate_kyc_history.c', 167 'get_legitimization_process_by_account.c', 168 'get_legitimization_requirement_by_row.c', 169 'get_kyc_status_by_token.c', 170 'get_pending_legitimization.c', 171 'iterate_records_by_table.c', 172 'get_rules_by_access_token.c', 173 'get_serial_by_table.c', 174 'get_signkey.c', 175 'get_signkey_revocation.c', 176 'get_transfer_by_deposit.c', 177 'get_wire_fee_by_time.c', 178 'get_wire_timestamp.c', 179 'iterate_wire_transfers.c', 180 'update_to_refresh_revealed.c', 181 'do_insert_kyc_attributes.c', 182 'preflight.c', 183 'get_pending_profit_drain.c', 184 'update_to_profit_drain_finished.c', 185 'release_revolving_shard.c', 186 'get_reserve.c', 187 'get_reserve_origin.c', 188 'do_import_credits.c', 189 'update_reserve.c', 190 'rollback.c', 191 'iterate_account_merges_above_serial_id.c', 192 'iterate_aggregation_amounts_for_kyc_check.c', 193 'iterate_aggregation_wtids_above_serial_id.c', 194 'iterate_aggregations_above_serial_id.c', 195 'get_aggregation_deferral_by_wtid.c', 196 'get_aggregation_transient.c', 197 'get_aggregation_transient_by_wtid.c', 198 'get_open_legitimization_measure.c', 199 'get_pending_aggregation.c', 200 'iterate_unscreened_kyc_attributes.c', 201 'iterate_all_purse_decisions_above_serial_id.c', 202 'iterate_all_purse_deletions_above_serial_id.c', 203 'iterate_aml_attributes.c', 204 'iterate_aml_decisions.c', 205 'iterate_aml_measures.c', 206 'iterate_aml_statistics.c', 207 'get_auditor_denom_sig.c', 208 'iterate_batch_deposits_missing_wire.c', 209 'iterate_coin_deposits_above_serial_id.c', 210 'get_contract_by_purse.c', 211 'get_contract.c', 212 'iterate_deposit_amounts_for_kyc_check.c', 213 'iterate_exchange_credit_transfers.c', 214 'iterate_exchange_debit_transfers.c', 215 'iterate_exchange_kycauth_transfers.c', 216 'iterate_kyc_accounts.c', 217 'iterate_kyc_attributes.c', 218 'iterate_kycauth_in_above_serial_id_by_account.c', 219 'iterate_merge_amounts_for_kyc_check.c', 220 'get_purse_by_merge_pub.c', 221 'get_purse.c', 222 'iterate_purse_decisions_above_serial_id.c', 223 'iterate_purse_deposits_above_serial_id.c', 224 'iterate_purse_deposits_by_purse.c', 225 'get_purse_merge.c', 226 'iterate_purse_merges_above_serial_id.c', 227 'iterate_purse_requests_above_serial_id.c', 228 'iterate_recoups_above_serial_id.c', 229 'iterate_recoup_refreshes_above_serial_id.c', 230 'iterate_refreshes_above_serial_id.c', 231 'iterate_refunds_above_serial_id.c', 232 'iterate_refunds_by_coin.c', 233 'iterate_reserve_closed_above_serial_id.c', 234 'get_reserve_close_info.c', 235 'get_reserve_close_request_info.c', 236 'iterate_reserve_open_above_serial_id.c', 237 'iterate_reserves_in_above_serial_id_by_account.c', 238 'iterate_reserves_in_above_serial_id.c', 239 'iterate_wallet_merges.c', 240 'iterate_wire_outs_above_serial_id_by_account.c', 241 'iterate_wire_outs_above_serial_id.c', 242 'iterate_withdrawals_above_serial_id.c', 243 'iterate_withdraw_amounts_for_kyc_check.c', 244 'update_to_aml_locked.c', 245 'update_to_kyc_attributes_screened.c', 246 'update_to_kyc_attributes_unscreened.c', 247 'start.c', 248 'start_deferred_wire_out.c', 249 'start_read_committed.c', 250 'start_read_only.c', 251 'insert_wire_out.c', 252 'template.c', 253 'get_exists_aml_officer.c', 254 'do_trigger_kyc_rule_for_account.c', 255 'do_reserve_legitimization_process.c', 256 'update_legitimization_process_start.c', 257 'update_aggregation_transient.c', 258 'update_auditor.c', 259 'update_legitimization_process_by_row.c', 260 'update_wire.c', 261 'iterate_prewires.c', 262 'iterate_prewires_below_open_shards.c', 263 'insert_prewire.c', 264 'update_to_prewire_failed.c', 265 'update_to_prewire_finished.c', 266 'begin_rule_update.c', 267 ], 268 soversion: solibversions['libtalerexchangedb']['soversion'], 269 version: solibversions['libtalerexchangedb']['soversion'], 270 install_rpath: rpath_option, 271 dependencies: [ 272 libtalerbank_dep, 273 libtalerkyclogic_dep, 274 libtalerpq_dep, 275 libtalerjson_dep, 276 libtalerutil_dep, 277 gnunetpq_dep, 278 gnunetjson_dep, 279 gnunetutil_dep, 280 json_dep, 281 curl_dep, 282 pq_dep, 283 ], 284 include_directories: [incdir, configuration_inc], 285 install: true, 286 install_dir: get_option('libdir'), 287 ) 288 289 libtalerexchangedb_dep = declare_dependency(link_with: libtalerexchangedb) 290 pkg.generate( 291 libtalerexchangedb, 292 url: 'https://taler.net', 293 description: 'GNU Taler exchange DB library', 294 ) 295 296 297 test_regressions = executable( 298 'test_regressions', 299 ['test_regressions.c'], 300 install_rpath: rpath_option, 301 dependencies: [ 302 libtalerexchangedb_dep, 303 libtalerutil_dep, 304 libtalerjson_dep, 305 libtalerpq_dep, 306 gnunetutil_dep, 307 gnunetjson_dep, 308 gnunetpq_dep, 309 pq_dep, 310 json_dep, 311 ], 312 include_directories: [incdir, configuration_inc], 313 install: false, 314 ) 315 316 test_regressions_sh = configure_file( 317 input: 'test_regressions.sh', 318 output: 'test_regressions.sh', 319 copy: true, 320 ) 321 322 test( 323 'test_regressions', 324 test_regressions_sh, 325 workdir: meson.current_build_dir(), 326 suite: ['exchangedb'], 327 depends: [test_regressions, exchangedb_sql_targets], 328 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 329 is_parallel: false, 330 timeout: 300, 331 ) 332 333 334 # One test binary per database table, each covering the exported functions 335 # whose primary test table it is. The '@brief' comment of every function in 336 # src/include/exchange-database/ names the table it belongs to. They all 337 # share test_common.c and the test_table.sh driver, which gives each of them 338 # a scratch database of its own. 339 340 test_table_sh = configure_file( 341 input: 'test_table.sh', 342 output: 'test_table.sh', 343 copy: true, 344 ) 345 346 exchangedb_table_tests = [ 347 'account_merges', 348 'aggregation_deferrals', 349 'aggregation_tracking', 350 'aggregation_transient', 351 'aml_history', 352 'aml_staff', 353 'auditor_denom_sigs', 354 'auditors', 355 'batch_deposits', 356 'close_requests', 357 'coin_deposits', 358 'coin_history', 359 'contracts', 360 'denomination_revocations', 361 'denominations', 362 'exchange_sign_keys', 363 'global_fee', 364 'known_coins', 365 'legitimization_measures', 366 'legitimization_outcomes', 367 'legitimization_processes', 368 'kyc_alerts', 369 'kyc_attributes', 370 'kyc_events', 371 'kyc_targets', 372 'kycauths_in', 373 'misc', 374 'partners', 375 'prewire', 376 'profit_drains', 377 'recoup', 378 'refunds', 379 'recoup_refresh', 380 'refresh', 381 'replication', 382 'reserves', 383 'purse_decision', 384 'purse_deletion', 385 'purse_deposits', 386 'purse_merges', 387 'purse_requests', 388 'reserve_history', 389 'reserves_close', 390 'reserves_in', 391 'reserves_open_deposits', 392 'reserves_open_requests', 393 'revolving_work_shards', 394 'signkey_revocations', 395 'wire_accounts', 396 'withdraw', 397 'wire_fee', 398 'wire_out', 399 'work_shards', 400 ] 401 402 foreach t : exchangedb_table_tests 403 test_bin = executable( 404 'test_' + t, 405 ['test_' + t + '.c', 'test_common.c'], 406 install_rpath: rpath_option, 407 dependencies: [ 408 libtalerexchangedb_dep, 409 libtalerkyclogic_dep, 410 libtalerutil_dep, 411 libtalerjson_dep, 412 libtalerpq_dep, 413 gnunetutil_dep, 414 gnunetjson_dep, 415 gnunetpq_dep, 416 pq_dep, 417 json_dep, 418 ], 419 include_directories: [incdir, configuration_inc], 420 install: false, 421 ) 422 test( 423 'test_' + t, 424 test_table_sh, 425 args: ['test_' + t], 426 workdir: meson.current_build_dir(), 427 suite: ['exchangedb'], 428 depends: [test_bin, exchangedb_sql_targets], 429 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 430 is_parallel: false, 431 timeout: 300, 432 ) 433 endforeach 434 435 executable( 436 'bench-db-postgres', 437 ['bench_db.c'], 438 install_rpath: rpath_option, 439 dependencies: [ 440 libtalerpq_dep, 441 libtalerutil_dep, 442 gnunetpq_dep, 443 gnunetutil_dep, 444 pq_dep, 445 ], 446 include_directories: [incdir, configuration_inc], 447 install: false, 448 )