-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(kitchen+travis+inspec): add initial platforms and test structure
* Automated using myii/ssf-formula#157
- Loading branch information
Showing
5 changed files
with
340 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'kitchen' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
require 'pathname' | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', | ||
Pathname.new(__FILE__).realpath) | ||
|
||
bundle_binstub = File.expand_path('bundle', __dir__) | ||
|
||
if File.file?(bundle_binstub) | ||
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ | ||
load(bundle_binstub) | ||
else | ||
abort( | ||
'Your `bin/bundle` was not generated by Bundler, '\ | ||
'so this binstub cannot run. Replace `bin/bundle` by running '\ | ||
'`bundle binstubs bundler --force`, then run this command again.' | ||
) | ||
end | ||
end | ||
|
||
require 'rubygems' | ||
require 'bundler/setup' | ||
|
||
load Gem.bin_path('test-kitchen', 'kitchen') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
--- | ||
# For help on this file's format, see https://kitchen.ci/ | ||
driver: | ||
name: docker | ||
use_sudo: false | ||
privileged: true | ||
run_command: /lib/systemd/systemd | ||
|
||
# Make sure the platforms listed below match up with | ||
# the `env.matrix` instances defined in `.travis.yml` | ||
platforms: | ||
## SALT `master` | ||
- name: debian-10-master-py3 | ||
driver: | ||
image: netmanagers/salt-master-py3:debian-10 | ||
- name: ubuntu-1804-master-py3 | ||
driver: | ||
image: netmanagers/salt-master-py3:ubuntu-18.04 | ||
- name: centos-8-master-py3 | ||
driver: | ||
image: netmanagers/salt-master-py3:centos-8 | ||
- name: fedora-31-master-py3 | ||
driver: | ||
image: netmanagers/salt-master-py3:fedora-31 | ||
- name: opensuse-leap-151-master-py3 | ||
driver: | ||
image: netmanagers/salt-master-py3:opensuse-leap-15.1 | ||
run_command: /usr/lib/systemd/systemd | ||
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`: | ||
# => SCP did not finish successfully (255): (Net::SCP::Error) | ||
transport: | ||
max_ssh_sessions: 1 | ||
- name: amazonlinux-2-master-py3 | ||
driver: | ||
image: netmanagers/salt-master-py3:amazonlinux-2 | ||
- name: arch-base-latest-master-py2 | ||
driver: | ||
image: netmanagers/salt-master-py2:arch-base-latest | ||
run_command: /usr/lib/systemd/systemd | ||
|
||
## SALT `3000.1` | ||
- name: debian-10-3000-1-py3 | ||
driver: | ||
image: netmanagers/salt-3000.1-py3:debian-10 | ||
- name: ubuntu-1804-3000-1-py3 | ||
driver: | ||
image: netmanagers/salt-3000.1-py3:ubuntu-18.04 | ||
- name: centos-8-3000-1-py3 | ||
driver: | ||
image: netmanagers/salt-3000.1-py3:centos-8 | ||
- name: fedora-31-3000-1-py3 | ||
driver: | ||
image: netmanagers/salt-3000.1-py3:fedora-31 | ||
- name: opensuse-leap-151-3000-1-py3 | ||
driver: | ||
image: netmanagers/salt-3000.1-py3:opensuse-leap-15.1 | ||
run_command: /usr/lib/systemd/systemd | ||
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`: | ||
# => SCP did not finish successfully (255): (Net::SCP::Error) | ||
transport: | ||
max_ssh_sessions: 1 | ||
- name: amazonlinux-2-3000-1-py3 | ||
driver: | ||
image: netmanagers/salt-3000.1-py3:amazonlinux-2 | ||
- name: arch-base-latest-3000-1-py2 | ||
driver: | ||
image: netmanagers/salt-3000.1-py2:arch-base-latest | ||
run_command: /usr/lib/systemd/systemd | ||
|
||
## SALT `2019.2` | ||
- name: debian-10-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:debian-10 | ||
- name: debian-9-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:debian-9 | ||
- name: ubuntu-1804-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:ubuntu-18.04 | ||
- name: ubuntu-1604-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:ubuntu-16.04 | ||
- name: centos-8-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:centos-8 | ||
- name: centos-7-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:centos-7 | ||
- name: fedora-31-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:fedora-31 | ||
- name: opensuse-leap-151-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:opensuse-leap-15.1 | ||
run_command: /usr/lib/systemd/systemd | ||
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`: | ||
# => SCP did not finish successfully (255): (Net::SCP::Error) | ||
transport: | ||
max_ssh_sessions: 1 | ||
- name: amazonlinux-2-2019-2-py3 | ||
driver: | ||
image: netmanagers/salt-2019.2-py3:amazonlinux-2 | ||
- name: ubuntu-1804-2019-2-py2 | ||
driver: | ||
image: netmanagers/salt-2019.2-py2:ubuntu-18.04 | ||
- name: amazonlinux-1-2019-2-py2 | ||
driver: | ||
image: netmanagers/salt-2019.2-py2:amazonlinux-1 | ||
run_command: /sbin/init | ||
- name: arch-base-latest-2019-2-py2 | ||
driver: | ||
image: netmanagers/salt-2019.2-py2:arch-base-latest | ||
run_command: /usr/lib/systemd/systemd | ||
|
||
## SALT `2018.3` | ||
- name: centos-7-2018-3-py3 | ||
driver: | ||
image: netmanagers/salt-2018.3-py3:centos-7 | ||
- name: fedora-30-2018-3-py3 | ||
driver: | ||
image: netmanagers/salt-2018.3-py3:fedora-30 | ||
- name: debian-9-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:debian-9 | ||
- name: debian-8-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:debian-8 | ||
- name: ubuntu-1804-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:ubuntu-18.04 | ||
- name: ubuntu-1604-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:ubuntu-16.04 | ||
- name: centos-6-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:centos-6 | ||
run_command: /sbin/init | ||
- name: opensuse-leap-151-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1 | ||
run_command: /usr/lib/systemd/systemd | ||
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`: | ||
# => SCP did not finish successfully (255): (Net::SCP::Error) | ||
transport: | ||
max_ssh_sessions: 1 | ||
- name: amazonlinux-1-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:amazonlinux-1 | ||
run_command: /sbin/init | ||
- name: arch-base-latest-2018-3-py2 | ||
driver: | ||
image: netmanagers/salt-2018.3-py2:arch-base-latest | ||
run_command: /usr/lib/systemd/systemd | ||
|
||
provisioner: | ||
name: salt_solo | ||
log_level: debug | ||
salt_install: none | ||
require_chef: false | ||
formula: powerdns | ||
salt_copy_filter: | ||
- .kitchen | ||
- .git | ||
|
||
verifier: | ||
# https://www.inspec.io/ | ||
name: inspec | ||
sudo: true | ||
# cli, documentation, html, progress, json, json-min, json-rspec, junit | ||
reporter: | ||
- cli | ||
|
||
suites: | ||
- name: default | ||
provisioner: | ||
state_top: | ||
base: | ||
'*': | ||
- powerdns.config | ||
- powerdns.backend-sqlite3 | ||
pillars: | ||
top.sls: | ||
base: | ||
'*': | ||
- powerdns | ||
pillars_from_files: | ||
powerdns.sls: test/salt/pillar/default.sls | ||
verifier: | ||
inspec_tests: | ||
- path: test/integration/default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# InSpec Profile: `default` | ||
|
||
This shows the implementation of the `default` InSpec [profile](/~https://github.com/inspec/inspec/blob/master/docs/profiles.md). | ||
|
||
## Verify a profile | ||
|
||
InSpec ships with built-in features to verify a profile structure. | ||
|
||
```bash | ||
$ inspec check default | ||
Summary | ||
------- | ||
Location: default | ||
Profile: profile | ||
Controls: 4 | ||
Timestamp: 2019-06-24T23:09:01+00:00 | ||
Valid: true | ||
|
||
Errors | ||
------ | ||
|
||
Warnings | ||
-------- | ||
``` | ||
|
||
## Execute a profile | ||
|
||
To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. | ||
|
||
```bash | ||
$ inspec exec default | ||
.. | ||
|
||
Finished in 0.0025 seconds (files took 0.12449 seconds to load) | ||
8 examples, 0 failures | ||
``` | ||
|
||
## Execute a specific control from a profile | ||
|
||
To run one control from the profile use `inspec exec /path/to/profile --controls name`. | ||
|
||
```bash | ||
$ inspec exec default --controls package | ||
. | ||
|
||
Finished in 0.0025 seconds (files took 0.12449 seconds to load) | ||
1 examples, 0 failures | ||
``` | ||
|
||
See an [example control here](/~https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
--- | ||
name: default | ||
title: powerdns formula | ||
maintainer: SaltStack Formulas | ||
license: Apache-2.0 | ||
summary: Verify that the powerdns formula is setup and configured correctly | ||
supports: | ||
- platform-name: debian | ||
- platform-name: ubuntu | ||
- platform-name: centos | ||
- platform-name: fedora | ||
- platform-name: opensuse | ||
- platform-name: suse | ||
- platform-name: freebsd | ||
- platform-name: amazon | ||
- platform-name: arch |