Skip to content

Commit

Permalink
Merge pull request voxpupuli#209 from oranenj/ordering_fix
Browse files Browse the repository at this point in the history
Fix resource reference issue when removing fcontexts
  • Loading branch information
yastupin authored Mar 30, 2017
2 parents bc1c835 + ada07d8 commit 9755f64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/fcontext.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
} else {
Anchor['selinux::start']
-> Selinux::Fcontext[$title]
-> Anchor['selinux::module::pre']
-> Anchor['selinux::module pre']
}

if $filetype !~ /^(?:a|f|d|c|b|s|l|p)$/ {
Expand Down
11 changes: 11 additions & 0 deletions spec/defines/selinux_fcontext_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
it { is_expected.to contain_selinux__fcontext('myfile').that_requires('Anchor[selinux::module post]') }
it { is_expected.to contain_selinux__fcontext('myfile').that_comes_before('Anchor[selinux::end]') }
end
context 'removal ordering' do
let(:params) do
{
ensure: 'absent',
pathspec: '/tmp/file1',
seltype: 'user_home_dir_t'
}
end
it { is_expected.to contain_selinux__fcontext('myfile').that_requires('Anchor[selinux::start]') }
it { is_expected.to contain_selinux__fcontext('myfile').that_comes_before('Anchor[selinux::module pre]') }
end

context 'invalid filetype' do
let(:params) do
Expand Down

0 comments on commit 9755f64

Please sign in to comment.