meson.build (13358B)
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_coin.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_info.c', 96 'get_denomination_revocation.c', 97 'get_profit_drain.c', 98 'iterate_expired_reserves.c', 99 'get_global_fee.c', 100 'iterate_global_fees.c', 101 'get_known_coin.c', 102 'get_kyc_rules.c', 103 'get_old_coin_by_h_blind.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_by_h_planchets.c', 111 'get_reserve_history.c', 112 'get_signature_for_known_coin.c', 113 'iterate_unfinished_close_requests.c', 114 'iterate_wire_accounts.c', 115 'get_wire_fee.c', 116 'iterate_wire_fees.c', 117 'get_wire_hash_for_contract.c', 118 'get_withdraw.c', 119 'get_exists_deposit.c', 120 'inject_auditor_triggers.c', 121 'insert_active_legitimization_measure.c', 122 'insert_aml_decision.c', 123 'insert_aml_officer.c', 124 'insert_aml_program_failure.c', 125 'insert_auditor.c', 126 'insert_auditor_denom_sig.c', 127 'insert_close_request.c', 128 'insert_contract.c', 129 'insert_denomination_info.c', 130 'insert_denomination_revocation.c', 131 'insert_profit_drain.c', 132 'insert_global_fee.c', 133 'insert_kyc_failure.c', 134 'insert_legitimization_process.c', 135 'insert_partner.c', 136 'insert_purse_request.c', 137 'insert_records_by_table.c', 138 'insert_refund.c', 139 'insert_reserve_closed.c', 140 'insert_reserve_open_deposit.c', 141 'insert_sanction_list_hit.c', 142 'insert_signkey_revocation.c', 143 'insert_successor_measure.c', 144 'insert_wire.c', 145 'insert_wire_fee.c', 146 'iterate_active_auditors.c', 147 'iterate_active_signkeys.c', 148 'iterate_auditor_denominations.c', 149 'iterate_denomination_info.c', 150 'iterate_denominations.c', 151 'iterate_kyc_references.c', 152 'iterate_reserve_close_info.c', 153 'get_kyc_provider_account.c', 154 'get_active_legitimization.c', 155 'get_aml_file_number.c', 156 'iterate_aml_history.c', 157 'iterate_aml_history_above_serial_id.c', 158 'iterate_aml_staff_above_serial_id.c', 159 'iterate_legitimization_outcomes_above_serial_id.c', 160 'get_aml_officer.c', 161 'get_auditor_status.c', 162 'get_auditor_timestamp.c', 163 'get_completed_legitimization.c', 164 'get_denomination_meta.c', 165 'get_global_fee_by_time.c', 166 'get_h_payto_by_access_token.c', 167 'iterate_kyc_history.c', 168 'get_legitimization_process_by_account.c', 169 'get_legitimization_requirement_by_row.c', 170 'get_kyc_status_by_token.c', 171 'get_pending_legitimization.c', 172 'iterate_records_by_table.c', 173 'get_rules_by_access_token.c', 174 'get_serial_by_table.c', 175 'get_signkey.c', 176 'get_signkey_revocation.c', 177 'get_transfer_by_deposit.c', 178 'get_wire_fee_by_time.c', 179 'get_wire_timestamp.c', 180 'iterate_wire_transfers.c', 181 'update_to_refresh_revealed.c', 182 'do_insert_kyc_attributes.c', 183 'preflight.c', 184 'get_pending_profit_drain.c', 185 'update_to_profit_drain_finished.c', 186 'release_revolving_shard.c', 187 'get_reserve.c', 188 'get_reserve_origin.c', 189 'do_import_credits.c', 190 'update_reserve.c', 191 'rollback.c', 192 'iterate_account_merges_above_serial_id.c', 193 'iterate_aggregation_amounts_for_kyc_check.c', 194 'iterate_aggregation_wtids_above_serial_id.c', 195 'iterate_aggregations_above_serial_id.c', 196 'get_aggregation_deferral_by_wtid.c', 197 'get_aggregation_transient.c', 198 'get_aggregation_transient_by_wtid.c', 199 'get_open_legitimization_measure.c', 200 'get_pending_aggregation.c', 201 'iterate_all_kyc_attributes.c', 202 'iterate_all_purse_decisions_above_serial_id.c', 203 'iterate_all_purse_deletions_above_serial_id.c', 204 'iterate_aml_attributes.c', 205 'iterate_aml_decisions.c', 206 'iterate_aml_measures.c', 207 'iterate_aml_statistics.c', 208 'get_auditor_denom_sig.c', 209 'iterate_batch_deposits_missing_wire.c', 210 'iterate_coin_deposits_above_serial_id.c', 211 'get_contract_by_purse.c', 212 'get_contract.c', 213 'iterate_deposit_amounts_for_kyc_check.c', 214 'iterate_exchange_credit_transfers.c', 215 'iterate_exchange_debit_transfers.c', 216 'iterate_exchange_kycauth_transfers.c', 217 'iterate_kyc_accounts.c', 218 'iterate_kyc_attributes.c', 219 'iterate_kycauth_in_above_serial_id_by_account.c', 220 'iterate_merge_amounts_for_kyc_check.c', 221 'get_purse_by_merge_pub.c', 222 'get_purse.c', 223 'iterate_purse_decisions_above_serial_id.c', 224 'iterate_purse_deposits_above_serial_id.c', 225 'iterate_purse_deposits_by_purse.c', 226 'get_purse_merge.c', 227 'iterate_purse_merges_above_serial_id.c', 228 'iterate_purse_requests_above_serial_id.c', 229 'iterate_recoups_above_serial_id.c', 230 'iterate_recoup_refreshes_above_serial_id.c', 231 'iterate_refreshes_above_serial_id.c', 232 'iterate_refunds_above_serial_id.c', 233 'iterate_refunds_by_coin.c', 234 'iterate_reserve_closed_above_serial_id.c', 235 'get_reserve_close_info.c', 236 'get_reserve_close_request_info.c', 237 'iterate_reserve_open_above_serial_id.c', 238 'iterate_reserves_in_above_serial_id_by_account.c', 239 'iterate_reserves_in_above_serial_id.c', 240 'iterate_wallet_merges.c', 241 'iterate_wire_outs_above_serial_id_by_account.c', 242 'iterate_wire_outs_above_serial_id.c', 243 'iterate_withdrawals_above_serial_id.c', 244 'iterate_withdraw_amounts_for_kyc_check.c', 245 'update_to_aml_locked.c', 246 'start.c', 247 'start_deferred_wire_out.c', 248 'start_read_committed.c', 249 'start_read_only.c', 250 'insert_wire_out.c', 251 'template.c', 252 'get_exists_aml_officer.c', 253 'do_trigger_kyc_rule_for_account.c', 254 'update_aggregation_transient.c', 255 'update_auditor.c', 256 'update_legitimization_process_by_row.c', 257 'update_wire.c', 258 'iterate_prewires.c', 259 'insert_prewire.c', 260 'update_to_prewire_failed.c', 261 'update_to_prewire_finished.c', 262 'begin_rule_update.c', 263 ], 264 soversion: solibversions['libtalerexchangedb']['soversion'], 265 version: solibversions['libtalerexchangedb']['soversion'], 266 install_rpath: rpath_option, 267 dependencies: [ 268 libtalerbank_dep, 269 libtalerkyclogic_dep, 270 libtalerpq_dep, 271 libtalerjson_dep, 272 libtalerutil_dep, 273 gnunetpq_dep, 274 gnunetjson_dep, 275 gnunetutil_dep, 276 json_dep, 277 curl_dep, 278 pq_dep, 279 ], 280 include_directories: [incdir, configuration_inc], 281 install: true, 282 install_dir: get_option('libdir'), 283 ) 284 285 libtalerexchangedb_dep = declare_dependency(link_with: libtalerexchangedb) 286 pkg.generate( 287 libtalerexchangedb, 288 url: 'https://taler.net', 289 description: 'GNU Taler exchange DB library', 290 ) 291 292 293 test_regressions = executable( 294 'test_regressions', 295 ['test_regressions.c'], 296 install_rpath: rpath_option, 297 dependencies: [ 298 libtalerexchangedb_dep, 299 libtalerutil_dep, 300 libtalerjson_dep, 301 libtalerpq_dep, 302 gnunetutil_dep, 303 gnunetjson_dep, 304 gnunetpq_dep, 305 pq_dep, 306 json_dep, 307 ], 308 include_directories: [incdir, configuration_inc], 309 install: false, 310 ) 311 312 test_regressions_sh = configure_file( 313 input: 'test_regressions.sh', 314 output: 'test_regressions.sh', 315 copy: true, 316 ) 317 318 test( 319 'test_regressions', 320 test_regressions_sh, 321 workdir: meson.current_build_dir(), 322 suite: ['exchangedb'], 323 depends: [test_regressions, exchangedb_sql_targets], 324 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 325 is_parallel: false, 326 timeout: 300, 327 ) 328 329 330 # One test binary per database table, each covering the exported functions 331 # whose primary test table it is. The '@brief' comment of every function in 332 # src/include/exchange-database/ names the table it belongs to. They all 333 # share test_common.c and the test_table.sh driver, which gives each of them 334 # a scratch database of its own. 335 336 test_table_sh = configure_file( 337 input: 'test_table.sh', 338 output: 'test_table.sh', 339 copy: true, 340 ) 341 342 exchangedb_table_tests = [ 343 'account_merges', 344 'aggregation_deferrals', 345 'aggregation_tracking', 346 'aggregation_transient', 347 'aml_history', 348 'aml_staff', 349 'auditor_denom_sigs', 350 'auditors', 351 'batch_deposits', 352 'close_requests', 353 'coin_deposits', 354 'coin_history', 355 'contracts', 356 'denomination_revocations', 357 'denominations', 358 'exchange_sign_keys', 359 'global_fee', 360 'known_coins', 361 'legitimization_measures', 362 'legitimization_outcomes', 363 'legitimization_processes', 364 'kyc_alerts', 365 'kyc_attributes', 366 'kyc_events', 367 'kyc_targets', 368 'kycauths_in', 369 'misc', 370 'partners', 371 'prewire', 372 'profit_drains', 373 'recoup', 374 'refunds', 375 'recoup_refresh', 376 'refresh', 377 'replication', 378 'reserves', 379 'purse_decision', 380 'purse_deletion', 381 'purse_deposits', 382 'purse_merges', 383 'purse_requests', 384 'reserve_history', 385 'reserves_close', 386 'reserves_in', 387 'reserves_open_deposits', 388 'reserves_open_requests', 389 'revolving_work_shards', 390 'signkey_revocations', 391 'wire_accounts', 392 'withdraw', 393 'wire_fee', 394 'wire_out', 395 'work_shards', 396 ] 397 398 foreach t : exchangedb_table_tests 399 test_bin = executable( 400 'test_' + t, 401 ['test_' + t + '.c', 'test_common.c'], 402 install_rpath: rpath_option, 403 dependencies: [ 404 libtalerexchangedb_dep, 405 libtalerkyclogic_dep, 406 libtalerutil_dep, 407 libtalerjson_dep, 408 libtalerpq_dep, 409 gnunetutil_dep, 410 gnunetjson_dep, 411 gnunetpq_dep, 412 pq_dep, 413 json_dep, 414 ], 415 include_directories: [incdir, configuration_inc], 416 install: false, 417 ) 418 test( 419 'test_' + t, 420 test_table_sh, 421 args: ['test_' + t], 422 workdir: meson.current_build_dir(), 423 suite: ['exchangedb'], 424 depends: [test_bin, exchangedb_sql_targets], 425 env: {'TALER_BUILD_ROOT': meson.project_build_root()}, 426 is_parallel: false, 427 timeout: 300, 428 ) 429 endforeach 430 431 executable( 432 'bench-db-postgres', 433 ['bench_db.c'], 434 install_rpath: rpath_option, 435 dependencies: [ 436 libtalerpq_dep, 437 libtalerutil_dep, 438 gnunetpq_dep, 439 gnunetutil_dep, 440 pq_dep, 441 ], 442 include_directories: [incdir, configuration_inc], 443 install: false, 444 )