fix selinux label tests for redhat family

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-16 08:27:35 +02:00
parent d16f76c9ce
commit 682fe8f261
6 changed files with 37 additions and 13 deletions

View file

@ -58,8 +58,12 @@ describe 'file interface' do
file.size.must_equal(0)
end
it 'has no selinux_label' do
file.selinux_label.must_equal(nil)
it 'has selinux label handling' do
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
it 'has no product_version' do

View file

@ -58,8 +58,12 @@ describe 'file interface' do
file.size.must_equal(0)
end
it 'has no selinux_label' do
file.selinux_label.must_equal(nil)
it 'has selinux label handling' do
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
it 'has no product_version' do

View file

@ -63,8 +63,12 @@ describe 'file interface' do
file.size.must_be_close_to(11, 4)
end
it 'has no selinux_label' do
file.selinux_label.must_equal(nil)
it 'has selinux label handling' do
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
it 'has no product_version' do

View file

@ -55,12 +55,15 @@ describe 'file interface' do
end
it 'has inode size' do
# Must be around 11 Bytes, +- 4
file.size.must_be_close_to(4096, 4094)
end
it 'has no selinux_label' do
file.selinux_label.must_equal(nil)
it 'has selinux label handling' do
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
it 'has no product_version' do

View file

@ -61,10 +61,15 @@ describe 'file interface' do
file.size.must_equal(0)
end
it 'has no selinux_label' do
file.selinux_label.must_equal(nil)
it 'has selinux label handling' do
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
it 'has no product_version' do
file.product_version.must_equal(nil)
end

View file

@ -67,8 +67,12 @@ describe 'file interface' do
file.size.must_be_close_to(11, 4)
end
it 'has no selinux_label' do
file.selinux_label.must_equal(nil)
it 'has selinux label handling' do
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
it 'has no product_version' do