|
134 | 134 | @provider.create |
135 | 135 | end |
136 | 136 | end |
| 137 | + context 'with named thinpool option' do |
| 138 | + it "should execute 'lvcreate' with '--virtualsize 1g' and '--thin myvg/mythinpool' options" do |
| 139 | + @resource.expects(:[]).with(:name).returns('mylv') |
| 140 | + @resource.expects(:[]).with(:volume_group).returns('myvg') |
| 141 | + @resource.expects(:[]).with(:size).returns('1g').at_least_once |
| 142 | + @resource.expects(:[]).with(:thinpool).returns('mythinpool').at_least_once |
| 143 | + @provider.expects(:lvcreate).with('-n', 'mylv', '--virtualsize', '1g', '--thin', 'myvg/mythinpool') |
| 144 | + @provider.create |
| 145 | + end |
| 146 | + end |
137 | 147 | end |
138 | 148 |
|
139 | 149 | describe "when modifying" do |
|
189 | 199 | expect { @provider.size = '1100000k' }.not_to raise_error(Puppet::ExecutionFailure, /blkid/) |
190 | 200 | end |
191 | 201 | end |
| 202 | + context "with defined thin pool" do |
| 203 | + it "should execute 'lvextend' as with normal volume" do |
| 204 | + @resource.expects(:[]).with(:name).returns('mylv').at_least_once |
| 205 | + @resource.expects(:[]).with(:volume_group).returns('myvg').at_least_once |
| 206 | + @resource.expects(:[]).with(:size).returns('1g').at_least_once |
| 207 | + @resource.expects(:[]).with(:thinpool).returns('mythinpool').at_least_once |
| 208 | + @provider.expects(:lvcreate).with('-n', 'mylv', '--virtualsize', '1g', '--thin', 'myvg/mythinpool') |
| 209 | + @provider.create |
| 210 | + @provider.expects(:lvs).with('--noheading', '--unit', 'g', '/dev/myvg/mylv').returns(' 1.00g').at_least_once |
| 211 | + @provider.expects(:lvs).with('--noheading', '-o', 'vg_extent_size', '--units', 'k', '/dev/myvg/mylv').returns(' 1000.00k') |
| 212 | + @provider.expects(:lvextend).with('-L', '2000000k', '/dev/myvg/mylv').returns(true) |
| 213 | + @provider.size = '2000000k' |
| 214 | + end |
| 215 | + end |
192 | 216 | end |
193 | 217 | context "not in extent portions" do |
194 | 218 | it "should raise an exception" do |
|
0 commit comments