Browse Source

Add Kitchen test

master
Nicolas Rodriguez 7 years ago
parent
commit
f049385b18
6 changed files with 91 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +49
    -0
      .kitchen.yml
  3. +15
    -0
      .travis.yml
  4. +8
    -0
      Gemfile
  5. +7
    -0
      test/integration/syslog_ng/controls/syslog_ng.rb
  6. +10
    -0
      test/integration/syslog_ng/inspec.yml

+ 2
- 0
.gitignore View File

.kitchen/
Gemfile.lock

+ 49
- 0
.kitchen.yml View File

<%
distrib, infos = ENV.fetch('DISTRIB', 'debian:stretch/9').split(':')
codename, version = infos.split('/')
%>
---
driver:
name: docker
use_sudo: false

provisioner:
name: salt_solo
formula: syslog_ng

# Install Salt from official repositories
salt_install: apt
salt_version: latest
salt_apt_repo: http://repo.saltstack.com/apt/<%= distrib %>/<%= version %>/amd64
salt_apt_repo_key: http://repo.saltstack.com/apt/<%= distrib %>/<%= version %>/amd64/latest/SALTSTACK-GPG-KEY.pub

# Don't install Chef
require_chef: false

# Configure Salt
state_top:
base:
'*':
- syslog_ng.config

pillars:
top.sls:
base:
'*':
- syslog_ng
syslog_ng.sls:
syslog_ng:
foo: bar

platforms:
- name: <%= distrib %>-<%= codename %>
driver_config:
image: "<%= distrib %>:<%= codename %>"
platform: <%= distrib %>

verifier:
name: inspec
format: progress

suites:
- name: syslog_ng

+ 15
- 0
.travis.yml View File

language: ruby
sudo: required
cache: bundler
rvm:
- 2.3.4
services:
- docker
script:
- bundle exec kitchen test
env:
matrix:
- DISTRIB=debian:wheezy/7
- DISTRIB=debian:jessie/8
- DISTRIB=debian:stretch/9
- DISTRIB=ubuntu:xenial/16.04

+ 8
- 0
Gemfile View File

source 'https://rubygems.org'
ruby '2.3.4'

gem 'test-kitchen'
gem 'kitchen-docker'
gem 'kitchen-salt'
gem 'kitchen-inspec'
gem 'rake'

+ 7
- 0
test/integration/syslog_ng/controls/syslog_ng.rb View File

# encoding: utf-8

title 'Test SyslogNG installation'

describe package('syslog-ng') do
it { should be_installed }
end

+ 10
- 0
test/integration/syslog_ng/inspec.yml View File

name: syslog_ng
title: SyslogNG Profile
maintainer: Nicolas Rodriguez
copyright: Nicolas Rodriguez
copyright_email: nicoladmin@free.fr
license: MIT
summary: SyslogNG Compliance Profile
version: 0.1.0
supports:
- os-name: debian

Loading…
Cancel
Save