Skip to content

Commit

Permalink
test: add test for LUKS version 2
Browse files Browse the repository at this point in the history
This fixes #495

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Dec 11, 2024
1 parent 2c3b47e commit 5eddd86
Show file tree
Hide file tree
Showing 5 changed files with 592 additions and 8 deletions.
15 changes: 11 additions & 4 deletions tests/test-verify-volume-encryption.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@
that: luks_dump.stdout is search(__pattern, multiline=True)
msg: Wrong key size for volume {{ storage_test_volume.name }}
vars:
__pattern: >-
^MK bits:\s+{{ storage_test_volume.encryption_key_size }}$
__key_size: "{{ storage_test_volume.encryption_key_size | string }}"
__pattern: "{{
'^MK bits:\\s+' ~ __key_size ~ '$'
if storage_test_volume.encryption_luks_version | d('luks1') == 'luks1'
else '^\\s+Key:\\s+' ~ __key_size ~ ' bits$' }}"
when:
- _storage_test_volume_present
- storage_test_volume.encryption
Expand All @@ -84,8 +87,12 @@
msg: Wrong cipher for volume {{ storage_test_volume.name }}
vars:
__cipher: "{{ storage_test_volume.encryption_cipher.split('-')[1:] |
join('-') }}"
__pattern: "^Cipher mode:\\s+{{ __cipher }}$"
join('-')
if storage_test_volume.encryption_luks_version | d('luks1') == 'luks1'
else storage_test_volume.encryption_cipher }}"
__pattern: "{{ '^Cipher mode:\\s+' ~ __cipher ~ '$'
if storage_test_volume.encryption_luks_version | d('luks1') == 'luks1'
else '^\\s+Cipher:\\s+' ~ __cipher ~ '$' }}"
when:
- _storage_test_volume_present
- storage_test_volume.encryption
Expand Down
Loading

0 comments on commit 5eddd86

Please sign in to comment.