-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: Add a verity_cleanup function to test helpers.bash #565
fix: Add a verity_cleanup function to test helpers.bash #565
Conversation
Do you have evidence or experience that this actually fixes the issue? Also, you should 'Fixes #541' in your commit message. |
Not yet, I didn't have a setup to run the CI locally (going to set that up now);
Sure, will add. |
6bc6245
to
d894e7f
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #565 +/- ##
==========================================
+ Coverage 53.01% 57.14% +4.12%
==========================================
Files 64 64
Lines 7505 7516 +11
==========================================
+ Hits 3979 4295 +316
+ Misses 2815 2479 -336
- Partials 711 742 +31 ☔ View full report in Codecov by Sentry. |
d894e7f
to
0332199
Compare
\o/ |
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.
thank you for digging on this. i just ran 'losetup -a' on my laptop and found:
$ losetup -a | grep stackertest |wc -l
33
But only 9 of those 33 had 'verity' .
there are several others.
$ losetup -a | sed -e '/stackertest/!d' -e 's,.*/stackertest-,,' -e 's,[.].*,,' | sort -u
test_bad_existing_verity_device_is_rejected
test_mount_-2b_umount_-2b_mount_a_tree_of_images_works
Do you know if this will also fix the 'mount a tree of images' ?
Here's what I know... In the bad image test, we use the busybox image, create a new top layer Normally, when we call Thinking about it now, it looks like we need to call umount internally if I'll look at doing that now. To why we see the failure, I've not yet found out precisely the order, but I I can't seem to reproduce that easily; I have previously, but not today it |
0332199
to
03a1d15
Compare
c710b10
to
f3643d3
Compare
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.
This does look great, but i have one more comment inline. I'm hope that I'm not wrong again and go 0-for-2 today on reading this PR.
The atomfs bad verity test case ends up leaving verity and loop devices which then break other test cases. The root cause is that when the test case attempts to mount the invalid atomfs the underlying atom was already mounted. Once the verity fails, stacker exits but does not remove any previously mounted at atoms in the molecule. Fix this by creating a cleanup function which runs if we fail to mount an atom. - Add a check to the atomfs.bats which checks for leftover loop mounts Fixes: project-stacker#541 Signed-off-by: Ryan Harper <[email protected]>
f3643d3
to
489cfec
Compare
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.
this looks good. thanks.
Add a cleanup function to unmount underlying atoms if one of the mount fails.
What type of PR is this?
bug
Which issue does this PR fix:
#541
What does this PR do / Why do we need it:
Add a cleanup function which tracks the successfully mounted atoms, and if one
fails, then it will unmount the successful atoms before returning the error.
If an issue # is not available please add repro steps and logs showing the issue:
Testing done on this change:
make check locally.
Automation added to e2e:
Will this break upgrades or downgrades?
Does this PR introduce any user-facing change?:
no
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.