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
2 answers

Chef test-kitchen fails to converge on Debian 7.11 instance

I'm currently using Chef's test-kitchen to test my configurations before applying them to my managed nodes. I've specified Ubuntu 14.04 + 16.04, as well as Debian 7.11 + 8.8 as the platforms to be tested on. I am able to converge my configuration on…
J0991
  • 977
  • 2
  • 9
  • 16
0
votes
1 answer

ruby implicit conversion of String into integer in chef recipe

I'm using the latest apache2 cookbook (v5.0.0) in a wrapper file. my wrapper recipe is just including the apache2 recipe so I'm not sure what is causing this error in my kitchen test when I try to setup the test suite??? Wrapper Recipe …
veilig
  • 5,085
  • 10
  • 48
  • 86
0
votes
1 answer

how to see logs like the Log.info("something") in test kitchen?

i did this but its not showing any log on the console even after running kitchen test -l info
0
votes
1 answer

Unable to load provisioning/aws_driver when running chef test kitchen

I'm trying to set up kitchen and having difficulties with this aspect. As far as I can tell, the yml looks correct but it's constantly error'ing when running the recipe. The error: LoadError cannot load such file --…
null
  • 3,469
  • 7
  • 41
  • 90
0
votes
1 answer

How to print test output or log at the end of "Kitchen Converge"?

We are compiling cucumber tests using Kitchen. We could able to run the test cases and everything is good. What we want is, printing the test report at the end of the Kitchen Converge. Is it possible to run a chef recipe in debug mode. We know…
Sekhar
  • 499
  • 2
  • 6
  • 15
0
votes
0 answers

creating block device for portwoks container using chef kitchen

I wana test a protworks container using chef and for that i require one block device created by vagrat as driver in .kitchen.yml file till now what i was doing is this. --- driver: name: vagrant customize: createhd: filename:…
0
votes
1 answer

test kitchen salt_solo passing in variables from platforms

I am running test kitchen with salt using salt_solo and I cannot pass variables into the formula if I declare them in the platform. For example if this was my .kitchen.yml --- driver: name: vagrant platforms: - name: ubuntu-14.04 grains: …
Alex Cohen
  • 5,596
  • 16
  • 54
  • 104
0
votes
1 answer

Chef: Are Bento boxes available for ubuntu server editions?

I'm currently using Chef's Test Kitchen to test my cookbook recipes before applying the recipes to my managed node. My managed node has the operating system Ubuntu 16.04 server edition. I can see a listing of base boxes provided by the Bento project…
J0991
  • 977
  • 2
  • 9
  • 16
0
votes
1 answer

Chef Test Kitchen: How to verify Jenkins is running in sandbox

I am currently using the Jenkins Supermarket cookbook to create a Jenkins instance. I am using the Java_se cookbook to configure Java as a prerequisite of installing Jenkins. Prior to configuring a managed node with the cookbook, I am using Test…
J0991
  • 977
  • 2
  • 9
  • 16
0
votes
1 answer

Chef Workstation: Overcoming nested virtualization issues

Regarding Chef Workstation best practices: I currently am setting up a Chef Workstation on a windows 7 machine. In order to avoid Powershell scripts, I have my workstation setup on a VM running on Virtualbox. When I attempt to use Chef's…
J0991
  • 977
  • 2
  • 9
  • 16
0
votes
1 answer

Kitchen login failed :Could not resolve host name

I am using test-kitchen and created a centos docker image. my .kitchen.yml file looks like this I have performed kitchen createand kitchen converge command and then looked into the created files with kitchen list and I also have a docker image…
0
votes
1 answer

Chef Serverspec should not listen

From this link I could see http://serverspec.org/resource_types.html#port describe port(80) do it { should be_listening } end I wanted to test the negative of it. Say I disabled a port and I don't want anything listening to that port. What…
Mark Estrada
  • 9,013
  • 37
  • 119
  • 186
0
votes
0 answers

Wordpress issue - could not get domain name

I'm trying to test a Wordpress configuration I'm building in Chef with Test Kitchen. The server is coming up with a temporary ip - this seems to have something to do with the error I'm getting when I try to visit the site in a browser: Could not get…
TyMac
  • 783
  • 2
  • 9
  • 32
0
votes
1 answer

Why is Chef kitchen create failing to validate my AWS key?

I'm having a problem with kitchen create. Says its failing to validate the provided access credentials. No idea why. -------------- >>>>>> ------Exception------- >>>>>> Class: Kitchen::ActionFailed >>>>>> Message: 1 actions failed. >>>>>> Failed…
wolf4091
  • 35
  • 7
0
votes
1 answer

What is going on vagrant VM while kitchen converges

When I do a kitchen converge sometimes the logs on the console get stuck. For eg: * execute[apt-get -q update] action run - execute apt-get -q update Is there any way I can check what is going on , on the vagrant VM exactly? In this case when we…
codec
  • 7,978
  • 26
  • 71
  • 127