summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-04-18 16:07:52 -0700
committerJohn Keiser <john@johnkeiser.com>2016-04-18 16:07:52 -0700
commit11597d08ee073522026bca56fb640181bca1dfdd (patch)
tree28f5b4f2529fb0593a8d633958cc2b8c1146acb1
parent9d3a630f17b5059e4180f0873b7f7e4a5b70e0c1 (diff)
downloadchef-jk/lock-deps.tar.gz
Make FIPS use the /opt/chef bundle to run the testsjk/lock-deps
-rw-r--r--acceptance/fips/test/integration/fips/serverspec/fips_spec.rb38
1 files changed, 23 insertions, 15 deletions
diff --git a/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb b/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
index 66380a37f4..4f408cd063 100644
--- a/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
+++ b/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
@@ -10,30 +10,38 @@ describe "Chef Fips Specs" do
end
end
- let(:chef_dir) do
+ let(:omnibus_root) do
if windows?
- Dir.glob("c:/opscode/chef/embedded/lib/ruby/gems/*/gems/chef-[0-9]*").last
+ "c:/opscode/chef"
else
- Dir.glob("/opt/chef/embedded/lib/ruby/gems/*/gems/chef-[0-9]*").last
+ "/opt/chef"
end
end
- let(:path) do
- if windows?
- 'C:\opscode\chef\embedded\bin'
- else
- "/opt/chef/embedded/bin"
- end
+ let(:env) do
+ {
+ "PATH" => [ "#{omnibus_root}/embedded/bin", ENV["PATH"] ].join(File::PATH_SEPARATOR),
+ "BUNDLE_GEMFILE" => "#{omnibus_root}/Gemfile",
+ "GEM_PATH" => nil, "GEM_CACHE" => nil, "GEM_HOME" => nil,
+ "BUNDLE_IGNORE_CONFIG" => "true",
+ "BUNDLE_FROZEN" => "1",
+ "CHEF_FIPS" => "1"
+ }
+ end
+
+ let(:chef_dir) do
+ cmd = Mixlib::ShellOut.new("bundle show chef", env: env).run_command
+ cmd.error!
+ cmd.stdout.chomp
end
it "passes the unit and functional specs" do
Bundler.with_clean_env do
- ruby_cmd = Mixlib::ShellOut.new(
- "bundle exec rspec -t ~requires_git spec/unit spec/functional", :env => { "PATH" => [ENV["PATH"], path].join(File::PATH_SEPARATOR),
- "GEM_PATH" => nil, "GEM_CACHE" => nil, "GEM_HOME" => nil,
- "CHEF_FIPS" => "1" },
- :live_stream => STDOUT, :cwd => chef_dir, :timeout => 3600)
- expect { ruby_cmd.run_command.error! }.not_to raise_exception
+ cmd = Mixlib::ShellOut.new(
+ "bundle exec rspec -t ~requires_git spec/unit spec/functional",
+ env: env, live_stream: STDOUT, cwd: chef_dir, timeout: 3600
+ )
+ cmd.run_command.error!
end
end
end