summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-10-21 10:55:26 -0700
committerSerdar Sutay <serdar@opscode.com>2014-10-21 10:55:26 -0700
commit20a1817caaf7aae8f8391a0a88df136cf01af832 (patch)
tree9633c5b0080d1f01eba84540b18b9b39064eb8ab
parentfcae30b2026adf4a87346dc056c2b21e19fb9287 (diff)
parent9aa5caccf2220b747071debfc0f9b2d2eba72568 (diff)
downloadchef-20a1817caaf7aae8f8391a0a88df136cf01af832.tar.gz
Merge pull request #2237 from rottenbytes/mount_cgroups
mount resource : allow to mount cgroups
-rw-r--r--lib/chef/provider/mount/mount.rb2
-rw-r--r--spec/unit/provider/mount/mount_spec.rb16
2 files changed, 7 insertions, 11 deletions
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 2d4a5aadef..c1d4fb2223 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -191,7 +191,7 @@ class Chef
def device_should_exist?
( @new_resource.device != "none" ) &&
( not network_device? ) &&
- ( not %w[ tmpfs fuse ].include? @new_resource.fstype )
+ ( not %w[ cgroup tmpfs fuse ].include? @new_resource.fstype )
end
private
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index d6f71bc613..abab7640c0 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -107,16 +107,12 @@ describe Chef::Provider::Mount::Mount do
lambda { @provider.load_current_resource();@provider.mountable? }.should raise_error(Chef::Exceptions::Mount)
end
- it "does not expect the device to exist for tmpfs" do
- @new_resource.fstype("tmpfs")
- @new_resource.device("whatever")
- lambda { @provider.load_current_resource();@provider.mountable? }.should_not raise_error
- end
-
- it "does not expect the device to exist for Fuse filesystems" do
- @new_resource.fstype("fuse")
- @new_resource.device("nilfs#xxx")
- lambda { @provider.load_current_resource();@provider.mountable? }.should_not raise_error
+ [ "tmpfs", "fuse", "cgroup" ].each do |fstype|
+ it "does not expect the device to exist for #{fstype}" do
+ @new_resource.fstype(fstype)
+ @new_resource.device("whatever")
+ lambda { @provider.load_current_resource();@provider.mountable? }.should_not raise_error
+ end
end
it "does not expect the device to exist if it's none" do