Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/luks/tests/bind-luks2-ext-token
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ if ! luks2_supported; then
skip_test "${TEST}: LUKS2 is not supported."
fi

if ! luks2_existing_token_id_supported; then
if ! luks2_existing_token_id_supported; then
skip_test "${TEST}: Existing token ID not supported"
fi

if ! keyctl session - /bin/true >/dev/null 2>&1; then
skip_test "${TEST}: Session keyring is not usable (running in a container?)"
fi

trap 'on_exit' EXIT
trap 'exit' ERR

Expand Down
10 changes: 2 additions & 8 deletions src/luks/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ cryptsetup = find_program('cryptsetup', required: true)
# Use keyctl to check an existing token id can be created from
# kernel keyring password
keyutils = find_program('keyctl', required: false)
keyutils_usable = false
if keyutils.found()
keyutils_usable = run_command(keyutils, 'session', '-', '/bin/true', capture: false, check: false).returncode() == 0
if keyutils_usable
message('keyutils installed')
else
warning('keyutils installed, but running fails (are you inside Docker?), unable to test existing token id binding')
endif
message('keyutils installed')
else
warning('keyutils not installed, unable to test existing token id binding')
endif
Expand Down Expand Up @@ -93,7 +87,7 @@ if luksmeta_data.get('OLD_CRYPTSETUP') == '0'
test('unbind-unbound-slot-luks2', find_program('unbind-unbound-slot-luks2'), env: env)
test('unbind-luks2', find_program('unbind-luks2'), env: env, timeout: 60)

if keyutils.found() and keyutils_usable and luksmeta_data.get('OLD_CRYPTSETUP_EXISTING_TOKEN_ID') == '0'
if keyutils.found() and luksmeta_data.get('OLD_CRYPTSETUP_EXISTING_TOKEN_ID') == '0'
test('bind-luks2-ext-token', find_program('bind-luks2-ext-token'), env: env, timeout: 60)
endif

Expand Down
Loading