-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test fixes for lvm #53
Closed
pcahyna
wants to merge
29
commits into
linux-system-roles:master
from
pcahyna:non-destructive-test-lvm
Closed
Test fixes for lvm #53
pcahyna
wants to merge
29
commits into
linux-system-roles:master
from
pcahyna:non-destructive-test-lvm
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A type of None means no formatting. An exception is when there is a blkid-reported type that blivet doesn't have special handling for, in which case type will be None but the name attribute will reflect the type reported by blkid. In this special case we treat the formatting as though it had a non-None type.
While both before and after it should trigger an error in the role, and therefore both are valid tests, a valid array with a nonexistent disk is more likely to be what was intended, and therefore preferable. (The former variant actually checked for bad syntax, not for handling of nonexistent disks.)
The latter would be a valid test as well, but a less important one, and currently it does not work properly. Do not use ignore_errors: yes on the test block, it makes all assert pointless. Use a rescue task instead.
- this makes all test asserts pointless. Instead catch the error using rescue. Actually verify that data heve not been destroyed.
and check for errors properly. Verify again that data have not been lost. Do not use a pool type of partition, seems to be unimplemented. Create one volume in the pool, the role does not cope with empty pools. Note that even with those changes the role application fails - apparently it refuses to create a VG when there is already a filesystem, even with safe mode off.
It seems that the "get required packages" task (invocation of blivet with packages_only: true) silently (without even reporting changed: true) changes mounts. Add an assert for that. (It would be better to make it a separate unit test.)
Otherwise super() fails. Not necessary with Python 3, but necessary with Python 2 (where classic classes are the default)
Remove ignore_errors in non-safe-mode tests and instead catch errors. Comment out the currently broken tests.
dwlehman
approved these changes
Oct 22, 2019
dwlehman
approved these changes
Oct 22, 2019
dwlehman
reviewed
Oct 22, 2019
tests/tests_lvm_errors.yml
Outdated
# - name: Verify the output | ||
# assert: | ||
# that: "{{ not blivet_output.failed and blivet_output.changed }}" | ||
# msg: "Unexpected behavior w/ existing data on specified disks" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you just apply when: false
to the whole block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
dwlehman
approved these changes
Oct 22, 2019
Do not use ignore_errors, catch the error instead.
at all currently.
True should be the default.
pcahyna
force-pushed
the
non-destructive-test-lvm
branch
from
October 22, 2019 16:46
91fbebd
to
901dfd8
Compare
Added to #43. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Analogy of PR #46 but for the LVM test that I missed initially.