Skip to content

Commit a66aaa8

Browse files
committed
Add a further test for #244
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)
1 parent 69ab182 commit a66aaa8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/unit/puppet/provider/logical_volume/lvm_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
@provider.class.stubs(:lvs).with('vg_jenkins').returns(lvs_output)
4242
expect(@provider.exists?).to be_nil
4343
end
44+
it "returns 'nil', lv 'swap' in vg 'VolGroup' exists" do
45+
@resource.expects(:[]).with(:name).returns('swap')
46+
@resource.expects(:[]).with(:volume_group).returns('VolGroup').at_least_once
47+
@provider.class.stubs(:lvs).with('VolGroup').returns(lvs_output)
48+
expect(@provider.exists?).to be_nil
49+
end
4450
it "returns 'nil', lv 'data' in vg 'myvg' does not exist" do
4551
@resource.expects(:[]).with(:volume_group).returns('myvg').at_least_once
4652
@provider.class.stubs(:lvs).with('myvg').raises(Puppet::ExecutionFailure, 'Execution of \'/sbin/lvs myvg\' returned 5')

0 commit comments

Comments
 (0)