Questions tagged [test-kitchen]

Test Kitchen is an integration tool for developing and testing infrastructure code and software on isolated target platforms.

What is Test Kitchen?

Test Kitchen is a test harness tool to execute your configured code on one or more platforms in isolation. A driver plugin architecture is used which lets you run your code on various cloud providers and virtualization technologies such as Amazon EC2, Blue Box, CloudStack, Digital Ocean, Rackspace, OpenStack, Vagrant, Docker, LXC containers, and more. Many testing frameworks are already supported out of the box including Bats, shUnit2, RSpec, Serverspec, with others being created weekly.

For Chef workflows, cookbook dependency resolver tools such as Berkshelf and Librarian-Chef are supported or you can simply have a cookbooks/ directory and Test Kitchen will know what to do. Support for Test Kitchen is already included in many Chef community cookbooks such as the MySQL, nginx, Chef Server, and runit cookbooks.

What does it give me?

Test Kitchen has a simple workflow that stresses speed but optimizes for the freshness of your code executing on the remote systems between tests. It has a static, declarative configuration in a .kitchen.yml file at the root of your project. It is designed to execute isolated code run in pristine environments ensuring that no prior state exists. A plugin architecture gives you the freedom to run your code on any cloud, virtualization, or bare metal resources and allows you to write acceptance criteria in whatever framework you desire.

How do I get started?

Adding testing support to your Chef cookbook or project is easy. Assuming you have Ruby 1.9 or higher and Vagrant installed, open a terminal session and type:

$ gem install test-kitchen
$ kitchen init
$ kitchen test

For more comprehensive instructions, check out the Getting Started guide.

358 questions
1
vote
0 answers

Error while creating chef kitchen using ec2 driver

I am trying to create a kitchen in chef using AWS ec2 as my driver. While doing that, I have come across some peculiar things. They are : When I type kitchen list command : Instance Driver Provisioner Verifier Transport Last…
prudhvi
  • 1,141
  • 6
  • 23
  • 46
1
vote
0 answers

how to name a machine in a vmware request from kitchen?

I'm using Kitchen to request items from our vra/vmware host. I can name the "deployment" using the notes attribute in the driver section. But this cookbook spins 5 servers, and i want to be able to see which is which in the vmware dashboard without…
Max Cascone
  • 648
  • 9
  • 25
1
vote
2 answers

Can Vagrantfile use attributes set in .kitchen.yml?

I am using kitchen to test my chef cookbook. In .kitchen.yml I use driver: name: vagrant vagrantfile_erb: Vagrantfile.rb Then in the suites attribute I have attributes: { "myattribute" : true, ... Can I use this attribute value inside the…
MarMan
  • 328
  • 2
  • 3
  • 9
1
vote
0 answers

How to force test kitchen attributes to be passed as integers?

I'm trying to set some attributes for some cookbooks that I imported through my kitchen.yml file. kitchen.yml: --- ... attributes: some_cookbook: key: 1 The cookbook that I'm importing seems to require that the attribute…
Ci3
  • 4,632
  • 10
  • 34
  • 44
1
vote
1 answer

Serverspec package check always returns true

I'm trying to write serverspec tests that check if a recipe is setting up mariadb-server, by using chef, kitchen, and vagrant, with a debian jessie box. The recipe is simple: # cookbooks/mariadb/recipes/server.rb package 'mariadb-server' do …
pdu
  • 10,295
  • 4
  • 58
  • 95
1
vote
1 answer

undefined username for nil:nilclass while trying to launch windows instance using kitchen-ec2

I was trying to launch windows-2012 instance using kitchen-ec2 for my cookbook and when i try to run kitchen create using the following .kitchen.yml, I am encountering into undefined method " `username' for nil:NilClass". I am stuck here at this…
bablu
  • 75
  • 4
  • 11
1
vote
1 answer

Troubles Cloning a Chef Private Repo Using Test Kitchen

I am having trouble trying to clone a private git repository from gitolite. I am installing git 2.8.1 and using Chef 12.9. I am trying to create an SSH wrapper that the chef git resource can use to authenticate into my repository. .... file…
PaulM
  • 79
  • 1
  • 8
1
vote
1 answer

Installing Busser plugins: busser-serverspec never finishes (OSX, Virtualbox)

When I run kitchen test on my MacBook, it gets through most of the steps, but then gets stuck here twiddling its thumbs: Running handlers: Running handlers complete Chef Client finished, 81/117 resources updated in 07 minutes 12…
Andrew Evans
  • 897
  • 2
  • 7
  • 17
1
vote
1 answer

Chef Kitchen can't find current cookbook during 'kitchen converge' on Windows

I had a cookbook that was working fine, and then I updated to the latest version of kitchen and now it's throwing errors during a converge. I've tried doing a converge on a cookbook that doesn't have any dependencies and that worked fine, so I'm…
Steve Johnstone
  • 576
  • 3
  • 16
1
vote
1 answer

Error executing action `install` on resource 'yum_package[newrelic-repo]'

I was trying to download newrelic-5-3.rpm file and then try to install the package in my chef receipe. I am getting the following exception when I try to run kitchen-verify Chef::Exceptions::Package ------------------------- Package…
bablu
  • 75
  • 4
  • 11
1
vote
1 answer

Kitchen converge fails with Access Denied when copying password secret

I've been running through the basic chef tutorials and have set up a WinServer2012 vm and successfully deployed my kitchen with the basic awesome customers cookbook using vagrant. However, I've hit a brick wall when trying to enable security for…
Mark
  • 297
  • 3
  • 8
1
vote
3 answers

Kitchen converge stuck at Preparing client.rb

A fresh run of kitchen converge runs fine. However, the second run halts at preparing client.rb ... Has anyone ever encountered this issue? How should I debug this problem?
denniss
  • 17,229
  • 26
  • 92
  • 141
1
vote
1 answer

Vagrant SSH Connection Failed.....(Errno:ECONNREFUSED - connect(2) for 127.0.0.1:2200)

I am trying to run kitchen-converge/test using Vagrant (1.8.1) and Virtualbox (5.0), behind a proxy server (which has been configured using charles proxy). I am either getting hung up while running kitchen test or getting connection refused while…
bablu
  • 75
  • 4
  • 11
1
vote
0 answers

kitchen-openstack ssl error while kitchen converging

While trying to kitchen converge with kitchen-openstack receiving SSL errors as shown below, I have tried multiple ruby versions and in kitchen-openstack project it was mentioned that the error was fixed with ruby version 2.1.2 but even after using…
1
vote
2 answers

Kitchen tests with AIX

While Chef-Client is supported on AIX I can't find any official kitchen driver for AIX. Is there something or how does the chef/AIX community does Chef Cookbook integration tests?