summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-02-08 14:54:21 -0800
committerSalim Alam <salam@chef.io>2016-02-09 15:05:05 -0800
commit18af5835e4e5a6a4beaea44657dfb08093797fd0 (patch)
tree180a005467a632756365f459f0e05a93cf4abc18
parentc78a629699401b5ccc9d4c46e76ea5ad1b848493 (diff)
downloadchef-18af5835e4e5a6a4beaea44657dfb08093797fd0.tar.gz
Add `top_cookbooks` resource to run all top cookbooks
-rw-r--r--acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml2
-rw-r--r--acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml2
-rw-r--r--acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb12
-rw-r--r--acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/init.rb17
-rw-r--r--acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb17
-rw-r--r--acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb5
-rw-r--r--acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb5
-rw-r--r--acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb5
-rw-r--r--acceptance/top-cookbooks/.kitchen.git.yml10
-rw-r--r--acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml4
-rw-r--r--acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml4
-rw-r--r--acceptance/top-cookbooks/.kitchen.yml12
12 files changed, 48 insertions, 47 deletions
diff --git a/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml b/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml
index 89925c0f07..e4b2211c8b 100644
--- a/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml
+++ b/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml
@@ -30,6 +30,8 @@ provisioner:
product_name: <%= ENV["KITCHEN_CHEF_PRODUCT"] %>
product_version: <%= ENV["KITCHEN_CHEF_VERSION"] %>
channel: <%= ENV["KITCHEN_CHEF_CHANNEL"] %>
+ client_rb:
+ audit_mode: :enabled
platforms:
#
diff --git a/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml b/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml
index f978658477..2cdb74a475 100644
--- a/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml
+++ b/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml
@@ -10,6 +10,8 @@ provisioner:
product_name: <%= ENV["KITCHEN_CHEF_PRODUCT"] %>
product_version: <%= ENV["KITCHEN_CHEF_VERSION"] %>
channel: <%= ENV["KITCHEN_CHEF_CHANNEL"] %>
+ client_rb:
+ audit_mode: :enabled
platforms:
<% %w(
diff --git a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb
index 0f9982f9ad..09c43d2390 100644
--- a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb
+++ b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb
@@ -19,8 +19,8 @@ class CookbookKitchen < KitchenAcceptance::Kitchen
property :env, default: lazy {
{
"BUNDLE_GEMFILE" => ::File.expand_path("../Gemfile", Chef.node["chef-acceptance"]["suite-dir"]),
- "KITCHEN_GLOBAL_YAML" => ::File.join(kitchen_dir, ".kitchen.yml"),
- "KITCHEN_YAML" => ::File.join(node["chef-acceptance"]["suite-dir"], ".kitchen.yml")
+# "KITCHEN_GLOBAL_YAML" => ::File.join(kitchen_dir, ".kitchen.yml"),
+ "KITCHEN_YAML" => ::File.join(node["chef-acceptance"]["suite-dir"], ".kitchen.#{test_cookbook}.yml")
}
}
@@ -34,10 +34,10 @@ class CookbookKitchen < KitchenAcceptance::Kitchen
# Grab the cookbook
# TODO Grab the source URL from supermarket
# TODO get git to include its kitchen tests in the cookbook.
- # git repository_root do
- # repository new_resource.repository
- # branch new_resource.branch
- # end
+ git repository_root do
+ repository new_resource.repository
+ branch new_resource.branch
+ end
end
super()
diff --git a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/init.rb b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/init.rb
deleted file mode 100644
index 8561d6e798..0000000000
--- a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/init.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-module CookbookGit
- def self.test_cookbook_name
- "git"
- end
-
- def self.test_run_path
- File.join(Chef.node["chef-acceptance"]["suite-dir"], "test_run")
- end
-
- def self.acceptance_path
- File.expand_path("..", Chef.node["chef-acceptance"]["suite-dir"])
- end
-
- def self.acceptance_gemfile
- File.join(acceptance_path, "Gemfile")
- end
-end
diff --git a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb
new file mode 100644
index 0000000000..e669239305
--- /dev/null
+++ b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb
@@ -0,0 +1,17 @@
+class TopCookbooks < Chef::Resource
+ resource_name :top_cookbooks
+
+ property :command, String, name_property: true
+
+ action :run do
+# cookbook_kitchen "#{command} git"
+ # cookbook_kitchen "#{command} learn-the-basics-rhel" do
+ # repository "learn-chef/learn-chef-acceptance"
+ # cookbook_relative_dir "cookbooks/learn-the-basics-rhel"
+ # end
+ cookbook_kitchen "#{command} learn-the-basics-ubuntu" do
+ repository "learn-chef/learn-chef-acceptance"
+ cookbook_relative_dir "cookbooks/learn-the-basics-ubuntu"
+ end
+ end
+end
diff --git a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb
index 497cd261f5..63d10e86e4 100644
--- a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb
+++ b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb
@@ -1,4 +1 @@
-cookbook_kitchen "destroy learn-the-basics-rhel" do
- repository "learn-chef/learn-chef-acceptance"
- cookbook_relative_dir "cookbooks/learn-the-basics-rhel"
-end
+top_cookbooks "destroy"
diff --git a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb
index 89a09c291e..7b16f8e66f 100644
--- a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb
+++ b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb
@@ -1,4 +1 @@
-cookbook_kitchen "converge learn-the-basics-rhel" do
- repository "learn-chef/learn-chef-acceptance"
- cookbook_relative_dir "cookbooks/learn-the-basics-rhel"
-end
+top_cookbooks "converge"
diff --git a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb
index 4b2dc19212..8d00a2e301 100644
--- a/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb
+++ b/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb
@@ -1,4 +1 @@
-cookbook_kitchen "verify learn-the-basics-rhel" do
- repository "learn-chef/learn-chef-acceptance"
- cookbook_relative_dir "cookbooks/learn-the-basics-rhel"
-end
+top_cookbooks "verify"
diff --git a/acceptance/top-cookbooks/.kitchen.git.yml b/acceptance/top-cookbooks/.kitchen.git.yml
new file mode 100644
index 0000000000..8db1829d5f
--- /dev/null
+++ b/acceptance/top-cookbooks/.kitchen.git.yml
@@ -0,0 +1,10 @@
+suites:
+ - name: git-default
+ run_list: ["recipe[git]"]
+ includes: [ubuntu-14.04]
+ - name: git-source
+ run_list: ["recipe[git::source]"]
+ includes: [nonexistent]
+ - name: git-default-windows
+ run_list: ["recipe[git]"]
+ includes: [windows-2012r2]
diff --git a/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml b/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml
new file mode 100644
index 0000000000..6b8848efae
--- /dev/null
+++ b/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml
@@ -0,0 +1,4 @@
+suites:
+ - name: learn-the-basics-rhel-default
+ run_list: ["recipe[learn-the-basics-rhel::default]"]
+ includes: [el-6]
diff --git a/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml b/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml
new file mode 100644
index 0000000000..b0a3e45aa3
--- /dev/null
+++ b/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml
@@ -0,0 +1,4 @@
+suites:
+ - name: learn-the-basics-ubuntu-default
+ run_list: ["recipe[learn-the-basics-ubuntu::default]"]
+ includes: [ubuntu-14.04]
diff --git a/acceptance/top-cookbooks/.kitchen.yml b/acceptance/top-cookbooks/.kitchen.yml
deleted file mode 100644
index cd5133cb8a..0000000000
--- a/acceptance/top-cookbooks/.kitchen.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-suites:
- # - name: git-default
- # run_list: ["recipe[git]"]
- # includes: [ubuntu-14.04]
- # - name: git-source
- # run_list: ["recipe[git::source]"]
- # includes: [nonexistent]
- # - name: git-default-windows
- # run_list: ["recipe[git]"]
- # includes: [windows-2012r2]
- - name: learn-the-basics-rhel
- includes: [el-6]