mirror of
https://github.com/inspec/inspec
synced 2025-02-25 11:57:17 +00:00
Merge pull request #379 from chef/sr/use-empty-iso
integration tests: stop using alpine iso
This commit is contained in:
commit
a5ed04d51c
4 changed files with 8 additions and 8 deletions
BIN
test/integration/cookbooks/os_prepare/files/empty.iso
Normal file
BIN
test/integration/cookbooks/os_prepare/files/empty.iso
Normal file
Binary file not shown.
|
@ -4,9 +4,9 @@
|
||||||
#
|
#
|
||||||
# file mount tests
|
# file mount tests
|
||||||
|
|
||||||
# download alpine linux for file mount tests
|
# copy iso file for mount tests
|
||||||
remote_file '/root/alpine-3.3.0-x86_64.iso' do
|
# NB created using `mkdir empty; mkisofs -o empty.iso empty/`
|
||||||
source 'http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86_64/alpine-3.3.0-x86_64.iso'
|
cookbook_file '/root/empty.iso' do
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group 'root'
|
group 'root'
|
||||||
mode '0755'
|
mode '0755'
|
||||||
|
@ -21,9 +21,9 @@ directory '/mnt/iso-disk' do
|
||||||
action :create
|
action :create
|
||||||
end
|
end
|
||||||
|
|
||||||
# mount -o loop /root/alpine-3.3.0-x86_64.iso /mnt/iso-disk
|
# mount -o loop /root/empty.iso /mnt/iso-disk
|
||||||
mount '/mnt/iso-disk' do
|
mount '/mnt/iso-disk' do
|
||||||
device '/root/alpine-3.3.0-x86_64.iso'
|
device '/root/empty.iso'
|
||||||
options 'loop'
|
options 'loop'
|
||||||
action [:mount, :enable]
|
action [:mount, :enable]
|
||||||
end
|
end
|
||||||
|
|
|
@ -124,7 +124,7 @@ if os.unix?
|
||||||
it { should be_mounted }
|
it { should be_mounted }
|
||||||
it { should be_mounted.with( :type => 'iso9660' ) }
|
it { should be_mounted.with( :type => 'iso9660' ) }
|
||||||
it { should be_mounted.with( :type => 'iso9660', :options => { :ro => true } ) }
|
it { should be_mounted.with( :type => 'iso9660', :options => { :ro => true } ) }
|
||||||
it { should be_mounted.with( :type => 'iso9660', :device => '/root/alpine-3.3.0-x86_64.iso' ) }
|
it { should be_mounted.with( :type => 'iso9660', :device => '/root/empty.iso' ) }
|
||||||
it { should_not be_mounted.with( :type => 'ext4' ) }
|
it { should_not be_mounted.with( :type => 'ext4' ) }
|
||||||
it { should_not be_mounted.with( :type => 'xfs' ) }
|
it { should_not be_mounted.with( :type => 'xfs' ) }
|
||||||
end
|
end
|
||||||
|
@ -133,7 +133,7 @@ if os.unix?
|
||||||
# also see mount_spec.rb
|
# also see mount_spec.rb
|
||||||
describe file('/mnt/iso-disk') do
|
describe file('/mnt/iso-disk') do
|
||||||
it { should be_mounted.only_with( {
|
it { should be_mounted.only_with( {
|
||||||
:device=>"/root/alpine-3.3.0-x86_64.iso",
|
:device=>"/root/empty.iso",
|
||||||
:type=>"iso9660",
|
:type=>"iso9660",
|
||||||
:options=>{
|
:options=>{
|
||||||
:ro=>true}
|
:ro=>true}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
describe mount '/mnt/iso-disk' do
|
describe mount '/mnt/iso-disk' do
|
||||||
it { should be_mounted }
|
it { should be_mounted }
|
||||||
its('count') { should eq 1 }
|
its('count') { should eq 1 }
|
||||||
its('device') { should eq '/root/alpine-3.3.0-x86_64.iso' }
|
its('device') { should eq '/root/empty.iso' }
|
||||||
its('type') { should eq 'iso9660' }
|
its('type') { should eq 'iso9660' }
|
||||||
its('options') { should eq ['ro'] }
|
its('options') { should eq ['ro'] }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue