Skip to content

Commit 9c470ed

Browse files
authored
Merge pull request #516 from schubergphilis/testing
Testing updates
2 parents c46fd93 + afb0cae commit 9c470ed

15 files changed

+233
-132
lines changed

.delivery/project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"

.github/ISSUE_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Cookbook version
2+
[Version of the cookbook where you are encountering the issue]
3+
4+
### Chef-client version
5+
[Version of chef-client in your environment]
6+
7+
### Platform Details
8+
[Operating system distribution and release version. Cloud provider if running in the cloud]
9+
10+
### Scenario:
11+
[What you are trying to achieve and you can't?]
12+
13+
### Steps to Reproduce:
14+
[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
15+
16+
### Expected Result:
17+
[What are you expecting to happen as the consequence of above reproduction steps?]
18+
19+
### Actual Result:
20+
[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Description
2+
3+
[Describe what this change achieves]
4+
5+
### Issues Resolved
6+
7+
[List any existing issues this PR resolves]
8+
9+
### Check List
10+
11+
- [ ] All tests pass. See <https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD>
12+
- [ ] New functionality includes testing.
13+
- [ ] New functionality has been documented in the README if applicable

.kitchen.dokken.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
driver:
2+
name: dokken
3+
privileged: true # because Docker and SystemD/Upstart
4+
chef_version: current
5+
6+
transport:
7+
name: dokken
8+
9+
provisioner:
10+
name: dokken
11+
deprecations_as_errors: true
12+
13+
verifier:
14+
name: inspec
15+
16+
platforms:
17+
- name: debian-7
18+
driver:
19+
image: debian:7
20+
pid_one_command: /sbin/init
21+
intermediate_instructions:
22+
- RUN /usr/bin/apt-get update
23+
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y
24+
25+
- name: debian-8
26+
driver:
27+
image: debian:8
28+
pid_one_command: /bin/systemd
29+
intermediate_instructions:
30+
- RUN /usr/bin/apt-get update
31+
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y
32+
33+
- name: centos-6
34+
driver:
35+
image: centos:6
36+
platform: rhel
37+
pid_one_command: /sbin/init
38+
intermediate_instructions:
39+
- RUN yum -y install lsof which initscripts net-tools wget net-tools
40+
41+
- name: centos-7
42+
driver:
43+
image: centos:7
44+
platform: rhel
45+
pid_one_command: /usr/lib/systemd/systemd
46+
intermediate_instructions:
47+
- RUN yum -y install lsof which systemd-sysv initscripts wget net-tools
48+
49+
- name: fedora-latest
50+
driver:
51+
image: fedora:latest
52+
pid_one_command: /usr/lib/systemd/systemd
53+
intermediate_instructions:
54+
- RUN dnf -y install which systemd-sysv initscripts wget net-tools
55+
56+
- name: ubuntu-14.04
57+
driver:
58+
image: ubuntu-upstart:14.04
59+
pid_one_command: /sbin/init
60+
intermediate_instructions:
61+
- RUN /usr/bin/apt-get update
62+
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y
63+
64+
- name: ubuntu-16.04
65+
driver:
66+
image: ubuntu:16.04
67+
pid_one_command: /bin/systemd
68+
intermediate_instructions:
69+
- RUN /usr/bin/apt-get update
70+
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y
71+
72+
- name: opensuse-leap
73+
driver:
74+
image: opensuse:leap
75+
pid_one_command: /bin/systemd
76+
intermediate_instructions:
77+
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which net-tools
78+
79+
suites:
80+
- name: server_package
81+
run_list:
82+
- recipe[nagios::default]
83+
- recipe[nrpe::default]
84+
- recipe[nagios_test::default]
85+
- role[monitoring]
86+
attributes:
87+
nagios:
88+
- name: server_source
89+
run_list:
90+
- recipe[nagios::default]
91+
- recipe[nrpe::default]
92+
- recipe[nagios_test::default]
93+
- role[monitoring]
94+
attributes:
95+
nagios:
96+
server:
97+
install_method: 'source'
98+
- name: pagerduty
99+
run_list:
100+
- recipe[nagios::default]
101+
- recipe[nagios::pagerduty]
102+
- recipe[nrpe::default]
103+
- recipe[nagios_test::default]
104+
- role[monitoring]
105+
attributes:
106+
nagios:
107+
server:
108+
install_method: 'source'
109+
pagerduty:
110+
key: 'your_key_here_3eC2'
111+
- name: allowed_ips
112+
run_list:
113+
- recipe[nagios::default]
114+
- recipe[nrpe::default]
115+
- recipe[nagios_test::default]
116+
- role[monitoring]
117+
attributes:
118+
nagios:
119+
allowed_ips: ['127.0.0.1', '::1']
120+
data_bags_path: test/data_bags
121+
roles_path: test/roles

.kitchen.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ provisioner:
55
name: chef_zero
66

77
platforms:
8-
- name: ubuntu-12.04
9-
driver_config:
10-
network:
11-
- ["forwarded_port", {guest: 80, host: 8080}]
12-
run_list:
13-
- recipe[apt::default]
148
- name: ubuntu-14.04
159
driver_config:
1610
network:
@@ -35,18 +29,14 @@ platforms:
3529
- ["forwarded_port", {guest: 80, host: 8084}]
3630
run_list:
3731
- recipe[apt::default]
38-
- name: freebsd-9.3
32+
- name: freebsd-10.3
3933
driver_config:
4034
network:
4135
- ["forwarded_port", {guest: 80, host: 8085}]
42-
run_list:
43-
- recipe[freebsd::portsnap]
44-
- name: freebsd-10.3
36+
- name: freebsd-11.0
4537
driver_config:
4638
network:
4739
- ["forwarded_port", {guest: 80, host: 8086}]
48-
run_list:
49-
- recipe[freebsd::portsnap]
5040
- name: centos-7.3
5141
driver_config:
5242
network:

.travis.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
1-
# Use Travis's cointainer based infrastructure
2-
sudo: false
1+
sudo: required
2+
dist: trusty
3+
34
addons:
45
apt:
56
sources:
6-
- chef-current-precise
7+
- chef-stable-trusty
78
packages:
89
- chefdk
910

10-
# Don't `bundle install`
11+
# Don't `bundle install` which takes about 1.5 mins
1112
install: echo "skip bundle install"
1213

1314
branches:
1415
only:
1516
- master
1617

17-
# Ensure we make ChefDK's Ruby the default
18+
services: docker
19+
20+
env:
21+
matrix:
22+
- INSTANCE=server-package-centos-6
23+
- INSTANCE=server-package-centos-7
24+
- INSTANCE=server-package-debian-7
25+
- INSTANCE=server-package-debian-8
26+
- INSTANCE=server-package-fedora-latest
27+
- INSTANCE=server-package-opensuse-leap
28+
- INSTANCE=server-package-ubuntu-1404
29+
- INSTANCE=server-package-ubuntu-1604
30+
1831
before_script:
32+
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
1933
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
20-
# We have to install chef-sugar for ChefSpec
21-
- /opt/chefdk/embedded/bin/chef gem install chef-sugar
22-
23-
script:
2434
- /opt/chefdk/embedded/bin/chef --version
2535
- /opt/chefdk/embedded/bin/cookstyle --version
2636
- /opt/chefdk/embedded/bin/foodcritic --version
27-
- /opt/chefdk/bin/chef exec rake style
28-
- /opt/chefdk/bin/chef exec rake spec
37+
38+
script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}
39+
40+
matrix:
41+
include:
42+
- script:
43+
- /opt/chefdk/bin/chef exec delivery local all
44+
env: UNIT_AND_LINT=1

Berksfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ metadata
44

55
group :integration do
66
cookbook 'apt'
7-
cookbook 'freebsd'
87
cookbook 'nagios_test', path: './test/fixtures/cookbooks/nagios_test'
98
end

Gemfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1+
# This gemfile provides additional gems for testing and releasing this cookbook
2+
# It is meant to be installed on top of ChefDK which provides the majority
3+
# of the necessary gems for testing this cookbook
4+
#
5+
# Run 'chef exec bundle install' to install these dependencies
6+
17
source 'https://rubygems.org'
28

3-
gem 'berkshelf', '>= 4.3'
4-
gem 'chefspec', '~> 4.7'
5-
gem 'cookstyle'
6-
gem 'foodcritic', '~> 7.0'
7-
gem 'kitchen-dokken'
8-
gem 'kitchen-inspec', '>= 0.14'
9-
gem 'kitchen-vagrant', '>= 0.20'
10-
gem 'rake'
119
gem 'stove'
12-
gem 'test-kitchen', '>= 1.10'

0 commit comments

Comments
 (0)