diff --git a/.kitchen.yml b/.kitchen.yml new file mode 100644 index 0000000..e3e6223 --- /dev/null +++ b/.kitchen.yml @@ -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 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a0e3087 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +sudo: required +cache: bundler +language: ruby + +services: + - docker + +before_install: + - bundle install + +script: bundle exec kitchen verify diff --git a/test/integration/default/pkgs_spec.rb b/test/integration/default/pkgs_spec.rb new file mode 100644 index 0000000..b7ed81c --- /dev/null +++ b/test/integration/default/pkgs_spec.rb @@ -0,0 +1,7 @@ +control 'Postfix packages' do + title 'should be installed' + + describe package('postfix') do + it { should be_installed } + end +end diff --git a/test/integration/default/service_spec.rb b/test/integration/default/service_spec.rb new file mode 100644 index 0000000..6a118cd --- /dev/null +++ b/test/integration/default/service_spec.rb @@ -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