Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic testing framework #66

Merged
merged 1 commit into from
Apr 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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