Merge pull request #204 from myii/ci/fix-centos6-suite-and-rename-to-upstart

ci(kitchen+travis): fix `centos6` suite and rename to `upstart`
This commit is contained in:
Daniel 2020-09-03 13:28:05 +00:00 committed by GitHub
commit 318ec37146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 12 deletions

View file

@ -104,8 +104,8 @@ jobs:
# - env: INSTANCE=default-fedora-31-2019-2-py3
# - env: INSTANCE=default-opensuse-leap-152-2019-2-py3
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
# - env: INSTANCE=default-centos-6-2019-2-py2
# - env: INSTANCE=default-amazonlinux-1-2019-2-py2
- env: INSTANCE=upstart-centos-6-2019-2-py2
# - env: INSTANCE=upstart-amazonlinux-1-2019-2-py2
- env: INSTANCE=default-arch-base-latest-2019-2-py2
# <REMOVEME

View file

@ -150,7 +150,8 @@ verifier:
suites:
- name: default
excludes:
- centos-6-2018-3-py2
- centos-6-2019-2-py2
- amazonlinux-1-2019-2-py2
provisioner:
state_top:
base:
@ -168,9 +169,10 @@ suites:
verifier:
inspec_tests:
- path: test/integration/default
- name: centos6
- name: upstart
includes:
- centos-6-2018-3-py2
- centos-6-2019-2-py2
- amazonlinux-1-2019-2-py2
provisioner:
state_top:
base:
@ -183,7 +185,7 @@ suites:
- TEMPLATE
- define_roles
pillars_from_files:
TEMPLATE.sls: test/salt/pillar/centos6.sls
TEMPLATE.sls: test/salt/pillar/upstart.sls
define_roles.sls: test/salt/pillar/define_roles.sls
verifier:
inspec_tests:

View file

@ -1,12 +1,20 @@
# frozen_string_literal: true
# Overide by OS
package_name = 'bash'
package_name = 'cronie' if (os[:name] == 'centos') && os[:release].start_with?('6')
# Prepare platform "finger"
platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}"
control 'TEMPLATE package' do
title 'should be installed'
# Overide by `platform_finger`
package_name =
case platform_finger
when 'centos-6', 'amazon-2018'
'cronie'
else
'bash'
end
describe package(package_name) do
it { should be_installed }
end

View file

@ -1,14 +1,23 @@
# frozen_string_literal: true
# Overide by OS
service_name = 'systemd-journald'
service_name = 'crond' if (os[:name] == 'centos') && os[:release].start_with?('6')
# Prepare platform "finger"
platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}"
control 'TEMPLATE service' do
impact 0.5
title 'should be running and enabled'
# Overide by `platform_finger`
service_name =
case platform_finger
when 'centos-6', 'amazon-2018'
'crond'
else
'systemd-journald'
end
describe service(service_name) do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end