diff options
author | Bryan McLellan <btm@loftninjas.org> | 2016-03-31 20:43:50 -0400 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2016-03-31 20:43:50 -0400 |
commit | 2f1357e682eb12dd3b3ac797707b3cb7c320a7b4 (patch) | |
tree | 1fb1cbf202770b20610db00d7903a7cf2c7523ef /spec/unit | |
parent | b57dbc4bf35a00edbd4cf016dd4ec97fa46553e2 (diff) | |
parent | c8f525400113b5df7b2100e2cec52df75d084121 (diff) | |
download | chef-2f1357e682eb12dd3b3ac797707b3cb7c320a7b4.tar.gz |
Merge pull request #4775 from chef/cd/mount-remount-options
Revert PR #1796: make mount resource options-ignorant again.
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/provider/mount/aix_spec.rb | 3 | ||||
-rw-r--r-- | spec/unit/provider/mount/mount_spec.rb | 6 | ||||
-rw-r--r-- | spec/unit/provider/mount/windows_spec.rb | 14 | ||||
-rw-r--r-- | spec/unit/provider/mount_spec.rb | 19 |
4 files changed, 1 insertions, 41 deletions
diff --git a/spec/unit/provider/mount/aix_spec.rb b/spec/unit/provider/mount/aix_spec.rb index 9a34a6d21d..3371c270c5 100644 --- a/spec/unit/provider/mount/aix_spec.rb +++ b/spec/unit/provider/mount/aix_spec.rb @@ -126,10 +126,9 @@ ENABLED @provider.run_action(:mount) end - it "should not mount resource if it is already mounted and the options have not changed" do + it "should not mount resource if it is already mounted" do stub_mounted_enabled(@provider, @mounted_output, "") - allow(@provider).to receive(:mount_options_unchanged?).and_return(true) expect(@provider).not_to receive(:mount_fs) @provider.run_action(:mount) diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb index 52be15b2a8..42585d9e3e 100644 --- a/spec/unit/provider/mount/mount_spec.rb +++ b/spec/unit/provider/mount/mount_spec.rb @@ -323,12 +323,6 @@ describe Chef::Provider::Mount::Mount do @provider.mount_fs() end - it "should not mount the filesystem if it is mounted and the options have not changed" do - allow(@current_resource).to receive(:mounted).and_return(true) - expect(@provider).to_not receive(:shell_out!) - @provider.mount_fs() - end - end describe "umount_fs" do diff --git a/spec/unit/provider/mount/windows_spec.rb b/spec/unit/provider/mount/windows_spec.rb index ec1945de50..fdb44836b5 100644 --- a/spec/unit/provider/mount/windows_spec.rb +++ b/spec/unit/provider/mount/windows_spec.rb @@ -112,14 +112,6 @@ describe Chef::Provider::Mount::Windows do @provider.mount_fs end - it "should remount the filesystem if it is mounted and the options have changed" do - expect(@vol).to receive(:add).with(:remote => @new_resource.device, - :username => @new_resource.username, - :domainname => @new_resource.domain, - :password => @new_resource.password) - @provider.mount_fs - end - context "mount_options_unchanged?" do it "should return true if mounted device is the same" do allow(@current_resource).to receive(:device).and_return(GUID) @@ -131,12 +123,6 @@ describe Chef::Provider::Mount::Windows do expect(@provider.send :mount_options_unchanged?).to be false end end - - it "should not mount the filesystem if it is mounted and the options have not changed" do - expect(@vol).to_not receive(:add) - allow(@current_resource).to receive(:mounted).and_return(true) - @provider.mount_fs - end end describe "when unmounting a file system" do diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb index fa168e571e..19967e8496 100644 --- a/spec/unit/provider/mount_spec.rb +++ b/spec/unit/provider/mount_spec.rb @@ -60,25 +60,6 @@ describe Chef::Provider::Mount do provider.run_action(:mount) expect(new_resource).to be_updated_by_last_action end - - it "should remount the filesystem if it is mounted and the options have changed" do - allow(current_resource).to receive(:mounted).and_return(true) - allow(provider).to receive(:mount_options_unchanged?).and_return(false) - expect(provider).to receive(:umount_fs).and_return(true) - expect(provider).to receive(:wait_until_unmounted) - expect(provider).to receive(:mount_fs).and_return(true) - provider.run_action(:mount) - expect(new_resource).to be_updated_by_last_action - end - - it "should not mount the filesystem if it is mounted and the options have not changed" do - allow(current_resource).to receive(:mounted).and_return(true) - expect(provider).to receive(:mount_options_unchanged?).and_return(true) - expect(provider).not_to receive(:mount_fs) - provider.run_action(:mount) - expect(new_resource).not_to be_updated_by_last_action - end - end describe "when the target state is an unmounted filesystem" do |