Basic testing framework

This commit is contained in:
Javier Bértoli 2018-03-17 20:24:00 -03:00
parent 62abea758a
commit 1087f3b85e
4 changed files with 81 additions and 0 deletions

51
.kitchen.yml Normal file
View File

@ -0,0 +1,51 @@
---
driver:
name: docker
driver_config:
use_sudo: false
privileged: true
provision_command: mkdir -p /run/sshd
run_command: /sbin/init
platforms:
- name: debian-9
- name: ubuntu-17.10
- name: centos-7
driver_config:
image: saltstack/centos-7-minimal
provisioner:
name: salt_solo
log_level: info
require_chef: false
salt_version: latest
formula: postfix
salt_copy_filter:
- .kitchen
- .git
pillars:
top.sls:
base:
'*':
- postfix
postfix.sls:
postfix:
manage_master_config: False
verifier:
name: inspec
sudo: false
# cli, documentation, html, progress, json, json-min, json-rspec, junit
reporter: cli
inspec_tests:
- path: test/integration/default
suites:
- name: postfix
provisioner:
state_top:
base:
'*':
- postfix
- postfix.config

11
.travis.yml Normal file
View File

@ -0,0 +1,11 @@
sudo: required
cache: bundler
language: ruby
services:
- docker
before_install:
- bundle install
script: bundle exec kitchen verify

View File

@ -0,0 +1,7 @@
control 'Postfix packages' do
title 'should be installed'
describe package('postfix') do
it { should be_installed }
end
end

View File

@ -0,0 +1,12 @@
control 'Postfix service' do
title 'should be running'
describe service('postfix') do
it { should be_enabled }
it { should be_running }
end
describe port(25) do
it { should be_listening }
end
end