
Mounting devices without specifying or restoring context ends up with default context file_t assigned for swift paths. On selinux systems it is nice to at least try to preserve predefined contexts on paths. Change-Id: I9b68c04cb0d4ee72c074e514db7141c3c077c978 Closes-Bug: rhbz#1095503 Closes-Bug: #1320853
63 lines
1.3 KiB
Ruby
63 lines
1.3 KiB
Ruby
require 'spec_helper'
|
|
describe 'swift::storage::mount' do
|
|
# TODO add unit tests
|
|
|
|
let :title do
|
|
'dans_mount_point'
|
|
end
|
|
|
|
describe 'with defaults params' do
|
|
let :params do
|
|
{
|
|
:device => '/dev/sda'
|
|
}
|
|
end
|
|
|
|
it { should contain_mount('/srv/node/dans_mount_point').with(
|
|
:ensure => 'present',
|
|
:device => '/dev/sda',
|
|
:fstype => 'xfs',
|
|
:options => 'noatime,nodiratime,nobarrier,logbufs=8',
|
|
:require => 'File[/srv/node/dans_mount_point]'
|
|
)}
|
|
|
|
end
|
|
|
|
describe 'when mounting a loopback device' do
|
|
|
|
let :params do
|
|
{
|
|
:device => '/dev/sda',
|
|
:loopback => true
|
|
}
|
|
end
|
|
|
|
it { should contain_mount('/srv/node/dans_mount_point').with(
|
|
:device => '/dev/sda',
|
|
:options => 'noatime,nodiratime,nobarrier,loop,logbufs=8'
|
|
)}
|
|
|
|
end
|
|
|
|
describe 'when mounting a loopback device on selinux system' do
|
|
let :params do
|
|
{
|
|
:device => '/dev/sda'
|
|
}
|
|
end
|
|
|
|
let :facts do
|
|
{
|
|
:selinux => true,
|
|
}
|
|
end
|
|
|
|
it { should contain_exec("restorecon_mount_dans_mount_point").with(
|
|
{:command => "restorecon /srv/node/dans_mount_point",
|
|
:path => ['/usr/sbin', '/bin'],
|
|
:refreshonly => true}
|
|
)}
|
|
|
|
end
|
|
end
|