meson.build (13422B)
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_all_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 'start.c', 246 'start_deferred_wire_out.c', 247 'start_read_committed.c', 248 'start_read_only.c', 249 'insert_wire_out.c', 250 'template.c', 251 'get_exists_aml_officer.c', 252 'do_trigger_kyc_rule_for_account.c', 253 'do_reserve_legitimization_process.c', 254 'update_legitimization_process_start.c', 255 'update_aggregation_transient.c', 256 'update_auditor.c', 257 'update_legitimization_process_by_row.c', 258 'update_wire.c', 259 'iterate_prewires.c', 260 'insert_prewire.c', 261 'update_to_prewire_failed.c', 262 'update_to_prewire_finished.c', 263 'begin_rule_update.c', 264 ], 265 soversion: solibversions['libtalerexchangedb']['soversion'], 266 version: solibversions['libtalerexchangedb']['soversion'], 267 install_rpath: rpath_option, 268 dependencies: [ 269 libtalerbank_dep, 270 libtalerkyclogic_dep, 271 libtalerpq_dep, 272 libtalerjson_dep, 273 libtalerutil_dep, 274 gnunetpq_dep, 275 gnunetjson_dep, 276 gnunetutil_dep, 277 json_dep, 278 curl_dep, 279 pq_dep, 280 ], 281 include_directories: [incdir, configuration_inc], 282 install: true, 283 install_dir: get_option('libdir'), 284 ) 285 286 libtalerexchangedb_dep = declare_dependency(link_with: libtalerexchangedb) 287 pkg.generate( 288 libtalerexchangedb, 289 url: 'https://taler.net', 290 description: 'GNU Taler exchange DB library', 291 ) 292 293 294 test_regressions = executable( 295 'test_regressions', 296 ['test_regressions.c'], 297 install_rpath: rpath_option, 298 dependencies: [ 299 libtalerexchangedb_dep, 300 libtalerutil_dep, 301 libtalerjson_dep, 302 libtalerpq_dep, 303 gnunetutil_dep, 304 gnunetjson_dep, 305 gnunetpq_dep, 306 pq_dep, 307 json_dep, 308 ], 309 include_directories: [incdir, configuration_inc], 310 install: false, 311 ) 312 313 test_regressions_sh = configure_file( 314 input: 'test_regressions.sh', 315 output: 'test_regressions.sh', 316 copy: true, 317 ) 318 319 test( 320 'test_regressions', 321 test_regressions_sh, 322 workdir: meson.current_build_dir(), 323 suite: ['exchangedb'], 324 depends: [test_regressions, exchangedb_sql_targets], 325 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 326 is_parallel: false, 327 timeout: 300, 328 ) 329 330 331 # One test binary per database table, each covering the exported functions 332 # whose primary test table it is. The '@brief' comment of every function in 333 # src/include/exchange-database/ names the table it belongs to. They all 334 # share test_common.c and the test_table.sh driver, which gives each of them 335 # a scratch database of its own. 336 337 test_table_sh = configure_file( 338 input: 'test_table.sh', 339 output: 'test_table.sh', 340 copy: true, 341 ) 342 343 exchangedb_table_tests = [ 344 'account_merges', 345 'aggregation_deferrals', 346 'aggregation_tracking', 347 'aggregation_transient', 348 'aml_history', 349 'aml_staff', 350 'auditor_denom_sigs', 351 'auditors', 352 'batch_deposits', 353 'close_requests', 354 'coin_deposits', 355 'coin_history', 356 'contracts', 357 'denomination_revocations', 358 'denominations', 359 'exchange_sign_keys', 360 'global_fee', 361 'known_coins', 362 'legitimization_measures', 363 'legitimization_outcomes', 364 'legitimization_processes', 365 'kyc_alerts', 366 'kyc_attributes', 367 'kyc_events', 368 'kyc_targets', 369 'kycauths_in', 370 'misc', 371 'partners', 372 'prewire', 373 'profit_drains', 374 'recoup', 375 'refunds', 376 'recoup_refresh', 377 'refresh', 378 'replication', 379 'reserves', 380 'purse_decision', 381 'purse_deletion', 382 'purse_deposits', 383 'purse_merges', 384 'purse_requests', 385 'reserve_history', 386 'reserves_close', 387 'reserves_in', 388 'reserves_open_deposits', 389 'reserves_open_requests', 390 'revolving_work_shards', 391 'signkey_revocations', 392 'wire_accounts', 393 'withdraw', 394 'wire_fee', 395 'wire_out', 396 'work_shards', 397 ] 398 399 foreach t : exchangedb_table_tests 400 test_bin = executable( 401 'test_' + t, 402 ['test_' + t + '.c', 'test_common.c'], 403 install_rpath: rpath_option, 404 dependencies: [ 405 libtalerexchangedb_dep, 406 libtalerkyclogic_dep, 407 libtalerutil_dep, 408 libtalerjson_dep, 409 libtalerpq_dep, 410 gnunetutil_dep, 411 gnunetjson_dep, 412 gnunetpq_dep, 413 pq_dep, 414 json_dep, 415 ], 416 include_directories: [incdir, configuration_inc], 417 install: false, 418 ) 419 test( 420 'test_' + t, 421 test_table_sh, 422 args: ['test_' + t], 423 workdir: meson.current_build_dir(), 424 suite: ['exchangedb'], 425 depends: [test_bin, exchangedb_sql_targets], 426 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 427 is_parallel: false, 428 timeout: 300, 429 ) 430 endforeach 431 432 executable( 433 'bench-db-postgres', 434 ['bench_db.c'], 435 install_rpath: rpath_option, 436 dependencies: [ 437 libtalerpq_dep, 438 libtalerutil_dep, 439 gnunetpq_dep, 440 gnunetutil_dep, 441 pq_dep, 442 ], 443 include_directories: [incdir, configuration_inc], 444 install: false, 445 )