Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Inspec all the things #74

Merged
merged 17 commits into from
Feb 28, 2017
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions .foodcritic
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
~FC007
~FC015
~FC023
~FC059
102 changes: 102 additions & 0 deletions .kitchen.docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
driver:
name: dokken
privileged: true # because Docker and SystemD/Upstart
chef_version: current

transport:
name: dokken

provisioner:
name: dokken

verifier:
name: inspec

platforms:
- name: debian-7
driver:
image: debian:7
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: debian-8
driver:
image: debian:8
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: centos-6
driver:
image: centos:6
platform: rhel
pid_one_command: /sbin/init
intermediate_instructions:
- RUN yum -y install lsof which initscripts net-tools wget net-tools

- name: centos-7
driver:
image: centos:7
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install lsof which systemd-sysv initscripts wget net-tools

- name: fedora-latest
driver:
image: fedora:latest
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN dnf -y install yum which systemd-sysv initscripts wget net-tools

- name: ubuntu-12.04

This comment was marked as outdated.

driver:
image: ubuntu-upstart:12.04
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: ubuntu-14.04
driver:
image: ubuntu-upstart:14.04
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: ubuntu-16.04
driver:
image: ubuntu:16.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: opensuse-13.2

This comment was marked as outdated.

driver:
image: opensuse:13.2
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which net-tools

- name: opensuse-leap
driver:
image: opensuse:leap
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which net-tools

# suites:

This comment was marked as outdated.

# - name: client
# run_list:
# - recipe[test::client]
# attributes:
#
# - name: server
# run_list:
# - recipe[test::server]
# attributes:
11 changes: 7 additions & 4 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ driver:
name: vagrant

provisioner:
name: chef_solo
name: chef_zero
data_bags_path: "data_bags"
roles_path: "roles"
environments_path: "environments"
require_chef_omnibus: true

verifier:
name: inspec

client_rb:
treat_deprecation_warnings_as_errors: true
resource_cloning: false
Expand All @@ -18,8 +21,8 @@ platforms:
- name: ubuntu-16.04
- name: debian-7.10
- name: debian-8.4
- name: centos-6.7
- name: centos-7.2
- name: centos-6.8
- name: centos-7.3
- name: scientific-6.4
driver:
box: lyte-scientific-6-minimal
Expand All @@ -35,7 +38,7 @@ platforms:
suites:
- name: default
run_list:
- recipe[sysctl_test]
- recipe[sysctl_test::default]
- recipe[sysctl_test::tcp_wmem]
- recipe[sysctl::ohai_plugin]
attributes:
Expand Down
56 changes: 48 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,55 @@
sudo: required
dist: trusty

# install the pre-release chef-dk. Use chef-stable-trusty to install the stable release
addons:
apt:
sources:
- chef-stable-trusty
packages:
- chefdk

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/8037ef4b880ec4953fed
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
language: ruby
rvm:
- 2.3.1
bundler_args: --without integration development
script:
- bundle exec foodcritic -f any . --tags ~FC007 --tags ~FC015 --tags ~FC023 --tags ~FC059
- bundle exec rubocop -r cookstyle
- bundle exec rspec

# Don't `bundle install` which takes about 1.5 mins
install: echo "skip bundle install"

branches:
only:
- master

services: docker

env:
matrix:
- INSTANCE=client-centos-6
- INSTANCE=client-centos-7
- INSTANCE=client-ubuntu-1204
- INSTANCE=client-ubuntu-1404
- INSTANCE=client-ubuntu-1604
- INSTANCE=server-centos-6
- INSTANCE=server-centos-7
- INSTANCE=server-ubuntu-1204
- INSTANCE=server-ubuntu-1404
- INSTANCE=server-ubuntu-1604

before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version

script: KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}

matrix:
include:
- script:
- /opt/chefdk/bin/chef exec rake
env: UNIT_AND_LINT=1
23 changes: 0 additions & 23 deletions Gemfile

This file was deleted.

Loading