Information Technology Reference
In-Depth Information
Run your test again using kitchen verify (you only need to run kitchen setup once to
initialize the configuration on the test node). This time, it should report that the test failed,
which is exactly what should happen:
$ kitchen verify
-----> Starting Kitchen (v1.2.1)
-----> Verifying <default-centos65>...
Removing /tmp/busser/suites/serverspec
Uploading /tmp/busser/suites/serverspec/default_spec.rb (mode=0644)
-----> Running serverspec test suite
/opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec
-I/tmp/busser/gems/gems/rspec-support-3.1.2/lib:/tmp/busser/gems/gems
/rspec-core-3.1.7/lib /opt/chef/embedded/bin/rspec --pattern /tmp/busser
/suites/serverspec/\*\*/\*_spec.rb --color --format documentation
--default-path /tmp/busser/suites/serverspec
web site
responds on port 80 (FAILED - 1)
Failures:
1) web site responds on port 80
Failure/Error: expect(port 80).to be_listening 'tcp'
expected Port "80" to be listening "tcp"
/bin/sh -c netstat\ -tunl\ \|\ grep\ --\ :80
# /tmp/busser/suites/serverspec/default_spec.rb:7:in `block (2
levels) in <top (required)>'
Finished in 0.03284 seconds (files took 0.2051 seconds to load)
1 example, 1 failure
...
So yes, our test is actually performing checks against the live configuration on the test node.
Before we finish this section, go ahead and run kitchen converge again to restore the con-
figuration back to what it should be. During the Chef run, the Chef engine will detect that the
httpd service is not running and start it up again:
$ kitchen converge
Search WWH ::




Custom Search