diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-11-11 11:14:02 -0800 |
|---|---|---|
| committer | Jesse Wolfe <jes5199@gmail.com> | 2010-11-11 11:23:20 -0800 |
| commit | 6f1416d7a4cec92ccff64d904d5fe799b8ff9a85 (patch) | |
| tree | 7163d09c170c5d96072ac1540c6f2280c642de86 /spec | |
| parent | 3228a279c6df183309bfa89fb0d890360f6ff697 (diff) | |
Fix #4904 Mounts shouldn't remount unless they are ensure=>mounted
After we fixed issue #2730, it is now possible to manage an fstab entry
without asking puppet to try to call mount or unmount on that device.
That fix failed to address the "refresh" behavior of mounts.
We have changed "refresh" to only remount devices that are set to
"mounted", so users can truly manage fstab entries without having
puppet try to remount them.
Paired-With: Paul Berry <paul@puppetlabs.com>
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/type/mount_spec.rb | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/spec/unit/type/mount_spec.rb b/spec/unit/type/mount_spec.rb index ce82cb516..4aa9baf70 100755 --- a/spec/unit/type/mount_spec.rb +++ b/spec/unit/type/mount_spec.rb @@ -203,23 +203,45 @@ describe Puppet::Type.type(:mount)::Ensure do end end - describe Puppet::Type.type(:mount), "when responding to events" do + describe Puppet::Type.type(:mount), "when responding to refresh" do - it "should remount if it is currently mounted" do - @provider.expects(:mounted?).returns(true) + it "should remount if it is supposed to be mounted" do + @mount[:ensure] = "mounted" @provider.expects(:remount) @mount.refresh end - it "should not remount if it is not currently mounted" do - @provider.expects(:mounted?).returns(false) + it "should not remount if it is supposed to be present" do + @mount[:ensure] = "present" + @provider.expects(:remount).never + + @mount.refresh + end + + it "should not remount if it is supposed to be absent" do + @mount[:ensure] = "absent" + @provider.expects(:remount).never + + @mount.refresh + end + + it "should not remount if it is supposed to be defined" do + @mount[:ensure] = "defined" + @provider.expects(:remount).never + + @mount.refresh + end + + it "should not remount if it is supposed to be unmounted" do + @mount[:ensure] = "unmounted" @provider.expects(:remount).never @mount.refresh end it "should not remount swap filesystems" do + @mount[:ensure] = "mounted" @mount[:fstype] = "swap" @provider.expects(:remount).never |
