Information Technology Reference
In-Depth Information
ization software to simulate having multiple machines. To follow the exercises in this topic,
you will need to enter commands on one machine or the other. The terms
host
and
guest
are a
convenient way to be more specific about precisely which environment we expect you to be
using.
Introducing Test Kitchen
You installed Test Kitchen in
Chapter 2
, either as part of the Chef Development Kit, or
manually, if you chose the Chef Client option. Test Kitchen will create a number of support-
ing files in the current working directory while it is being used. You should create a project
directory for each sandbox environment to organize these files. For your first sandbox envir-
onment, create a directory called
kitchen
and make it the current directory:
$
mkdir kitchen
$
cd kitchen
Run the
kitchen init --create-gemfile
command in your newly created
kitchen
direct-
ory. The
kitchen init
command generates all the config files needed to add Test Kitchen
support to a project. We need to use the
--create-gemfile
option, because if we don't, Test
Kitchen will immediately try to run
gem install
as a user instead of as an admin. This fails
on some platforms because the Chef Development Kit installation doesn't always make its
gem directory user-writeable:
$
kitchen init --create-gemfile
create .kitchen.yml
create test/integration/default
create Gemfile
append Gemfile
append Gemfile
You must run `bundle install' to fetch any new gems.
The
bundle install
command referenced in the preceding command line output refers to
the
Bundler
tool. Bundler is a tool that downloads and manages Ruby gems. Test Kitchen
needs you to run
bundle install
to download and install the
kitchen-vagrant
driver and
some supporting gems.