mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
33 lines
665 B
Ruby
33 lines
665 B
Ruby
# encoding: utf-8
|
|
# author: Christoph Hartmann
|
|
# author: Dominik Richter
|
|
#
|
|
# file mount tests
|
|
|
|
case node['platform']
|
|
when 'ubuntu', 'rhel', 'centos', 'fedora'
|
|
|
|
# copy iso file for mount tests
|
|
# NB created using `mkdir empty; mkisofs -o empty.iso empty/`
|
|
cookbook_file '/tmp/empty.iso' do
|
|
owner 'root'
|
|
group 'root'
|
|
mode '0755'
|
|
action :create
|
|
end
|
|
|
|
# create mount directory
|
|
directory '/mnt/iso-disk' do
|
|
owner 'root'
|
|
group 'root'
|
|
mode '0755'
|
|
action :create
|
|
end
|
|
|
|
# mount -o loop /root/empty.iso /mnt/iso-disk
|
|
mount '/mnt/iso-disk' do
|
|
device '/tmp/empty.iso'
|
|
options 'loop'
|
|
action [:mount, :enable]
|
|
end
|
|
end
|