-
Notifications
You must be signed in to change notification settings - Fork 77
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: 002-test-reject-disk-with-lvm-signature.sh #240
base: master
Are you sure you want to change the base?
Conversation
Right now when I run test
This PR fixes that problem. ping @rhvgoyal |
☔ The latest upstream changes (presumably 32ec977) made this pull request unmergeable. Please resolve the merge conflicts. |
@shishir-a412ed can you rebase this PR on top of latest tree. |
bfe4e40
to
3da37e0
Compare
@rhvgoyal PTAL. |
|
||
cleanup $vg_name "$devs" | ||
cleanup_pvs $devs |
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.
We should continue to call cleanup(), right? In case there is a bug in tool and it has done something with device and added it to volume group etc, we need to clean all that state.
So, IMO, we need to call both cleanup() and cleanup_pvs().
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.
For this particular test, we fail right away since there are signatures on the block device.
So ideally no volume group (VG) should exist. If I call both cleanup()
and cleanup_pvs()
.
- I will see same errors in the logs like
Cannot process volume group css-test-foo
since volume group is not present. - There will be duplication of code in
cleanup()
andcleanup_pvs()
e.g both are callingwipe_signatures
.
How I implemented was: cleanup_pvs()
is a condensed version of cleanup()
which is sufficient just for this test.
Shishir
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.
@shishir-a412ed What if code is buggy and it does not recognize the signature on disk and continues to create partition and add it to volume group?
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.
@rhvgoyal Then we have a much bigger problem than the test :)
Let me come to your desk.
return $test_status | ||
} | ||
|
||
cleanup_pvs() { |
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.
cleanup_pvs_sig()
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.
Fixed.
@shishir-a412ed Can you please take care of minor comments. |
3da37e0
to
60e30e3
Compare
@rhvgoyal PTAL. |
I think we can modify remove_pvs() to remove pvs both from partition and disk if pv exists. So we can implement a function pv_exists() and if pv exists, remove it. And then do this check both on partition as well device. Same thing we can do for volume group. check for vg_exists() and if volume group exists, remove it. That will get rid of error. |
0f306f0
to
206504a
Compare
@rhvgoyal PTAL. |
tests/libtest.sh
Outdated
@@ -50,6 +50,19 @@ vg_exists() { | |||
return 1 | |||
} | |||
|
|||
# Tests if the physical volume pv_name exists | |||
pv_exists() { |
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.
@shishir-a412ed I just implemented pv_exists() in libcss.sh. How about that implementation?
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.
Fixed.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
206504a
to
919d4da
Compare
@rhvgoyal PTAL. |
@rhvgoyal We should either close these pull requests or rework them or merge them. |
Signed-off-by: Shishir Mahajan shishir.mahajan@redhat.com