mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
place empty iso in tmp directory
This commit is contained in:
parent
914a4bf424
commit
ea085ef7c0
3 changed files with 6 additions and 5 deletions
|
@ -9,7 +9,7 @@ when 'ubuntu', 'rhel', 'centos', 'fedora'
|
|||
|
||||
# copy iso file for mount tests
|
||||
# NB created using `mkdir empty; mkisofs -o empty.iso empty/`
|
||||
cookbook_file '/root/empty.iso' do
|
||||
cookbook_file '/tmp/empty.iso' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
|
@ -26,7 +26,7 @@ when 'ubuntu', 'rhel', 'centos', 'fedora'
|
|||
|
||||
# mount -o loop /root/empty.iso /mnt/iso-disk
|
||||
mount '/mnt/iso-disk' do
|
||||
device '/root/empty.iso'
|
||||
device '/tmp/empty.iso'
|
||||
options 'loop'
|
||||
action [:mount, :enable]
|
||||
end
|
||||
|
|
|
@ -125,6 +125,7 @@ if os.unix?
|
|||
end
|
||||
end
|
||||
|
||||
# check file mount on linux
|
||||
if os.linux?
|
||||
# for server spec compatibility
|
||||
# Do not use `.with` or `.only_with`, this syntax is deprecated and will be removed
|
||||
|
@ -133,7 +134,7 @@ if os.linux?
|
|||
it { should be_mounted }
|
||||
it { should be_mounted.with( :type => 'iso9660' ) }
|
||||
it { should be_mounted.with( :type => 'iso9660', :options => { :ro => true } ) }
|
||||
it { should be_mounted.with( :type => 'iso9660', :device => '/root/empty.iso' ) }
|
||||
it { should be_mounted.with( :type => 'iso9660', :device => '/tmp/empty.iso' ) }
|
||||
it { should_not be_mounted.with( :type => 'ext4' ) }
|
||||
it { should_not be_mounted.with( :type => 'xfs' ) }
|
||||
end
|
||||
|
@ -142,7 +143,7 @@ if os.linux?
|
|||
# also see mount_spec.rb
|
||||
describe file('/mnt/iso-disk') do
|
||||
it { should be_mounted.only_with( {
|
||||
:device=>"/root/empty.iso",
|
||||
:device=>"/tmp/empty.iso",
|
||||
:type=>"iso9660",
|
||||
:options=>{
|
||||
:ro=>true}
|
||||
|
|
|
@ -5,7 +5,7 @@ if os.linux?
|
|||
describe mount '/mnt/iso-disk' do
|
||||
it { should be_mounted }
|
||||
its('count') { should eq 1 }
|
||||
its('device') { should eq '/root/empty.iso' }
|
||||
its('device') { should eq '/tmp/empty.iso' }
|
||||
its('type') { should eq 'iso9660' }
|
||||
its('options') { should eq ['ro'] }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue