Skip to content

Commit

Permalink
Update testing suite to use policyfiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bellone committed Jul 10, 2016
1 parent 68bc28a commit 197a810
Show file tree
Hide file tree
Showing 18 changed files with 531 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ vendor
.vagrant
Berksfile.lock
coverage/
*.lock.json
49 changes: 21 additions & 28 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,31 @@ provisioner:
name: chef_zero

platforms:
- name: ubuntu-16.04
named_run_list: debian
- name: ubuntu-14.04
run_list:
- recipe[apt::default]
named_run_list: debian
- name: ubuntu-12.04
run_list:
- recipe[apt::default]
- name: debian-8.2
run_list:
- recipe[apt::default]
- name: debian-7.9
run_list:
- recipe[apt::default]
named_run_list: debian
- name: centos-7.2
run_list:
- recipe[yum::default]
named_run_list: rhel
- name: centos-6.7
run_list:
- recipe[yum::default]
named_run_list: rhel
- name: centos-5.11
run_list:
- recipe[yum::default]
named_run_list: rhel
- name: debian-8.2
named_run_list: debian
- name: debian-7.9
named_run_list: debian
- name: freebsd-10.2
run_list:
- recipe[freebsd::default]
named_run_list: freebsd
- name: windows-2012r2
run_list:
- recipe[windows::default]
named_run_list: windows

suites:
- name: default
run_list:
- recipe[consul_spec::default]
provisioner:
policyfile: test/fixtures/policies/default.rb
attributes:
consul:
config: &default-config
Expand All @@ -48,8 +41,8 @@ suites:
datacenter: FortMeade
encrypt: CGXC2NsXW4AvuB4h5ODYzQ==
- name: git
run_list:
- recipe[consul_spec::default]
provisioner:
policyfile: test/fixtures/policies/default.rb
attributes:
consul:
config: *default-config
Expand All @@ -58,8 +51,8 @@ suites:
excludes:
- windows-2012r2
- name: webui
run_list:
- recipe[consul_spec::default]
provisioner:
policyfile: test/fixtures/policies/default.rb
attributes:
consul:
config:
Expand All @@ -69,8 +62,8 @@ suites:
datacenter: FortMeade
encrypt: CGXC2NsXW4AvuB4h5ODYzQ==
- name: acl
run_list:
- recipe[consul_spec::acl]
provisioner:
policyfile: test/fixtures/policies/acl.rb
attributes:
consul:
config:
Expand Down
10 changes: 0 additions & 10 deletions Berksfile

This file was deleted.

7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ source 'https://rubygems.org'
gem 'poise', '~> 2.2'
gem 'poise-service', '~> 1.0'
gem 'poise-boiler'
gem 'chef-sugar'

group :lint do
gem 'cookstyle'
gem 'rubocop'
gem 'foodcritic'
end

group :unit, :integration do
gem 'chef-sugar'
gem 'chef-dk'
gem 'chefspec'
gem 'berkshelf', '~> 4.0'
gem 'test-kitchen', '~> 1.7.3' # 1.8 requires kitchen.yml changes to support policyfile
gem 'serverspec'
end

group :development do
gem 'awesome_print'
gem 'rake'
gem 'stove'
end

Expand Down
2 changes: 1 addition & 1 deletion Policyfile.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name 'consul'
run_list 'consul::default'
default_source :community
cookbook 'consul', path: '.'
run_list 'consul::default'
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions test/fixtures/policies/_base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
default_source :community
default_source :chef_repo, '..'
cookbook 'consul', path: '../../..'
run_list 'consul::default', "consul_spec::#{name}"
named_run_list :rhel, 'yum::default', run_list
named_run_list :debian, 'apt::default', run_list
named_run_list :freebsd, 'freebsd::default', run_list
named_run_list :windows, 'windows::default', run_list
2 changes: 2 additions & 0 deletions test/fixtures/policies/acl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name 'acl'
instance_eval(IO.read(File.expand_path('../_base.rb', __FILE__)))
Loading

0 comments on commit 197a810

Please sign in to comment.