From 14cc19c941b26f75dc3f5dfc01283aff3b50844b Mon Sep 17 00:00:00 2001 From: Adam Mendlik Date: Thu, 23 Feb 2017 14:04:27 -0700 Subject: [PATCH] Add test-kitchen configuration --- .gitignore | 3 ++ .kitchen.yml | 33 +++++++++++++++++++ .../default/serverspec/openssl_server_spec.rb | 17 ++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .gitignore create mode 100644 .kitchen.yml create mode 100644 test/integration/default/serverspec/openssl_server_spec.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0cbd9df --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.swp +.kitchen/ +.kitchen.local.yml diff --git a/.kitchen.yml b/.kitchen.yml new file mode 100644 index 0000000..f2af536 --- /dev/null +++ b/.kitchen.yml @@ -0,0 +1,33 @@ +--- +driver: + name: vagrant + +platforms: + - name: centos-6.8 + - name: centos-7.2 + - name: ubuntu-14.04 + - name: ubuntu-16.04 + - name: debian-8.5 + +provisioner: + name: salt_solo + salt_install: bootstrap + salt_bootstrap_url: https://bootstrap.saltstack.com + salt_version: latest + formula: openssh + pillars: + top.sls: + base: + '*': + - openssl + openssl.sls: + sshd_enable: true + +suites: + - name: default + provisioner: + salt_bootstrap_options: -X -d + state_top: + base: + '*': + - openssh.config diff --git a/test/integration/default/serverspec/openssl_server_spec.rb b/test/integration/default/serverspec/openssl_server_spec.rb new file mode 100644 index 0000000..30ba8d2 --- /dev/null +++ b/test/integration/default/serverspec/openssl_server_spec.rb @@ -0,0 +1,17 @@ +require 'serverspec' +set :backend, :exec + +def service_name() + return case os[:family] + when 'redhat' then 'sshd' + when 'debian', 'ubuntu' then 'ssh' + end +end + +describe 'openssl/config.sls' do + + describe service(service_name()) do + it { should be_running } + end + +end