mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
fix selinux label tests for redhat family
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
d16f76c9ce
commit
682fe8f261
6 changed files with 37 additions and 13 deletions
|
@ -58,8 +58,12 @@ describe 'file interface' do
|
||||||
file.size.must_equal(0)
|
file.size.must_equal(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no selinux_label' do
|
it 'has selinux label handling' do
|
||||||
file.selinux_label.must_equal(nil)
|
if os[:family] == 'redhat'
|
||||||
|
file.selinux_label.must_equal('unconfined_u:object_r:tmp_t:s0')
|
||||||
|
else
|
||||||
|
file.selinux_label.must_equal(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no product_version' do
|
it 'has no product_version' do
|
||||||
|
|
|
@ -58,8 +58,12 @@ describe 'file interface' do
|
||||||
file.size.must_equal(0)
|
file.size.must_equal(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no selinux_label' do
|
it 'has selinux label handling' do
|
||||||
file.selinux_label.must_equal(nil)
|
if os[:family] == 'redhat'
|
||||||
|
file.selinux_label.must_equal('system_u:object_r:null_device_t:s0')
|
||||||
|
else
|
||||||
|
file.selinux_label.must_equal(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no product_version' do
|
it 'has no product_version' do
|
||||||
|
|
|
@ -63,8 +63,12 @@ describe 'file interface' do
|
||||||
file.size.must_be_close_to(11, 4)
|
file.size.must_be_close_to(11, 4)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no selinux_label' do
|
it 'has selinux label handling' do
|
||||||
file.selinux_label.must_equal(nil)
|
if os[:family] == 'redhat'
|
||||||
|
file.selinux_label.must_equal('unconfined_u:object_r:user_tmp_t:s0')
|
||||||
|
else
|
||||||
|
file.selinux_label.must_equal(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no product_version' do
|
it 'has no product_version' do
|
||||||
|
|
|
@ -55,12 +55,15 @@ describe 'file interface' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has inode size' do
|
it 'has inode size' do
|
||||||
# Must be around 11 Bytes, +- 4
|
|
||||||
file.size.must_be_close_to(4096, 4094)
|
file.size.must_be_close_to(4096, 4094)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no selinux_label' do
|
it 'has selinux label handling' do
|
||||||
file.selinux_label.must_equal(nil)
|
if os[:family] == 'redhat'
|
||||||
|
file.selinux_label.must_equal('unconfined_u:object_r:user_tmp_t:s0')
|
||||||
|
else
|
||||||
|
file.selinux_label.must_equal(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no product_version' do
|
it 'has no product_version' do
|
||||||
|
|
|
@ -61,10 +61,15 @@ describe 'file interface' do
|
||||||
file.size.must_equal(0)
|
file.size.must_equal(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no selinux_label' do
|
it 'has selinux label handling' do
|
||||||
file.selinux_label.must_equal(nil)
|
if os[:family] == 'redhat'
|
||||||
|
file.selinux_label.must_equal('unconfined_u:object_r:user_tmp_t:s0')
|
||||||
|
else
|
||||||
|
file.selinux_label.must_equal(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
it 'has no product_version' do
|
it 'has no product_version' do
|
||||||
file.product_version.must_equal(nil)
|
file.product_version.must_equal(nil)
|
||||||
end
|
end
|
||||||
|
|
|
@ -67,8 +67,12 @@ describe 'file interface' do
|
||||||
file.size.must_be_close_to(11, 4)
|
file.size.must_be_close_to(11, 4)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no selinux_label' do
|
it 'has selinux label handling' do
|
||||||
file.selinux_label.must_equal(nil)
|
if os[:family] == 'redhat'
|
||||||
|
file.selinux_label.must_equal('unconfined_u:object_r:user_tmp_t:s0')
|
||||||
|
else
|
||||||
|
file.selinux_label.must_equal(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has no product_version' do
|
it 'has no product_version' do
|
||||||
|
|
Loading…
Add table
Reference in a new issue