diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-08-10 12:17:04 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-08-10 12:17:04 -0700 |
commit | b7493fd0855e7575b91f695b28ef3af1b47f0276 (patch) | |
tree | 6c5925790995c4e0e734439e27861f3f93c48244 /kitchen-tests/cookbooks | |
parent | 7c9178e5dd4ec7b5a75993c148b087bac6e5b53d (diff) | |
download | chef-b7493fd0855e7575b91f695b28ef3af1b47f0276.tar.gz |
add centos-7 rspec testing
running rspec inside a test-kitchen provisioned centos-7 docker container
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'kitchen-tests/cookbooks')
-rw-r--r-- | kitchen-tests/cookbooks/rspec/metadata.rb | 8 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/rspec/recipes/default.rb | 13 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/rspec/templates/run-chef-rspec | 11 |
3 files changed, 32 insertions, 0 deletions
diff --git a/kitchen-tests/cookbooks/rspec/metadata.rb b/kitchen-tests/cookbooks/rspec/metadata.rb new file mode 100644 index 0000000000..f0b5bfba75 --- /dev/null +++ b/kitchen-tests/cookbooks/rspec/metadata.rb @@ -0,0 +1,8 @@ +name "rspec" +license "Apache-2.0" +description "Runs nothing" +version "1.0.0" + +chef_version ">= 14" +issues_url "https://github.com/chef/chef/issues" +source_url "https://github.com/chef/chef" diff --git a/kitchen-tests/cookbooks/rspec/recipes/default.rb b/kitchen-tests/cookbooks/rspec/recipes/default.rb new file mode 100644 index 0000000000..4dc1c10d99 --- /dev/null +++ b/kitchen-tests/cookbooks/rspec/recipes/default.rb @@ -0,0 +1,13 @@ +# we're using chef-client now as a glorified way to push a file to the remote host +# if we had a way to turn off chef-client converge and push arbitrary files to the +# remote this complexity could be removed. +template "/usr/local/bin/run-chef-rspec" do + source "run-chef-rspec" + mode 0755 +end + +# do NOT even think of trying to add an execute resource here to launch rspec. +# chefception is proven to be a bad idea, and the rspec tests that really launch +# chef-client will likely break due to the outer chef-client run. i also do not +# want to debug rspec's output being filtered through chef-client's logger -- fuck +# all of that noise. diff --git a/kitchen-tests/cookbooks/rspec/templates/run-chef-rspec b/kitchen-tests/cookbooks/rspec/templates/run-chef-rspec new file mode 100644 index 0000000000..54c4297479 --- /dev/null +++ b/kitchen-tests/cookbooks/rspec/templates/run-chef-rspec @@ -0,0 +1,11 @@ +#!/bin/bash + +# remove ip6 entries for docker +egrep -v "ip6" /etc/hosts > /etc/hosts.new +cp /etc/hosts.new /etc/hosts + +export PATH=/opt/chef/embedded/bin:$PATH +cd /opt/chef/embedded/apps/chef + +/opt/chef/embedded/bin/bundle install +/opt/chef/embedded/bin/bundle exec /opt/chef/embedded/bin/rspec --format progress |