From b641216b8b56d72bd581ecd5545553d033d00492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20B=C3=A9rtoli?= Date: Sat, 25 Aug 2018 16:08:24 -0300 Subject: [PATCH] Update testing environment --- .kitchen.yml | 28 +++++++++++++++---- .travis.yml | 19 +++++++++++++ Gemfile | 7 +++++ ...walld_server_spec.rb => firewalld_spec.rb} | 3 -- 4 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 .travis.yml create mode 100644 Gemfile rename test/integration/default/{serverspec/firewalld_server_spec.rb => firewalld_spec.rb} (60%) diff --git a/.kitchen.yml b/.kitchen.yml index efd96c9..3e0768d 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,16 +1,27 @@ --- driver: - name: vagrant + name: docker + +driver_config: + use_sudo: false + privileged: true + provision_command: mkdir -p /run/sshd + run_command: /lib/systemd/systemd platforms: - - name: centos-7.2 + - name: debian-9 + - name: ubuntu-18.04 + - name: centos-7 provisioner: name: salt_solo - salt_install: bootstrap - salt_bootstrap_url: https://bootstrap.saltstack.com + log_level: info + require_chef: false salt_version: latest formula: firewalld + salt_copy_filter: + - .kitchen + - .git pillars: top.sls: base: @@ -28,10 +39,17 @@ provisioner: - 24007-24008 - 49152-49200 +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: default provisioner: - salt_bootstrap_options: -X -d state_top: base: '*': diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dde9c8f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +sudo: required +cache: bundler +language: ruby + +services: + - docker + +before_install: + - bundle install + +env: + matrix: + - INSTANCE: default-debian-9 + - INSTANCE: default-ubuntu-1804 + - INSTANCE: default-centos-7 + +script: + - bundle exec kitchen verify ${INSTANCE} + diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..67a327c --- /dev/null +++ b/Gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "test-kitchen", '>=1.20.0' +gem "kitchen-docker" +gem "kitchen-salt", ">=0.1.0" +gem "kitchen-inspec" + diff --git a/test/integration/default/serverspec/firewalld_server_spec.rb b/test/integration/default/firewalld_spec.rb similarity index 60% rename from test/integration/default/serverspec/firewalld_server_spec.rb rename to test/integration/default/firewalld_spec.rb index dddd8dd..07d3a60 100644 --- a/test/integration/default/serverspec/firewalld_server_spec.rb +++ b/test/integration/default/firewalld_spec.rb @@ -1,6 +1,3 @@ -require 'serverspec' -set :backend, :exec - describe service('firewalld') do it { should be_running } end