diff options
author | Salim Alam <salam@chef.io> | 2016-02-04 15:49:31 -0800 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2016-02-04 15:49:31 -0800 |
commit | aa2d22fc80e67f607f8cd7feb7cc02bb09b9a377 (patch) | |
tree | 579393d1d827be1e7518e25147936e1ee9595a51 /acceptance/basics | |
parent | a27aada46427ed7fe366bb9e9f57ca6f94272f97 (diff) | |
download | chef-aa2d22fc80e67f607f8cd7feb7cc02bb09b9a377.tar.gz |
Add basics suite, refactor to share common infra
Diffstat (limited to 'acceptance/basics')
9 files changed, 38 insertions, 0 deletions
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..cebbbbc2eb --- /dev/null +++ b/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb @@ -0,0 +1,3 @@ +name 'acceptance-cookbook' + +depends "shared" 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/.acceptance/shared b/acceptance/basics/.acceptance/shared new file mode 120000 index 0000000000..0ab0cb2b3a --- /dev/null +++ b/acceptance/basics/.acceptance/shared @@ -0,0 +1 @@ +../../shared
\ No newline at end of file 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' |