Skip to content

Commit

Permalink
Merge pull request #66 from netmanagers/master
Browse files Browse the repository at this point in the history
Basic testing framework
  • Loading branch information
aboe76 authored Apr 1, 2018
2 parents 62abea7 + 1087f3b commit 84605b0
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo: required
cache: bundler
language: ruby

services:
- docker

before_install:
- bundle install

script: bundle exec kitchen verify
7 changes: 7 additions & 0 deletions test/integration/default/pkgs_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
control 'Postfix packages' do
title 'should be installed'

describe package('postfix') do
it { should be_installed }
end
end
12 changes: 12 additions & 0 deletions test/integration/default/service_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 84605b0

Please sign in to comment.