This repository is a demonstration of how to use chef-provisioning
to provision a VM with vagrant
and then use infrataster
to run a test against it.
server 'server1'
http 'http://192.168.20.10/' with {:params=>{}, :method=>:get, :headers=>{}}
responds with 200
server 'server2'
http 'http://192.168.20.11/' with {:params=>{}, :method=>:get, :headers=>{}}
responds with 200
server 'testclient'
can wget from server1
can wget from server2
Finished in 1.84 seconds (files took 0.54254 seconds to load)
4 examples, 0 failures
- Ruby (tested with 1.9.3)
- Vagrant
bundle install
rake generate
rake test
rake test_cluster
If you make an alteration to the recipes in the recipes/
folder or include a new cookbook in the Berksfile you must run rake update
to update the cookbooks in the test environment.
The cookbook will create a virtual machine using Vagrant. Once created it will converge the apache2 cookbook on the VM. Finally it uses infrataster to check that the web server responds.
- Uses chef-provisioning to create the VM defined in
provision/provision.rb
using the vagrant driver defined inprovision/vagrant.rb
- chef-provisioning converges the run_list as specified in
provision/provision.rb
- rspec runs infrataster the server is defined in
spec/spec_helper.rb
with the example test inspec/infrataster/default_spec.rb