summaryrefslogtreecommitdiff
path: root/acceptance
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2016-02-24 09:42:59 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2016-02-25 16:09:50 -0800
commit0f328812fe3df4760deb951a2b758fc1471a2f1e (patch)
tree1e3316aa272309d93a95f3ac98f5ddeffd17dec7 /acceptance
parent4b18cf4faea46a1f69f8774f6e3d48826dc4b14d (diff)
downloadchef-0f328812fe3df4760deb951a2b758fc1471a2f1e.tar.gz
Add fips test for centos-6
Diffstat (limited to 'acceptance')
-rw-r--r--acceptance/fips/.acceptance/acceptance-cookbook/.gitignore2
-rw-r--r--acceptance/fips/.acceptance/acceptance-cookbook/metadata.rb2
-rw-r--r--acceptance/fips/.acceptance/acceptance-cookbook/recipes/destroy.rb1
-rw-r--r--acceptance/fips/.acceptance/acceptance-cookbook/recipes/provision.rb1
-rw-r--r--acceptance/fips/.acceptance/acceptance-cookbook/recipes/verify.rb1
-rw-r--r--acceptance/fips/.kitchen.yml4
-rw-r--r--acceptance/fips/test/integration/fips/serverspec/Gemfile3
-rw-r--r--acceptance/fips/test/integration/fips/serverspec/fips_spec.rb17
8 files changed, 31 insertions, 0 deletions
diff --git a/acceptance/fips/.acceptance/acceptance-cookbook/.gitignore b/acceptance/fips/.acceptance/acceptance-cookbook/.gitignore
new file mode 100644
index 0000000000..041413b040
--- /dev/null
+++ b/acceptance/fips/.acceptance/acceptance-cookbook/.gitignore
@@ -0,0 +1,2 @@
+nodes/
+tmp/
diff --git a/acceptance/fips/.acceptance/acceptance-cookbook/metadata.rb b/acceptance/fips/.acceptance/acceptance-cookbook/metadata.rb
new file mode 100644
index 0000000000..6c754560f0
--- /dev/null
+++ b/acceptance/fips/.acceptance/acceptance-cookbook/metadata.rb
@@ -0,0 +1,2 @@
+name "acceptance-cookbook"
+depends "kitchen_acceptance"
diff --git a/acceptance/fips/.acceptance/acceptance-cookbook/recipes/destroy.rb b/acceptance/fips/.acceptance/acceptance-cookbook/recipes/destroy.rb
new file mode 100644
index 0000000000..e2d663ac2f
--- /dev/null
+++ b/acceptance/fips/.acceptance/acceptance-cookbook/recipes/destroy.rb
@@ -0,0 +1 @@
+kitchen "destroy"
diff --git a/acceptance/fips/.acceptance/acceptance-cookbook/recipes/provision.rb b/acceptance/fips/.acceptance/acceptance-cookbook/recipes/provision.rb
new file mode 100644
index 0000000000..5726c0e7b5
--- /dev/null
+++ b/acceptance/fips/.acceptance/acceptance-cookbook/recipes/provision.rb
@@ -0,0 +1 @@
+kitchen "converge"
diff --git a/acceptance/fips/.acceptance/acceptance-cookbook/recipes/verify.rb b/acceptance/fips/.acceptance/acceptance-cookbook/recipes/verify.rb
new file mode 100644
index 0000000000..05ac94ce66
--- /dev/null
+++ b/acceptance/fips/.acceptance/acceptance-cookbook/recipes/verify.rb
@@ -0,0 +1 @@
+kitchen "verify"
diff --git a/acceptance/fips/.kitchen.yml b/acceptance/fips/.kitchen.yml
new file mode 100644
index 0000000000..e5710a1761
--- /dev/null
+++ b/acceptance/fips/.kitchen.yml
@@ -0,0 +1,4 @@
+suites:
+ - name: fips
+ includes: [centos-6]
+ run_list:
diff --git a/acceptance/fips/test/integration/fips/serverspec/Gemfile b/acceptance/fips/test/integration/fips/serverspec/Gemfile
new file mode 100644
index 0000000000..ecaf4de586
--- /dev/null
+++ b/acceptance/fips/test/integration/fips/serverspec/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem 'mixlib-shellout'
diff --git a/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb b/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
new file mode 100644
index 0000000000..30e2cf52d2
--- /dev/null
+++ b/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
@@ -0,0 +1,17 @@
+require 'mixlib/shellout'
+require 'bundler'
+
+describe "Chef Fips Specs" do
+ 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",
+ 'GEM_PATH' => nil, 'GEM_CACHE'=>nil, 'GEM_HOME'=>nil,
+ 'CHEF_FIPS'=>'1'},
+ :live_stream => STDOUT, :cwd => chef_dir)
+ expect { ruby_cmd.run_command.error! }.not_to raise_exception
+ end
+ end
+end
+