-
Notifications
You must be signed in to change notification settings - Fork 275
Make lv that is a substring of a vg work #244
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
Conversation
Prior to this commit a logical volume that was a substring of the name of a volume group could not be created due to a false positive by the `exists?` method of the provider. The sample output of `lvs` in the spec tests was updated to this: ``` LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv_root VolGroup -wi-ao---- 18.54g lv_swap VolGroup -wi-ao---- 992.00m data data -wi-ao---- 992.00m j1 vg_jenkins -wi-a----- 1.00g ``` After adding a test to verify that a logical volume named `jenkins` does not exist the original `exists?` check failed like so: ``` Puppet::Type::Logical_volume::ProviderLvm self.instances returns an array of logical volumes when checking existence returns 'true', lv 'data' in vg 'data' exists returns 'nil', lv 'jenkins' in vg 'vg_jenkins' exists (FAILED - 5) returns 'nil', lv 'data' in vg 'myvg' does not exist ``` After updating the `exists?` method to instead use `lvs_pattern` the new tests passes: ``` Puppet::Type::Logical_volume::ProviderLvm self.instances returns an array of logical volumes when checking existence returns 'true', lv 'data' in vg 'data' exists returns 'nil', lv 'jenkins' in vg 'vg_jenkins' exists returns 'nil', lv 'data' in vg 'myvg' does not exist ``` Co-authored-by: Ruediger Pluem <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #244 +/- ##
==========================================
+ Coverage 72.7% 72.83% +0.12%
==========================================
Files 17 17
Lines 773 773
==========================================
+ Hits 562 563 +1
+ Misses 211 210 -1
Continue to review full report at Codecov.
|
@genebean Could you please confirm if the following changes are causing new failures (facter-related tests)on master branch and this branch or are they existing failures. " In local testing all tests related to this PR pass while some facter-related tests failed on this branch and on master." |
The same errors are present without these changes. You can confirm by cloning, checking out master, and running Sent with GitHawk |
I have tested this using pdk and using plain bundle rake and I can confirm that all tests run. |
@genebean @vStone Executed pdk test unit locally on this branch and master branch both gave failures on the following tests. |
Anything I can provide to move this forward? |
Thanks everyone for your contributions! |
@rpluem Regarding the test, I'd suggest a new PR that just adds that. |
Test that exists returns nil if the name of the logical volume is a substring of the name of an existing logical volume. (cherry picked from commit d64c11d)
I’m going to try and do the release when I go in today. I had some tooling problems on my laptop that kept me from doing it Friday or yesterday that should be resolved now. Sent with GitHawk |
Test that exists returns nil if the name of the logical volume is a substring of the name of an existing logical volume. (cherry picked from commit d64c11d)
This PR builds on #230. In local testing all tests related to this PR pass while some facter-related tests failed on this branch and on master.
Prior to this commit a logical volume that was a substring of the name of a volume group could not be created due to a false positive by the
exists?
method of the provider.The sample output of
lvs
in the spec tests was updated to this:After adding a test to verify that a logical volume named
jenkins
does not exist the originalexists?
check failed like so:After updating the
exists?
method to instead uselvs_pattern
the new tests passes:Co-authored-by: Ruediger Pluem [email protected]