inspec/test/cookbooks/os_prepare/recipes/mount.rb

34 lines
665 B
Ruby
Raw Normal View History

2015-12-31 00:10:39 +00:00
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#
# file mount tests
2016-01-28 13:51:54 +00:00
case node['platform']
when 'ubuntu', 'rhel', 'centos', 'fedora'
2015-12-31 00:10:39 +00:00
2016-01-28 13:51:54 +00:00
# copy iso file for mount tests
# NB created using `mkdir empty; mkisofs -o empty.iso empty/`
2016-02-01 16:00:44 +00:00
cookbook_file '/tmp/empty.iso' do
2016-01-28 13:51:54 +00:00
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
2015-12-31 00:10:39 +00:00
2016-01-28 13:51:54 +00:00
# mount -o loop /root/empty.iso /mnt/iso-disk
mount '/mnt/iso-disk' do
2016-02-01 16:00:44 +00:00
device '/tmp/empty.iso'
2016-01-28 13:51:54 +00:00
options 'loop'
action [:mount, :enable]
end
2015-12-31 00:10:39 +00:00
end