summaryrefslogtreecommitdiff
path: root/acceptance
diff options
context:
space:
mode:
authorSalim Alam <salam@chef.io>2016-02-07 20:58:25 -0800
committerSalim Alam <salam@chef.io>2016-02-07 20:58:25 -0800
commitbef17839db105640f04d1d4d4b2e217d46df4224 (patch)
tree8fa174bb6b3b97b2c99197bdb68d2b88974dd503 /acceptance
parentd673dc361f2830066071c786486f39faeba8841f (diff)
parent757f38cf5a004dbd3f97c8eff30761744b4051cd (diff)
downloadchef-bef17839db105640f04d1d4d4b2e217d46df4224.tar.gz
Merge pull request #4528 from chef/salam/unique-gems
Add basics suite, refactor to share common infra
Diffstat (limited to 'acceptance')
-rw-r--r--acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml (renamed from acceptance/cookbook-git/.kitchen.digitalocean.yml)6
-rw-r--r--acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml (renamed from acceptance/cookbook-git/.kitchen.ec2.yml)37
-rw-r--r--acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml47
-rw-r--r--acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb43
-rw-r--r--acceptance/.shared/kitchen_acceptance/metadata.rb1
-rw-r--r--acceptance/basics/.acceptance/acceptance-cookbook/.gitignore2
-rw-r--r--acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb3
-rw-r--r--acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb1
-rw-r--r--acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb1
-rw-r--r--acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb1
-rw-r--r--acceptance/basics/.kitchen.yml4
-rw-r--r--acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb19
-rw-r--r--acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb6
-rw-r--r--acceptance/cookbook-git/.acceptance/acceptance-cookbook/libraries/init.rb2
-rw-r--r--acceptance/cookbook-git/.acceptance/acceptance-cookbook/metadata.rb4
-rw-r--r--acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/destroy.rb8
-rw-r--r--acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/provision.rb8
-rw-r--r--acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/verify.rb9
-rw-r--r--acceptance/cookbook-git/.kitchen.vagrant.yml72
-rw-r--r--acceptance/cookbook-git/.kitchen.yml10
-rw-r--r--acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb3
-rw-r--r--acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb4
-rw-r--r--acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb4
-rw-r--r--acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb4
-rw-r--r--acceptance/trivial/.kitchen.yml22
-rw-r--r--acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb6
-rw-r--r--acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore2
-rw-r--r--acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb3
-rw-r--r--acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb4
-rw-r--r--acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb4
-rw-r--r--acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb4
-rw-r--r--acceptance/windows-service/.kitchen.yml21
32 files changed, 186 insertions, 179 deletions
diff --git a/acceptance/cookbook-git/.kitchen.digitalocean.yml b/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml
index 29733210c7..50558c3d39 100644
--- a/acceptance/cookbook-git/.kitchen.digitalocean.yml
+++ b/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml
@@ -9,6 +9,12 @@ driver:
transport:
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
+provisioner:
+ name: chef_zero
+ product_name: chef
+ product_version: latest
+ channel: current
+
platforms:
<% %w(centos-6.5 centos-7.0
fedora-21
diff --git a/acceptance/cookbook-git/.kitchen.ec2.yml b/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml
index ba323aa65f..fc82c907e6 100644
--- a/acceptance/cookbook-git/.kitchen.ec2.yml
+++ b/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml
@@ -25,6 +25,12 @@ transport:
file_if_exists("~/.ssh/#{ENV['AWS_SSH_KEY_ID'] || ENV['USER'] || ENV['USERNAME']}") ||
file_if_exists("~/.ssh/id_rsa") %>
+provisioner:
+ name: chef_zero
+ product_name: <%= ENV["KITCHEN_CHEF_PRODUCT"] %>
+ product_version: <%= ENV["KITCHEN_CHEF_VERSION"] %>
+ channel: <%= ENV["KITCHEN_CHEF_CHANNEL"] %>
+
platforms:
#
# AIX
@@ -271,34 +277,3 @@ platforms:
virtualization-type: hvm
block-device-mapping.volume-type: gp2
image-type: machine
-
-suites:
- - name: default
- run_list:
- - recipe[git]
- attributes: {}
- includes: ["ubuntu-14.04"]
- excludes: ["windows-2012r2", "windows-2012", "windows-2008r2"]
- - name: source
- includes: ["nonexistent"]
- excludes: ["ubuntu-12.04", "ubuntu-10.04", "windows-2012r2", "windows-2012", "windows-2008r2"]
- run_list:
- - recipe[git::source]
- attributes: {}
- - name: default-windows
- includes: [
- # 'windows-8.1-professional',
- # 'windows-2008r2-standard',
- "windows-2012r2",
- # "windows-2012",
- # "windows-2008r2"
- ]
- run_list:
- - recipe[git]
- attributes: {}
-
-provisioner:
- name: chef_zero
- product_name: chef
- product_version: latest
- channel: unstable
diff --git a/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml b/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml
new file mode 100644
index 0000000000..f978658477
--- /dev/null
+++ b/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml
@@ -0,0 +1,47 @@
+driver:
+ name: vagrant
+ forward_agent: yes
+ customize:
+ cpus: 2
+ memory: 1024
+
+provisioner:
+ name: chef_zero
+ product_name: <%= ENV["KITCHEN_CHEF_PRODUCT"] %>
+ product_version: <%= ENV["KITCHEN_CHEF_VERSION"] %>
+ channel: <%= ENV["KITCHEN_CHEF_CHANNEL"] %>
+
+platforms:
+<% %w(
+debian-8
+debian-7
+debian-6
+ubuntu-15.10
+ubuntu-14.04
+el-7
+el-6
+el-5
+freebsd-10
+freebsd-9
+fedora-21
+).each do |platform| %>
+ - name: <%= platform %>
+ driver:
+ box: opscode-<%= platform %>
+ box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_<%= platform %>_chef-provisionerless.box
+<% end %>
+# freebsd-8
+# ubuntu-12.04
+# centos-7
+# centos-6
+
+<% %w(
+2012r2
+2012
+2008r2
+).each do |version| %>
+ - name: windows-<%= version %>
+ driver:
+ box: chef/windows-server-<%= version %>-standard
+# URL is atlas
+<% end %>
diff --git a/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb b/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb
new file mode 100644
index 0000000000..5380b7002c
--- /dev/null
+++ b/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb
@@ -0,0 +1,43 @@
+class Kitchen < Chef::Resource
+ resource_name :kitchen
+
+ property :command, String, name_property: true
+ property :driver, %w(ec2 vagrant), coerce: proc { |v| v.to_s }, default: lazy { ENV["KITCHEN_DRIVER"] || :ec2 }
+ property :instances, String, default: lazy { ENV["KITCHEN_INSTANCES"] }
+ property :kitchen_dir, String, default: Chef.node['chef-acceptance']['suite-dir']
+ property :chef_product, String, default: lazy {
+ ENV["KITCHEN_CHEF_PRODUCT"] ||
+ # If we're running the chef or chefdk projects in jenkins, pick up the project name.
+ (%w(chef chefdk).include?(ENV["PROJECT_NAME"]) ? ENV["PROJECT_NAME"] : "chef")
+ }
+ property :chef_channel, String, default: lazy {
+ ENV["KITCHEN_CHEF_CHANNEL"] ||
+ # Pick up current if we can't connect to artifactory
+ (ENV["ARTIFACTORY_USERNAME"] ? "unstable" : "current")
+ }
+ property :chef_version, String, default: lazy {
+ ENV["KITCHEN_CHEF_VERSION"] ||
+ # If we're running the chef or chefdk projects in jenkins, pick up the project name.
+ (ENV["PROJECT_NAME"] == chef_product ? ENV["OMNIBUS_BUILD_VERSION"] : nil) ||
+ "latest"
+ }
+ property :artifactory_username, String, default: lazy { ENV["ARTIFACTORY_USERNAME"] }
+ property :artifactory_password, String, default: lazy { ENV["ARTIFACTORY_PASSWORD"] }
+ property :env, Hash, default: {}
+
+ action :run do
+ execute "bundle exec kitchen #{command}#{instances ? " #{instances}" : ""}" do
+ cwd kitchen_dir
+ env({
+ "KITCHEN_DRIVER" => driver,
+ "KITCHEN_INSTANCES" => instances,
+ "KITCHEN_LOCAL_YAML" => ::File.expand_path("../../.kitchen.#{driver}.yml", __FILE__),
+ "KITCHEN_CHEF_PRODUCT" => chef_product,
+ "KITCHEN_CHEF_CHANNEL" => chef_channel,
+ "KITCHEN_CHEF_VERSION" => chef_version,
+ "ARTIFACTORY_USERNAME" => artifactory_username,
+ "ARTIFACTORY_PASSWORD" => artifactory_password
+ }.merge(new_resource.env))
+ end
+ end
+end
diff --git a/acceptance/.shared/kitchen_acceptance/metadata.rb b/acceptance/.shared/kitchen_acceptance/metadata.rb
new file mode 100644
index 0000000000..70dc342d09
--- /dev/null
+++ b/acceptance/.shared/kitchen_acceptance/metadata.rb
@@ -0,0 +1 @@
+name "kitchen_acceptance"
diff --git a/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore b/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore
new file mode 100644
index 0000000000..041413b040
--- /dev/null
+++ b/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore
@@ -0,0 +1,2 @@
+nodes/
+tmp/
diff --git a/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb b/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb
new file mode 100644
index 0000000000..2b7547b70d
--- /dev/null
+++ b/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb
@@ -0,0 +1,3 @@
+name 'acceptance-cookbook'
+
+depends "kitchen_acceptance"
diff --git a/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb b/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb
new file mode 100644
index 0000000000..e2d663ac2f
--- /dev/null
+++ b/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb
@@ -0,0 +1 @@
+kitchen "destroy"
diff --git a/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb b/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb
new file mode 100644
index 0000000000..5726c0e7b5
--- /dev/null
+++ b/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb
@@ -0,0 +1 @@
+kitchen "converge"
diff --git a/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb b/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb
new file mode 100644
index 0000000000..05ac94ce66
--- /dev/null
+++ b/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb
@@ -0,0 +1 @@
+kitchen "verify"
diff --git a/acceptance/basics/.kitchen.yml b/acceptance/basics/.kitchen.yml
new file mode 100644
index 0000000000..4b7a516396
--- /dev/null
+++ b/acceptance/basics/.kitchen.yml
@@ -0,0 +1,4 @@
+suites:
+ - name: chef-current-install
+ includes: [ubuntu-14.04, windows-server-2012r2]
+ run_list:
diff --git a/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb b/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb
new file mode 100644
index 0000000000..f545d7212a
--- /dev/null
+++ b/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb
@@ -0,0 +1,19 @@
+
+require 'spec_helper'
+
+gem_path = "/opt/chef/embedded/bin/gem"
+white_list = %w{chef-config json rake}
+
+describe "gem list" do
+ it "should not have non-whitelisted duplicate gems" do
+ gems = command("#{gem_path} list").stdout
+
+ duplicate_gems = gems.lines().select { |l| l.include?(',') }.collect { |l| l.split(' ').first }
+ puts "Duplicate gems found: #{duplicate_gems}" if duplicate_gems.length > 0
+
+ non_whitelisted_duplicates = duplicate_gems.select { |l| !white_list.include?(l) }
+ puts "Non white listed duplicates: #{non_whitelisted_duplicates}" if non_whitelisted_duplicates.length > 0
+
+ (non_whitelisted_duplicates.length).should be == 0
+ end
+end
diff --git a/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb b/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb
new file mode 100644
index 0000000000..0970d19749
--- /dev/null
+++ b/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb
@@ -0,0 +1,6 @@
+require 'serverspec'
+require 'pathname'
+
+set :backend, :exec
+
+set :path, '/bin:/usr/local/bin:$PATH'
diff --git a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/libraries/init.rb b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/libraries/init.rb
index d3d3db451e..8561d6e798 100644
--- a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/libraries/init.rb
+++ b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/libraries/init.rb
@@ -15,5 +15,3 @@ module CookbookGit
File.join(acceptance_path, "Gemfile")
end
end
-
-ENV["KITCHEN_LOCAL_YAML"] ||= File.join(Chef.node["chef-acceptance"]["suite-dir"], ".kitchen.#{ENV["KITCHEN_DRIVER"] || "ec2"}.yml")
diff --git a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/metadata.rb b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/metadata.rb
index 4c7c42d9bd..26cdab4e99 100644
--- a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/metadata.rb
+++ b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/metadata.rb
@@ -1 +1,3 @@
-name 'acceptance-cookbook'
+name "acceptance-cookbook"
+
+depends "kitchen_acceptance"
diff --git a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/destroy.rb b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/destroy.rb
index faf9a87a86..fce4a2f315 100644
--- a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/destroy.rb
+++ b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/destroy.rb
@@ -1,5 +1,7 @@
# Run the test on the current platform
-execute "bundle exec kitchen destroy #{ENV['KITCHEN_INSTANCES']}" do
- cwd "#{CookbookGit.test_run_path}/#{CookbookGit.test_cookbook_name}"
- env "BUNDLE_GEMFILE" => CookbookGit.acceptance_gemfile
+kitchen "destroy" do
+ kitchen_dir "#{CookbookGit.test_run_path}/#{CookbookGit.test_cookbook_name}"
+ env "BUNDLE_GEMFILE" => CookbookGit.acceptance_gemfile,
+ "KITCHEN_GLOBAL_YAML" => ::File.join(CookbookGit.test_run_path, CookbookGit.test_cookbook_name, ".kitchen.yml"),
+ "KITCHEN_YAML" => ::File.join(node["chef-acceptance"]["suite-dir"], ".kitchen.yml")
end
diff --git a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/provision.rb b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/provision.rb
index 878de27f54..39cbafc7dd 100644
--- a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/provision.rb
+++ b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/provision.rb
@@ -9,7 +9,9 @@ git "#{CookbookGit.test_run_path}/#{CookbookGit.test_cookbook_name}" do
end
# Run the test on the current platform
-execute "bundle exec kitchen converge #{ENV['KITCHEN_INSTANCES']} -c" do
- cwd "#{CookbookGit.test_run_path}/#{CookbookGit.test_cookbook_name}"
- env "BUNDLE_GEMFILE" => CookbookGit.acceptance_gemfile
+kitchen "converge" do
+ kitchen_dir "#{CookbookGit.test_run_path}/#{CookbookGit.test_cookbook_name}"
+ env "BUNDLE_GEMFILE" => CookbookGit.acceptance_gemfile,
+ "KITCHEN_GLOBAL_YAML" => ::File.join(CookbookGit.test_run_path, CookbookGit.test_cookbook_name, ".kitchen.yml"),
+ "KITCHEN_YAML" => ::File.join(node["chef-acceptance"]["suite-dir"], ".kitchen.yml")
end
diff --git a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/verify.rb b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/verify.rb
index 55b362d131..84004bab3a 100644
--- a/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/verify.rb
+++ b/acceptance/cookbook-git/.acceptance/acceptance-cookbook/recipes/verify.rb
@@ -1,5 +1,6 @@
-# Run tests on the current platform
-execute "bundle exec kitchen verify #{ENV['KITCHEN_INSTANCES']} -c" do
- cwd "#{CookbookGit.test_run_path}/#{CookbookGit.test_cookbook_name}"
- env "BUNDLE_GEMFILE" => CookbookGit.acceptance_gemfile
+kitchen "verify" do
+ kitchen_dir "#{CookbookGit.test_run_path}/#{CookbookGit.test_cookbook_name}"
+ env "BUNDLE_GEMFILE" => CookbookGit.acceptance_gemfile,
+ "KITCHEN_GLOBAL_YAML" => ::File.join(CookbookGit.test_run_path, CookbookGit.test_cookbook_name, ".kitchen.yml"),
+ "KITCHEN_YAML" => ::File.join(node["chef-acceptance"]["suite-dir"], ".kitchen.yml")
end
diff --git a/acceptance/cookbook-git/.kitchen.vagrant.yml b/acceptance/cookbook-git/.kitchen.vagrant.yml
deleted file mode 100644
index 0dc8b11dc1..0000000000
--- a/acceptance/cookbook-git/.kitchen.vagrant.yml
+++ /dev/null
@@ -1,72 +0,0 @@
-driver:
- name: vagrant
- forward_agent: yes
- customize:
- cpus: 2
- memory: 1024
-
-platforms:
-<% %w(
-debian-8
-debian-7
-debian-6
-ubuntu-15.10
-ubuntu-14.04
-el-7
-el-6
-el-5
-freebsd-10
-freebsd-9
-fedora-21
-).each do |platform| %>
- - name: <%= platform %>
- driver:
- box: opscode-<%= platform %>
- box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_<%= platform %>_chef-provisionerless.box
-<% end %>
-# freebsd-8
-# ubuntu-12.04
-# centos-7
-# centos-6
-
-<% %w(
-2012r2
-2012
-2008r2
-).each do |version| %>
- - name: windows-<%= version %>
- driver:
- box: chef/windows-server-<%= version %>-standard
-# URL is atlas
-<% end %>
-
-suites:
- - name: default
- run_list:
- - recipe[git]
- attributes: {}
- includes: ["ubuntu-14.04"]
- excludes: ["windows-2012r2", "windows-2012", "windows-2008r2"]
- - name: source
- includes: ["nonexistent"]
- excludes: ["ubuntu-12.04", "ubuntu-10.04", "windows-2012r2", "windows-2012", "windows-2008r2"]
- run_list:
- - recipe[git::source]
- attributes: {}
- - name: default-windows
- includes: [
- # 'windows-8.1-professional',
- # 'windows-2008r2-standard',
- "windows-2012r2",
- # "windows-2012",
- # "windows-2008r2"
- ]
- run_list:
- - recipe[git]
- attributes: {}
-
-provisioner:
- name: chef_zero
- product_name: chef
- product_version: latest
- channel: current
diff --git a/acceptance/cookbook-git/.kitchen.yml b/acceptance/cookbook-git/.kitchen.yml
new file mode 100644
index 0000000000..d087446a40
--- /dev/null
+++ b/acceptance/cookbook-git/.kitchen.yml
@@ -0,0 +1,10 @@
+suites:
+ - name: default
+ run_list: ["recipe[git]"]
+ includes: [ubuntu-14.04]
+ - name: source
+ run_list: ["recipe[git::source]"]
+ includes: [nonexistent]
+ - name: default-windows
+ run_list: ["recipe[git]"]
+ includes: [windows-2012r2]
diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb
index 4c7c42d9bd..6c754560f0 100644
--- a/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb
+++ b/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb
@@ -1 +1,2 @@
-name 'acceptance-cookbook'
+name "acceptance-cookbook"
+depends "kitchen_acceptance"
diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb
index f226ea2d10..e2d663ac2f 100644
--- a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb
+++ b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb
@@ -1,3 +1 @@
-execute 'bundle exec kitchen destroy' do
- cwd node['chef-acceptance']['suite-dir']
-end
+kitchen "destroy"
diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb
index 2763aba70c..a6f148f7ad 100644
--- a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb
+++ b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb
@@ -1,3 +1 @@
-execute 'bundle exec kitchen converge' do
- cwd node['chef-acceptance']['suite-dir']
-end
+kitchen "setup"
diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb
index c0b67bf500..05ac94ce66 100644
--- a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb
+++ b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb
@@ -1,3 +1 @@
-execute 'bundle exec kitchen verify' do
- cwd node['chef-acceptance']['suite-dir']
-end
+kitchen "verify"
diff --git a/acceptance/trivial/.kitchen.yml b/acceptance/trivial/.kitchen.yml
index c0f1d782d2..1e0af03503 100644
--- a/acceptance/trivial/.kitchen.yml
+++ b/acceptance/trivial/.kitchen.yml
@@ -1,27 +1,7 @@
-driver:
- name: vagrant
- forward_agent: yes
- customize:
- cpus: 2
- memory: 1024
-
-provisioner:
- name: chef_zero
-
verifier:
name: inspec
-platforms:
- - name: ubuntu-14.04
- run_list:
-# - name: windows-server-2012r2-standard
-# driver:
-# box: chef/windows-server-2012r2-standard # private
-
suites:
- name: chef-current-install
- provisioner:
- product_name: chef
- product_version: latest
- channel: unstable
+ includes: [windows-2012r2]
run_list:
diff --git a/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb b/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb
index 0564080caf..f125d70953 100644
--- a/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb
+++ b/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb
@@ -1,3 +1,5 @@
-describe command("chef-client") do
- it { should exist }
+chef_version = ENV["KITCHEN_CHEF_VERSION"].split("+")[0]
+describe command("chef-client -v") do
+ its("exit_status") { should eq 0 }
+ its(:stdout) { should match /Chef: #{chef_version}/ }
end
diff --git a/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore b/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore
new file mode 100644
index 0000000000..041413b040
--- /dev/null
+++ b/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore
@@ -0,0 +1,2 @@
+nodes/
+tmp/
diff --git a/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb b/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb
index 4c7c42d9bd..6c754560f0 100644
--- a/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb
+++ b/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb
@@ -1 +1,2 @@
-name 'acceptance-cookbook'
+name "acceptance-cookbook"
+depends "kitchen_acceptance"
diff --git a/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb b/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb
index f226ea2d10..e2d663ac2f 100644
--- a/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb
+++ b/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb
@@ -1,3 +1 @@
-execute 'bundle exec kitchen destroy' do
- cwd node['chef-acceptance']['suite-dir']
-end
+kitchen "destroy"
diff --git a/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb b/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb
index 2763aba70c..5726c0e7b5 100644
--- a/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb
+++ b/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb
@@ -1,3 +1 @@
-execute 'bundle exec kitchen converge' do
- cwd node['chef-acceptance']['suite-dir']
-end
+kitchen "converge"
diff --git a/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb b/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb
index c0b67bf500..05ac94ce66 100644
--- a/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb
+++ b/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb
@@ -1,3 +1 @@
-execute 'bundle exec kitchen verify' do
- cwd node['chef-acceptance']['suite-dir']
-end
+kitchen "verify"
diff --git a/acceptance/windows-service/.kitchen.yml b/acceptance/windows-service/.kitchen.yml
index 4f269f9aa9..5270e81487 100644
--- a/acceptance/windows-service/.kitchen.yml
+++ b/acceptance/windows-service/.kitchen.yml
@@ -1,26 +1,7 @@
-driver:
- name: vagrant
- forward_agent: yes
- customize:
- cpus: 2
- memory: 1024
-
-provisioner:
- name: chef_zero
-
verifier:
name: inspec
-platforms:
- - name: windows-server-2012r2-standard
- driver:
- box: chef/windows-server-2012r2-standard # private
- run_list:
-
suites:
- name: chef-windows-service
- provisioner:
- product_name: chef
- product_version: latest
- channel: current
+ includes: [windows-2012r2]
run_list: