if os[:family] == 'redhat' && os[:release].start_with?('6') || os[:family] == 'amazon'

  describe command('sysctl -n kernel.msgmax') do
    its(:exit_status) { should eq 0 }
    its(:stdout) { should match(/^65536$/) }
  end

else

  describe command('sysctl -n kernel.msgmax') do
    its(:exit_status) { should eq 0 }
    its(:stdout) { should match(/^8192$/) }
  end

end

describe file('/etc/sysctl.d/99-chef-kernel.msgmax.conf') do
  it { should_not be_file }
end

describe command('sysctl -n vm.swappiness') do
  its(:exit_status) { should eq 0 }
  its(:stdout) { should match(/^19$/) }
end

if (os[:family] == 'redhat' && os[:release].start_with?('6')) || os[:name] == 'amazon'

  describe command('sysctl -n kernel.msgmax') do
    its(:exit_status) { should eq 0 }
    its(:stdout) { should match(/^65536$/) }
  end

else

  describe command('sysctl -n kernel.msgmax') do
    its(:exit_status) { should eq 0 }
    its(:stdout) { should match(/^8192$/) }
  end

end

describe file('/etc/sysctl.d/99-chef-kernel.msgmax.conf') do
  it { should_not be_file }
end

describe command('sysctl -n vm.swappiness') do
  its(:exit_status) { should eq 0 }
  its(:stdout) { should match(/^19$/) }
end

Fix inspec tests for Amazon Linux
Fix inspec tests for Amazon Linux

Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
