|
54 | 54 | context 'when there is lvm support' do |
55 | 55 | context 'when there are no vgs' do |
56 | 56 | it 'is set to 0' do |
57 | | - Facter::Core::Execution.stubs(:execute) # All other calls |
58 | | - Facter::Core::Execution.expects(:execute).at_least(1).with('vgs -o name --noheadings 2>/dev/null', timeout: 30).returns(nil) |
59 | 57 | Facter.fact(:lvm_support).expects(:value).at_least(1).returns(true) |
60 | | - Facter.value(:lvm_vgs).should == 0 |
61 | | - end |
62 | | - end |
63 | | - |
64 | | - context 'when there are vgs' do |
65 | | - it 'lists vgs' do |
66 | 58 | Facter::Core::Execution.stubs(:execute) # All other calls |
67 | | - Facter::Core::Execution.expects(:execute).at_least(1).with('vgs -o name --noheadings 2>/dev/null', timeout: 30).returns(" vg0\n vg1") |
68 | | - Facter::Core::Execution.expects(:execute).at_least(1).with('vgs -o pv_name vg0 2>/dev/null', timeout: 30).returns(" PV\n /dev/pv3\n /dev/pv2") |
69 | | - Facter::Core::Execution.expects(:execute).at_least(1).with('vgs -o pv_name vg1 2>/dev/null', timeout: 30).returns(" PV\n /dev/pv0") |
70 | | - Facter.fact(:lvm_support).expects(:value).at_least(1).returns(true) |
71 | | - Facter.value(:lvm_vgs).should == 2 |
72 | | - Facter.value(:lvm_vg_0).should == 'vg0' |
73 | | - Facter.value(:lvm_vg_1).should == 'vg1' |
74 | | - Facter.value(:lvm_vg_vg0_pvs).should == '/dev/pv2,/dev/pv3' |
75 | | - Facter.value(:lvm_vg_vg1_pvs).should == '/dev/pv0' |
| 59 | + Facter::Core::Execution.expects(:execute).at_least(0).with('vgs -o name --noheadings 2>/dev/null', timeout: 30).returns(nil) |
| 60 | + Facter.value(:lvm_vgs).should == 0 |
76 | 61 | end |
77 | 62 | end |
78 | 63 | end |
|
95 | 80 | context 'when there are no pvs' do |
96 | 81 | it 'is set to 0' do |
97 | 82 | Facter::Core::Execution.stubs('execute') # All other calls |
98 | | - Facter::Core::Execution.expects('execute').at_least(1).with('pvs -o name --noheadings 2>/dev/null', timeout: 30).returns(nil) |
99 | 83 | Facter.fact(:lvm_support).expects(:value).at_least(1).returns(true) |
| 84 | + Facter::Core::Execution.expects('execute').at_least(0).with('pvs -o name --noheadings 2>/dev/null', timeout: 30).returns(nil) |
100 | 85 | Facter.value(:lvm_pvs).should == 0 |
101 | 86 | end |
102 | 87 | end |
103 | | - |
104 | | - context 'when there are pvs' do |
105 | | - it 'lists pvs' do |
106 | | - Facter::Core::Execution.stubs('execute') # All other calls |
107 | | - Facter::Core::Execution.expects('execute').at_least(1).with('pvs -o name --noheadings 2>/dev/null', timeout: 30).returns(" pv0\n pv1") |
108 | | - Facter.fact(:lvm_support).expects(:value).at_least(1).returns(true) |
109 | | - Facter.value(:lvm_pvs).should == 2 |
110 | | - Facter.value(:lvm_pv_0).should == 'pv0' |
111 | | - Facter.value(:lvm_pv_1).should == 'pv1' |
112 | | - end |
113 | | - end |
114 | 88 | end |
115 | 89 | end |
0 commit comments