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
0
votes
1 answer

Adding a tool to an already created chefbook/box

I am trying to learn kitchen/chef and I am following the tutorial provided here http://kitchen.ci/docs/getting-started/installing Right now I am stuck at question rather than a problem. The given tutorial creates a git-cookbook. Now what i want to…
Em Ae
  • 8,167
  • 27
  • 95
  • 162
0
votes
1 answer

Disable SELinux in-session on CentOS 5.10 box

I'm having some issues changing directory permissions that LOOK like they're related to SELinux. I'm trying to figure out how to disable SELinux a) for the remainder of the chef-client session and b) permanently. Resource: # Change permissions for…
invict_us
  • 103
  • 3
  • 8
0
votes
1 answer

Kitchen Open Stack gives "excon.error.response"

I have been trying to use Kitchen with Openstack. I did as described in this link https://github.com/test-kitchen/kitchen-openstack When i do kitchen list it…
Ismail
  • 779
  • 1
  • 8
  • 18
0
votes
1 answer

Chef Kitchen + Vagrant Window7 box failing due to SSH

LOG INFO: -----> Starting Kitchen (v1.2.1) -----> Creating ... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'windows'... ==> default: Matching MAC address for NAT…
Jacques Betancourt
  • 2,652
  • 3
  • 18
  • 19
0
votes
2 answers

how to use test-kitchen in multi node environment?

test-kitchen doesn't support multi vm tasks, I tried to define a few nodes in Vagrantfile but it is too slow - start 5 virtual virtualbox VMs at once. Perhaps I need to use docker but the whole configuration becomes too complex, especially comparing…
Oleg Kr
  • 469
  • 6
  • 8
0
votes
2 answers

Adding Complex Attributes to Test Kitchen

I have the following chef attribute that i'm trying to convert to YAML for test-kitchen: default['attr1']['attr2'] = { "setting1" => { "key1" => "value1", "key2" => "value2", "key3" => false }, }; What would this…
Alex Ethier
  • 497
  • 2
  • 7
  • 18
0
votes
4 answers

Kitchen/berkshelf wants old gem?

I want to test some changes to a cookbook, so I did what I used to do, but the result was far from normal: $ ../gem-sucks/bin/kitchen converge -----> Starting Kitchen (v1.2.1) !!!!!! The `berkshelf' gem is missing and must be installed or cannot be…
thissucks
  • 3
  • 3
0
votes
2 answers

Writing rspec tests for Chef test kitchen

I'm learning chef and working with kitchen. From the documentation I was able to figure out how to run bats tests, but I can't find any explanation on writing rspec tests other than that it is one of the four built in test suites.
brainbuz
  • 384
  • 1
  • 3
  • 12
0
votes
1 answer

Chef ServerSpec Host Resource Not Working

I'm trying to write a ServerSpec test to run against a deployed instance. The following is the relevant test: require 'spec_helper' describe service('nginx') do it { should be_enabled } it { should be_running } end describe port(80) do it {…
localhostv6
  • 47
  • 1
  • 5
0
votes
1 answer

How to specify version of specinfra for test-kitchen verify command?

Last version of https://github.com/serverspec/specinfra is broken (https://github.com/serverspec/specinfra/pull/229). so when I execute: kitchen verify it doesn't verify and just throw some errors. So I thought - How to specify some particular…
Kostiantyn
  • 23
  • 3
0
votes
1 answer

Writing specs using kitchen for chef scripts - writing the kitchen.yml file

I have few recipes and I want to test them using kitchen. I am new to kitchen and I was going through their docs which is really good. --- driver: name: ssh provisioner: name: chef_solo platforms: - name: ubuntu-14.04 driver: …
druuu
  • 1,676
  • 6
  • 19
  • 36
0
votes
1 answer

Chef trying to load its own cookbook within the process

I'm in the process of creating a cookbook for Magento with the aid of Kitchen.CI I'm using Librarian-Chef for dependency management, and since I installed it, I'm getting the following error when I try to converge: ERROR: Cookbook magentochef not…
Dan Hanly
  • 7,829
  • 13
  • 73
  • 134
0
votes
1 answer

Checking if a hidden file exists with Serverspec

I am using Test-Kitchen and Serverspec for my integration tests. I want to use a Serverspec file resource to verify whether a hidden file exists, in this case .gemrc. Here is my spec configuration: require 'spec_helper' describe "Checking the…
Robert
  • 10,403
  • 14
  • 67
  • 117
0
votes
1 answer

Chef::Exceptions::Exec returned 1, expected 0

I am learning Chef + Test Kitchen on a CentOS VM at the moment and it seems that every time I run kitchen converge, some packages fail and throw the same error: Chef::Exceptions::Exec ---------------------- returned 1, expected 0 And ALL of the…
Ismail Faruqi
  • 482
  • 4
  • 16
0
votes
1 answer

Converting Attributes into Hash from YAML

How can I convert files_copy_to_guest into a Ruby Hash? .kitchen.yml 'my_cookbook': 'files_copy_to_guest': - 'home/kevin/bin/script.sh' : '/vagrant/unix_scripts/script.sh' 'home/kevin/script2.sh' :…
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
1 2 3
23
24