ci(travis): add Inspec tests

This commit is contained in:
Nicolas Rodriguez authored and Nicolas Rodriguez committed 2019-08-26 10:30:19 +02:00
1 parent 4657f44f09
commit 168926a660
10 files changed
+479 -1

No files matched your search

@@ -0,0 +1,22 @@
control 'Timezone configuration' do
title 'should match desired lines'
def test_file_content(config_file)
describe file(config_file) do
its('content') { should include 'Europe/Paris' }
end
end
def test_symlink(config_file)
describe file(config_file) do
its('link_path') { should eq '/usr/share/zoneinfo/Europe/Paris' }
end
end
case os[:family]
when 'debian'
test_file_content('/etc/timezone')
else
test_symlink('/etc/localtime')
end
end
@@ -0,0 +1,15 @@
control 'Timezone package' do
title 'should be installed'
package_name =
case os[:family]
when 'suse'
'timezone'
else
'tzdata'
end
describe package(package_name) do
it { should be_installed }
end
end