summaryrefslogtreecommitdiff
path: root/acceptance/fips
diff options
context:
space:
mode:
Diffstat (limited to 'acceptance/fips')
-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.rb39
8 files changed, 53 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..946401a738
--- /dev/null
+++ b/acceptance/fips/.kitchen.yml
@@ -0,0 +1,4 @@
+suites:
+ - name: fips
+ includes: [centos-6, windows-2012r2]
+ 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..3921e6a92a
--- /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..66380a37f4
--- /dev/null
+++ b/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
@@ -0,0 +1,39 @@
+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
+ 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
+ end
+ end
+end