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

Kitchen test and reboot Vagrant boxes

I had wrote some cookbooks. Now I want to test it using kitchen on multiple platforms. I want to restart my virtualbox istance before install Visual Studio. But when the machine reboots, my session is finished, and I'm not able to install Visual…
AleZucchelli
  • 55
  • 1
  • 12
0
votes
1 answer

Want to print array elements in .erb file in test kitchen in single line with one space

/opt/mapr/server/configure.sh -N <%=@clust_name %> -c -C cldb -Z <% @zookeeprall.each do |node| -%> <%= node %>:<%=@zk_p %> <% end %> zookeeperall is array and i want to print the array in single line but space between elements…
0
votes
1 answer

node search is giving nothing in test kitchen

No output from search in test kitchen Throwing error check the recipe and suggest me some details Node JSON file { "id": "cldb", "chef_type": "node", "json_class": "Chef::Node", "run_list": [], "automatic": { "hostname":…
Udhay
  • 7
  • 7
0
votes
0 answers

test kitchen i want to write node attributes and want to search in node serach

In test kitchen i am trying to search nodes but it is not giving any output cookbook/test/integration/nodes Json file { "id": "hive server", "chef_type": "node", "environment": "dev", "json_class": "Chef::Node", …
Udhay
  • 7
  • 7
0
votes
1 answer

How do I use my custom AMI with the ec2 driver in Test Kitchen?

I'm not sure what I'm missing, but my custom CentOS AMI is being ignored by test ktichen. Instead of spinning up the correct AMI it spins up an Ubuntu AMI. Here is my kitchen.yml: --- driver: name: ec2 aws_ssh_key_id: chef security_group_ids:…
TyMac
  • 783
  • 2
  • 9
  • 32
0
votes
3 answers

How to use cluster nodes in Test kitchen chef i need to install hadoop cluster with chef with test kitchen for testing

How create and use as a cluster nodes using Test kitchen -- Chef Want to install the Hadoop cluster using test kitchen but how can I use multiple nodes with inter communication in Test kitchen
Udhay
  • 7
  • 7
0
votes
2 answers

Kitchen hangs during test chef role

I have creating some chef cookbooks and all works correctly. Now I want to use kitchen for testing my recipe and cookbooks. Kitchen run on Linux centos 7 and I use virtualbox. If I launch recipe to install ms_dotnet 4.5 on win server 2008 all works…
AleZucchelli
  • 55
  • 1
  • 12
0
votes
1 answer

kitchen verify output show double test report

Using kitchen verify I got a double report of my suite test. I don't know why and it is happening only in this cookbook. I ran the same kitchen verify command and the output is clear so what is different now? It is the output (with double…
Robert
  • 10,403
  • 14
  • 67
  • 117
0
votes
2 answers

block suite 'verify' in 'kitchen test'

I'm running 2 different recipes from 2 suites, and both suites have same name so that these recipes would run on same machine. But the problem is, once the test kitchen run with first recipe, it starts to 'verify' the suite, which i don't want to…
ReshmaA
  • 85
  • 1
  • 3
  • 12
0
votes
2 answers

Development environment with Vagrant and Chef

We have recently started implementing a proper CI-based build pipeline for continuous deployment scenario and decided to use Chef as our CM tool. We also use Vagrant for creating isolated local dev environments for our devs, since it allows a simple…
0
votes
0 answers

chef-solo: Handler trying to connect to http://127.0.0.1:8889/nodes/

I am trying to test one of my cookbook on test-kitchen node. After successful converge or chef-client, the chef handler throws errors connecting to some server. I think it wants to send the node details to a chef-server. I don't know what to do? Do…
Tenzin Chemi
  • 5,101
  • 2
  • 27
  • 33
0
votes
3 answers

can I use a local downloaded image in kitchen.yml

I am a Windows 10 user. Installed VMbox, Vagrant in my local. I want to do kitchen test and do changes before I work on Openstack staging environment. But every time I do kitchen test it downloads the imaged from web and takes a while to create the…
Raashi
  • 121
  • 1
  • 2
  • 9
0
votes
1 answer

Test kitchen keeps waiting for ssh after creating instance for kitchen google

The username is setup properly in the metadata and able to login to the box using the key. But for some reason once the kitchen completes the instance creation, it keeps waiting for ssh and never is able to login.
Saurav
  • 414
  • 6
  • 17
0
votes
3 answers

kitchen-docker: How to run a shell command before kitchen converge

When using vagrant machines with test-kitchen the pre_create_command allows you to specify a command which is run locally before the vagrant machine is being created. With kitchen-docker no such configuration option seems to exist, and bending…
trish
  • 1
  • 3
0
votes
1 answer

ulimit in test kitchen

The operating system is Centos 7, I am using Test Kitchen 1.13.2 and centos-7.2 default vagrant box. I need nproc to be above a certain limit for one user, for this I modified /etc/security/limits.d/20-nproc.conf (Which overrides…
Navarro
  • 1,284
  • 2
  • 17
  • 40