mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
feat(centos-6): reshape formula and tests for this platform
* Close #104
This commit is contained in:
parent
b0d6aa1f8c
commit
a4b1608ab4
5 changed files with 23 additions and 5 deletions
|
@ -34,7 +34,7 @@ env:
|
|||
- INSTANCE: default-debian-8-2017-7-py2
|
||||
- INSTANCE: default-ubuntu-1604-2017-7-py2
|
||||
# TODO: Enable after improving the formula to work with other than `systemd`
|
||||
# - INSTANCE: default-centos-6-2017-7-py2
|
||||
- INSTANCE: default-centos-6-2017-7-py2
|
||||
- INSTANCE: default-fedora-28-2017-7-py2
|
||||
- INSTANCE: default-opensuse-leap-42-2017-7-py2
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ platforms:
|
|||
- name: centos-6-2017-7-py2
|
||||
driver:
|
||||
image: netmanagers/salt-2017.7-py2:centos-6
|
||||
run_options: '--entrypoint /sbin/init'
|
||||
run_command: /sbin/init
|
||||
- name: fedora-28-2017-7-py2
|
||||
driver:
|
||||
image: netmanagers/salt-2017.7-py2:fedora-28
|
||||
|
|
|
@ -8,10 +8,16 @@ template:
|
|||
# Using bash package and udev service as an example. This allows us to
|
||||
# test the template formula itself. You should set these parameters to
|
||||
# examples that make sense in the contexto of the formula you're writing.
|
||||
{%- if grains.osfinger == 'CentOS-6' %}
|
||||
pkg: cronie
|
||||
service:
|
||||
name: crond
|
||||
{%- else %}
|
||||
pkg: bash
|
||||
config: /etc/template-formula.conf
|
||||
service:
|
||||
name: systemd-udevd
|
||||
{%- endif %}
|
||||
config: /etc/template-formula.conf
|
||||
|
||||
tofs:
|
||||
# The files_switch key serves as a selector for alternative
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
# Overide by OS
|
||||
package_name = 'bash'
|
||||
if os[:name] == 'centos' and os[:release].start_with?('6')
|
||||
package_name = 'cronie'
|
||||
end
|
||||
|
||||
control 'Template package' do
|
||||
title 'should be installed'
|
||||
|
||||
describe package('bash') do
|
||||
describe package(package_name) do
|
||||
it { should be_installed }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
# Overide by OS
|
||||
service_name = 'systemd-udevd'
|
||||
if os[:name] == 'centos' and os[:release].start_with?('6')
|
||||
service_name = 'crond'
|
||||
end
|
||||
|
||||
# Temporary `if` due to `opensuse-leap-15` bug re: `service`
|
||||
if os[:name] == 'suse'
|
||||
puts "[Skip `service`-based tests due to `opensuse-leap-15` detection bug (see https://github.com/inspec/train/issues/377)]"
|
||||
|
@ -6,7 +12,7 @@ control 'Template service' do
|
|||
impact 0.5
|
||||
title 'should be running and enabled'
|
||||
|
||||
describe service('systemd-udevd') do
|
||||
describe service(service_name) do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue