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

serverspec has a contract on running commands remote. this fixes the local #9

Merged
merged 3 commits into from
Jun 5, 2014
Merged
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
9 changes: 7 additions & 2 deletions default/serverspec/sysctl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,16 @@
end

describe 'ExecShield' do
%x( cat /proc/cpuinfo | egrep "^flags" | grep -q ' nx ' )
if $CHILD_STATUS.exitstatus != 0
if command('cat /proc/cpuinfo').return_stdout?(/^flags.*?:.*? nx( .*?)?$/)
context linux_kernel_parameter('kernel.exec-shield') do
its(:value) { should eq 1 }
end
else
context 'No nx flag detected' do
it 'no kernel.exec-shield required' do
true
end
end
end

context linux_kernel_parameter('kernel.randomize_va_space') do
Expand Down