Skip to content

Commit 4436969

Browse files
committed
test: test luks encryption key
The storage_test_volume.encryption_key comes from the same variable that is used to write the key to the crypttab - so change the test to test against the original value passed in to the role. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
1 parent bfef923 commit 4436969

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/test-verify-volume-encryption.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@
110110
map('regex_search', '^' + storage_test_volume._device |
111111
basename + ' .*$') |
112112
select('string') | list }}"
113-
_storage_test_expected_crypttab_key_file: "{{
114-
storage_test_volume.encryption_key or '-' }}"
113+
_storage_test_expected_crypttab_key_file: "{{ __test_encryption_key |
114+
d(storage_test_volume.encryption_key or '-') }}"
115115

116116
- name: Check for /etc/crypttab entry
117117
assert:

tests/tests_luks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@
344344

345345
- name: Verify role results - 6
346346
include_tasks: verify-role-results.yml
347+
vars:
348+
__test_encryption_key: "{{ storage_test_key_file.path }}"
349+
347350
always:
348351
- name: Remove the key file
349352
file:

0 commit comments

Comments
 (0)