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/test | |
parent | a27aada46427ed7fe366bb9e9f57ca6f94272f97 (diff) | |
download | chef-aa2d22fc80e67f607f8cd7feb7cc02bb09b9a377.tar.gz |
Add basics suite, refactor to share common infra
Diffstat (limited to 'acceptance/basics/test')
-rw-r--r-- | acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb | 19 | ||||
-rw-r--r-- | acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb | 6 |
2 files changed, 25 insertions, 0 deletions
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' |