Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SELinux check item #136

Merged
merged 3 commits into from
Jun 6, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/serverspec/commands/linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def check_iptables_rule rule, table=nil, chain=nil
end

def check_selinux mode
"getenforce | grep -i -- #{escape(mode)}"
"getenforce | grep -i -- #{escape(mode)} && grep -i -- SELINUX=#{escape(mode)} /etc/selinux/config"
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/support/shared_commands_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,17 @@
shared_examples_for 'support command check_selinux' do
context 'enforcing' do
subject { commands.check_selinux('enforcing') }
it { should eq "getenforce | grep -i -- enforcing" }
it { should eq "getenforce | grep -i -- enforcing && grep -i -- SELINUX=enforcing /etc/selinux/config" }
end

context 'permissive' do
subject { commands.check_selinux('permissive') }
it { should eq "getenforce | grep -i -- permissive" }
it { should eq "getenforce | grep -i -- permissive && grep -i -- SELINUX=permissive /etc/selinux/config" }
end

context 'disabled' do
subject { commands.check_selinux('disabled') }
it { should eq "getenforce | grep -i -- disabled" }
it { should eq "getenforce | grep -i -- disabled && grep -i -- SELINUX=disabled /etc/selinux/config" }
end
end

Expand Down