mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
fix integration tests for suse 11
This commit is contained in:
parent
3346d7e1a9
commit
3ddcb4c418
6 changed files with 23 additions and 16 deletions
|
@ -70,4 +70,5 @@ platforms:
|
|||
suites:
|
||||
- name: default
|
||||
run_list:
|
||||
- recipe[ssh-hardening]
|
||||
- recipe[os_prepare]
|
||||
|
|
|
@ -4,8 +4,9 @@ if ENV['DOCKER']
|
|||
return
|
||||
end
|
||||
|
||||
if !os.linux?
|
||||
STDERR.puts "\033[1;33mTODO: Not running #{__FILE__} because we are not on linux.\033[0m"
|
||||
supported = %w{ubuntu centos amazon fedora}
|
||||
unless supported.include?(os[:name])
|
||||
STDERR.puts "\033[1;33mTODO: Not running #{__FILE__} because we are not on #{supported.join(', ')}.\033[0m"
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
@ -8,10 +8,12 @@ end
|
|||
# lets define our own group
|
||||
root_group = 'root'
|
||||
|
||||
if os[:family] == 'aix'
|
||||
if os[:name] == 'aix'
|
||||
root_group = 'system'
|
||||
elsif os[:family] == 'freebsd'
|
||||
elsif os[:name] == 'freebsd'
|
||||
root_group = 'wheel'
|
||||
elsif os[:name] == 'suse'
|
||||
root_group = 'sfcb'
|
||||
elsif os.solaris?
|
||||
root_group = 'sys'
|
||||
end
|
||||
|
@ -23,7 +25,9 @@ if os.unix?
|
|||
its('users') { should include 'root' }
|
||||
end
|
||||
|
||||
puts "ROOT GROUP: " + root_group
|
||||
describe etc_group.where(name: root_group) do
|
||||
its('users') { should_not eq [] }
|
||||
its('users') { should include 'root' }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ if ENV['DOCKER']
|
|||
return
|
||||
end
|
||||
|
||||
if os[:family] == 'freebsd'
|
||||
if os[:name] == 'freebsd'
|
||||
filedata = {
|
||||
user: 'root',
|
||||
group: 'wheel',
|
||||
|
@ -12,7 +12,7 @@ if os[:family] == 'freebsd'
|
|||
dir_md5sum: '598f4fe64aefab8f00bcbea4c9239abf',
|
||||
dir_sha256sum: '9b4fb24edd6d1d8830e272398263cdbf026b97392cc35387b991dc0248a628f9',
|
||||
}
|
||||
elsif os[:family] == 'aix'
|
||||
elsif os[:name] == 'aix'
|
||||
filedata = {
|
||||
user: 'root',
|
||||
group: 'system',
|
||||
|
@ -111,7 +111,7 @@ if os.unix?
|
|||
its('type') { should eq :file }
|
||||
end
|
||||
|
||||
describe file('/tmp/file') do
|
||||
describe file('/tmp/sfile') do
|
||||
its('suid') { should eq true }
|
||||
its('sgid') { should eq true }
|
||||
its('sticky') { should eq true }
|
||||
|
|
|
@ -5,7 +5,7 @@ if ENV['DOCKER']
|
|||
end
|
||||
|
||||
# prepare values
|
||||
if ['ubuntu', 'centos', 'fedora', 'opensuse', 'debian'].include?(os[:family])
|
||||
if ['ubuntu', 'centos', 'fedora', 'opensuse', 'debian', 'suse'].include?(os[:name])
|
||||
test_values = {
|
||||
kernel_panic: 0,
|
||||
ip_local_port_range: "32768\t61000",
|
||||
|
@ -15,17 +15,18 @@ if ['ubuntu', 'centos', 'fedora', 'opensuse', 'debian'].include?(os[:family])
|
|||
}
|
||||
|
||||
# configue parameter derivations for different OS
|
||||
test_values[:sched_autogroup_enabled] = 0 if ['centos', 'debian'].include?(os[:family])
|
||||
test_values[:sched_autogroup_enabled] = 0 if ['centos', 'debian'].include?(os[:name])
|
||||
|
||||
if (os[:family] == 'ubuntu' && os[:release].to_f == 10.04) ||
|
||||
(os[:family] == 'debian' && os[:release].to_i == 6) ||
|
||||
(os[:family] == 'centos' && os[:release].to_i == 5) ||
|
||||
(os[:family] == 'opensuse')
|
||||
if (os[:name] == 'ubuntu' && os[:release].to_f == 10.04) ||
|
||||
(os[:name] == 'debian' && os[:release].to_i == 6) ||
|
||||
(os[:name] == 'centos' && os[:release].to_i == 5) ||
|
||||
(os[:name] == 'opensuse') ||
|
||||
(os[:name] == 'suse')
|
||||
test_values[:sched_autogroup_enabled] = nil
|
||||
end
|
||||
|
||||
test_values[:nf_log] = nil if os[:family] == 'centos' && os[:release].to_i == 5
|
||||
test_values[:kernel_panic] = 90 if os[:family] == 'opensuse'
|
||||
test_values[:nf_log] = nil if os[:name] == 'centos' && os[:release].to_i == 5
|
||||
test_values[:kernel_panic] = 90 if os[:name] == 'opensuse'
|
||||
|
||||
else
|
||||
test_values = {}
|
||||
|
|
|
@ -5,7 +5,7 @@ if ENV['DOCKER']
|
|||
end
|
||||
|
||||
# based on operating system we select the available service
|
||||
if ['centos', 'fedora', 'freebsd', 'opensuse'].include?(os[:family])
|
||||
if ['centos', 'fedora', 'freebsd', 'opensuse', 'suse'].include?(os[:family])
|
||||
# CentOS, Fedora
|
||||
unavailable_service = 'ssh'
|
||||
available_service = 'sshd'
|
||||
|
|
Loading…
Reference in a new issue