| 1 |
# Tests. |
| 2 |
env = environment() |
| 3 |
env.prepend('PATH', |
| 4 |
join_paths(meson.source_root(), 'src'), |
| 5 |
join_paths(meson.source_root(), 'src', 'luks'), |
| 6 |
join_paths(meson.source_root(), 'src', 'luks', 'tests'), |
| 7 |
join_paths(meson.source_root(), 'src', 'pins', 'sss'), |
| 8 |
join_paths(meson.source_root(), 'src', 'pins', 'tang'), |
| 9 |
join_paths(meson.source_root(), 'src', 'pins', 'tpm2'), |
| 10 |
join_paths(meson.source_root(), 'src', 'pins', 'tpm2', 'tests'), |
| 11 |
join_paths(meson.build_root(), 'src'), |
| 12 |
join_paths(meson.build_root(), 'src', 'luks'), |
| 13 |
join_paths(meson.build_root(), 'src', 'luks', 'tests'), |
| 14 |
join_paths(meson.build_root(), 'src', 'pins', 'sss'), |
| 15 |
join_paths(meson.build_root(), 'src', 'pins', 'tang'), |
| 16 |
join_paths(meson.build_root(), 'src', 'pins', 'tpm2'), |
| 17 |
join_paths(meson.build_root(), 'src', 'pins', 'tpm2', 'tests'), |
| 18 |
separator: ':' |
| 19 |
) |
| 20 |
|
| 21 |
tpm2_data = configuration_data() |
| 22 |
tpm2_data.merge_from(data) |
| 23 |
|
| 24 |
socat = find_program('socat', required: false) |
| 25 |
swtpm = find_program('swtpm', '/usr/bin/swtpm', required: false) |
| 26 |
swtpm_setup = find_program('swtpm_setup', '/usr/bin/swtpm_setup', required: false) |
| 27 |
|
| 28 |
tpm2_data.set('SOCAT_BIN', socat.found() ? socat.path() : '') |
| 29 |
tpm2_data.set('SWTPM_BIN', swtpm.found() ? swtpm.path() : '') |
| 30 |
tpm2_data.set('SWTPM_SETUP_BIN', swtpm_setup.found() ? swtpm_setup.path() : '') |
| 31 |
|
| 32 |
configure_file( |
| 33 |
input: 'tpm2-common-test-functions.in', |
| 34 |
output: 'tpm2-common-test-functions', |
| 35 |
configuration: tpm2_data, |
| 36 |
) |
| 37 |
|
| 38 |
test('pin-tpm2-hw', find_program('pin-tpm2-hw'), env: env, timeout: 120) |
| 39 |
test('pin-tpm2-sw', find_program('pin-tpm2-sw'), env: env, timeout: 120) |