test: test luks encryption key#547
Conversation
Reviewer's GuideThis PR refactors the LUKS encryption verification tests to assert against the original key passed to the role and expands test coverage by auto-generating interface-specific playbooks for nvme and scsi scenarios. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @richm - I've reviewed your changes - here's some feedback:
- Consider consolidating the autogenerated per-interface test playbooks into a single parametric playbook (or loop over interfaces) to reduce duplication and maintenance overhead.
- Ensure that __test_encryption_key is explicitly defined (or defaults are handled) in every test that references it, so you don’t run into undefined-variable errors in other scenarios.
- Double-check that using '-' as the default for storage_test_volume.encryption_key matches the real crypttab behavior when no key is provided, and add a test case for the empty‐key path if needed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider consolidating the autogenerated per-interface test playbooks into a single parametric playbook (or loop over interfaces) to reduce duplication and maintenance overhead.
- Ensure that __test_encryption_key is explicitly defined (or defaults are handled) in every test that references it, so you don’t run into undefined-variable errors in other scenarios.
- Double-check that using '-' as the default for storage_test_volume.encryption_key matches the real crypttab behavior when no key is provided, and add a test case for the empty‐key path if needed.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #547 +/- ##
==========================================
- Coverage 16.54% 10.66% -5.89%
==========================================
Files 2 8 +6
Lines 284 1960 +1676
Branches 79 0 -79
==========================================
+ Hits 47 209 +162
- Misses 237 1751 +1514
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 <[email protected]>
|
This is the test for #546 |
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 [email protected]
Summary by Sourcery
Improve LUKS encryption tests to verify against the original key and expand coverage across disk interfaces
Tests: