diff options
author | Nick McSpadden <nmcspadden@gmail.com> | 2018-05-14 23:33:45 -0700 |
---|---|---|
committer | Nick McSpadden <nmcspadden@gmail.com> | 2018-05-14 23:33:45 -0700 |
commit | c935ce85f591e53f2f200e55cb252185e1801387 (patch) | |
tree | dfeee6151c50d805138a3d10761a531c2ffbf984 /spec/functional/resource/mount_spec.rb | |
parent | c48fd22a51deb74a3d4bc3abca308043689b494a (diff) | |
parent | c0609e449135fae43d436136a4f0fd3889a9b8f1 (diff) | |
download | chef-c935ce85f591e53f2f200e55cb252185e1801387.tar.gz |
Merge branch 'master' into mac_uid
Diffstat (limited to 'spec/functional/resource/mount_spec.rb')
-rw-r--r-- | spec/functional/resource/mount_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/functional/resource/mount_spec.rb b/spec/functional/resource/mount_spec.rb index c756b0d3d4..c98d6cec25 100644 --- a/spec/functional/resource/mount_spec.rb +++ b/spec/functional/resource/mount_spec.rb @@ -22,7 +22,7 @@ require "chef/mixin/shell_out" require "tmpdir" # run this test only for following platforms. -include_flag = !(%w{ubuntu centos aix solaris2}.include?(ohai[:platform])) +include_flag = !(%w{debian rhel amazon aix solaris2}.include?(ohai[:platform_family])) describe Chef::Resource::Mount, :requires_root, :skip_travis, :external => include_flag do # Disabled in travis because it refuses to let us mount a ramdisk. /dev/ramX does not @@ -35,15 +35,19 @@ describe Chef::Resource::Mount, :requires_root, :skip_travis, :external => inclu def setup_device_for_mount # use ramdisk for creating a test device for mount. # This can cleaner if we have chef resource/provider for ramdisk. - case ohai[:platform] + case ohai[:platform_family] when "aix" # On AIX, we can't create a ramdisk inside a WPAR, so we use # a "namefs" mount against / to test # https://www-304.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.performance/namefs_file_sys.htm device = "/" fstype = "namefs" - when "ubuntu", "centos" + when "debian", "rhel", "amazon" device = "/dev/ram1" + unless File.exist?(device) + shell_out("mknod -m 660 #{device} b 1 0") + shell_out("chown root:disk #{device}") + end shell_out("ls -1 /dev/ram*").stdout.each_line do |d| if shell_out("mount | grep #{d}").exitstatus == "1" # this device is not mounted, so use it. |