diff options
author | Salim Alam <salam@chef.io> | 2016-01-13 09:50:32 -0800 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2016-01-13 09:50:32 -0800 |
commit | 1edd3dba71b4531bb1a570dd7e387620e8ee61de (patch) | |
tree | 7489d78ffb6376d8062a37ed6cfcbdd6e98f680c | |
parent | cca4c6bc7bc28249fa47218a3134d8496890f56a (diff) | |
parent | f9736130920c45011397ee368815db5a679f9d80 (diff) | |
download | chef-1edd3dba71b4531bb1a570dd7e387620e8ee61de.tar.gz |
Merge pull request #4387 from chef/salam/chef-acceptance
Initial 'trivial' acceptance test suite
9 files changed, 82 insertions, 0 deletions
diff --git a/acceptance/Gemfile b/acceptance/Gemfile new file mode 100644 index 0000000000..3de932f988 --- /dev/null +++ b/acceptance/Gemfile @@ -0,0 +1,10 @@ +source 'https://rubygems.org' + +gem 'mixlib-install', github: 'chef/mixlib-install' +gem 'chef-acceptance', github: 'chef/chef-acceptance' +gem 'test-kitchen', github: 'sersut/test-kitchen', + branch: 'sersut/mixlib-install-update' +gem 'kitchen-inspec' +gem 'kitchen-vagrant' +gem 'windows_chef_zero' +gem 'winrm-transport' diff --git a/acceptance/README.md b/acceptance/README.md new file mode 100644 index 0000000000..5f6bfc45ba --- /dev/null +++ b/acceptance/README.md @@ -0,0 +1,30 @@ +# Acceptance Testing for Chef Client +This folder contains acceptance tests that are required for Chef client +release readiness. + +## Getting started +The tests use the _chef-acceptance_ gem as the high level framework. +All the gems needed to run these tests can be installed with Bundler. + +### Important Note! +Before running chef-acceptance, you *MUST* do the following on your current session: + +``` +export APPBUNDLER_ALLOW_RVM=true +``` + +### Setting up and running a test suite +To get started, do a bundle install from the acceptance directory: +```shell +chef/acceptance$ bundle install +``` + +To get some basic info and ensure chef-acceptance can be run, do: +```shell +chef/acceptance$ bundle exec chef-acceptance info +``` + +To run a particular test suite, do the following: +```shell +chef/acceptance$ bundle exec chef-acceptance test TEST_SUITE +``` diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore b/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore new file mode 100644 index 0000000000..041413b040 --- /dev/null +++ b/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore @@ -0,0 +1,2 @@ +nodes/ +tmp/ diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb new file mode 100644 index 0000000000..4c7c42d9bd --- /dev/null +++ b/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb @@ -0,0 +1 @@ +name 'acceptance-cookbook' diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb new file mode 100644 index 0000000000..f226ea2d10 --- /dev/null +++ b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb @@ -0,0 +1,3 @@ +execute 'bundle exec kitchen destroy' do + cwd node['chef-acceptance']['suite-dir'] +end diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb new file mode 100644 index 0000000000..2763aba70c --- /dev/null +++ b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb @@ -0,0 +1,3 @@ +execute 'bundle exec kitchen converge' do + cwd node['chef-acceptance']['suite-dir'] +end diff --git a/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb new file mode 100644 index 0000000000..c0b67bf500 --- /dev/null +++ b/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb @@ -0,0 +1,3 @@ +execute 'bundle exec kitchen verify' do + cwd node['chef-acceptance']['suite-dir'] +end diff --git a/acceptance/trivial/.kitchen.yml b/acceptance/trivial/.kitchen.yml new file mode 100644 index 0000000000..a7d0a25f93 --- /dev/null +++ b/acceptance/trivial/.kitchen.yml @@ -0,0 +1,27 @@ +driver: + name: vagrant + forward_agent: yes + customize: + cpus: 2 + memory: 1024 + +provisioner: + name: chef_zero + +verifier: + name: inspec + +platforms: + - name: ubuntu-14.04 + run_list: +# - name: windows-server-2012r2-standard +# driver: +# box: chef/windows-server-2012r2-standard # private + +suites: + - name: chef-current-install + provisioner: + product_name: chef + product_version: latest + channel: current + run_list: diff --git a/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb b/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb new file mode 100644 index 0000000000..9c4a34f544 --- /dev/null +++ b/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb @@ -0,0 +1,3 @@ +describe command('chef-client') do + it { should exist } +end |