A Busser runner plugin that runs Serverspec tests as integration tests.
Busser installs Serverspec on the machine under test the first time a suite
runs, then executes the suite's serverspec directory against it. Because the
tests run on the machine itself, they use Serverspec's exec backend rather
than SSH.
This gem has been archived. No active maintainers have come forward in the past five years and the original maintainer has since pulled the plugin.
We recommend moving to a maintained project for similar functionality, or
building and running the gem yourself. In particular,
kitchen-verifier-shell
with Serverspec covers the same ground and is configured directly in your
kitchen.yml.
Ruby 3.2 or newer, and busser 0.9.0 or newer.
Select the Busser verifier in your kitchen.yml:
verifier:
name: busserBusser then installs the plugin for you when the suite runs. To install it by hand:
busser plugin install busser-serverspecPut your specs in a subdirectory of the suite's serverspec directory:
test
`-- integration
`-- default # suite name
`-- serverspec
|-- Gemfile # optional
|-- spec_helper.rb
`-- localhost
`-- httpd_spec.rb
Specs are collected recursively as **/*_spec.rb, so any depth works; the
localhost/ directory above is convention, not a requirement. The separator is
an underscore — _spec.rb, not -spec.rb. The suite directory is also added to
the load path and set as RSpec's default path, so require "spec_helper" works
without a relative path.
require "spec_helper"
describe command("echo hello") do
its(:exit_status) { should eq 0 }
its(:stdout) { should eq "hello\n" }
endThe tests run on the machine under test, after Test Kitchen has logged in, so
the exec backend is the right one:
require "serverspec"
set :backend, :execDo not use set :backend, :ssh — that would have Serverspec connect back out
over the network from a machine that is already the target.
A Gemfile in the suite directory is bundle installed before the run, which
is how you pin a particular Serverspec version:
source "https://rubygems.org"
gem "serverspec", "~> 2.43"Without one, the plugin installs Serverspec 2.43 or newer.
This is how most people run it, and it needs no Busser commands of your own.
Select the verifier in kitchen.yml:
verifier:
name: busser
suites:
- name: defaultThen put your tests in a serverspec directory inside the suite:
test/integration/default/serverspec/localhost/httpd_spec.rb
kitchen verify installs Busser and this plugin on the instance and runs them.
The directory name is what selects this plugin -- there is nothing else to
configure.
If the suite files do not match what this plugin looks for, the run prints one
line and exits 0:
-----> Running serverspec test suite
No tests ran, and nothing said so. Work through these in order:
- Is the directory named
serverspec? That name alone selects this plugin.serverspecs/,tests/or anything else is not picked up. - Do the filenames match? Only
*_spec.rbis run, searched recursively; note the underscore --default-spec.rbis not picked up. - Is the plugin installed?
busser plugin listshows what is available. - Is
BUSSER_ROOTwhat you think?busser suite pathprints where suites are actually being looked for.
Bug reports and pull requests are welcome. See CONTRIBUTING.md for how to set up the project, run the test suite, and format your commits.
Apache License 2.0. See LICENSE.
Originally created by HIGUCHI Daisuke.