diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-24 11:15:12 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-25 16:09:50 -0800 |
commit | 3f9301526e6774c7e7e3b4081c9715978ab3ecd2 (patch) | |
tree | 832a4c67811e13bd668b3b5f506a185b7ec9970f /acceptance | |
parent | 0f328812fe3df4760deb951a2b758fc1471a2f1e (diff) | |
download | chef-3f9301526e6774c7e7e3b4081c9715978ab3ecd2.tar.gz |
Add windows support for fips_spec
Diffstat (limited to 'acceptance')
-rw-r--r-- | acceptance/fips/.kitchen.yml | 2 | ||||
-rw-r--r-- | acceptance/fips/test/integration/fips/serverspec/fips_spec.rb | 28 |
2 files changed, 26 insertions, 4 deletions
diff --git a/acceptance/fips/.kitchen.yml b/acceptance/fips/.kitchen.yml index e5710a1761..946401a738 100644 --- a/acceptance/fips/.kitchen.yml +++ b/acceptance/fips/.kitchen.yml @@ -1,4 +1,4 @@ suites: - name: fips - includes: [centos-6] + includes: [centos-6, windows-2012r2] run_list: diff --git a/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb b/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb index 30e2cf52d2..987b3d8766 100644 --- a/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb +++ b/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb @@ -2,11 +2,34 @@ require 'mixlib/shellout' require 'bundler' describe "Chef Fips Specs" do + def windows? + if RUBY_PLATFORM =~ /mswin|mingw|windows/ + true + else + false + end + end + + let(:chef_dir) do + if windows? + Dir.glob('c:/opscode/chef/embedded/lib/ruby/gems/*/gems/chef-[0-9]*').last + else + Dir.glob('/opt/chef/embedded/lib/ruby/gems/*/gems/chef-[0-9]*').last + end + end + + let(:path) do + if windows? + 'C:\opscode\chef\embedded\bin' + else + "/opt/chef/embedded/bin" + end + end + it 'passes the unit and functional specs' do - chef_dir = Dir.glob('/opt/chef/embedded/lib/ruby/gems/*/gems/chef-[0-9]*').last Bundler.with_clean_env do ruby_cmd = Mixlib::ShellOut.new( - 'bundle exec rspec spec/unit spec/functional', :env => {'PATH' => "#{ENV['PATH']}:/opt/chef/embedded/bin", + 'bundle exec rspec spec/unit spec/functional', :env => {'PATH' => "#{ENV['PATH']}:#{path}", 'GEM_PATH' => nil, 'GEM_CACHE'=>nil, 'GEM_HOME'=>nil, 'CHEF_FIPS'=>'1'}, :live_stream => STDOUT, :cwd => chef_dir) @@ -14,4 +37,3 @@ describe "Chef Fips Specs" do end end end - |