Puppet Module Functional Testing with Vagrant, OpenStack and Beaker

During the last OpenStack Summit, I had the pleasure to participate to the Infra sessions and we agreed at how to make functional testing for both Puppet OpenStack and Puppet Infra modules, which is a real proof of collaboration between both groups.

However, I met some people still wondering how to test a patch in a Puppet module without affecting our own system by installing OpenStack.

This article is short but effective: it’s about testing a Puppet module by using Vagrant with OpenStack provider and Beaker.


  • Linux, Windows or MAC OS X.
  • You need to install Vagrant on your system.
  • An access to an OpenStack Cloud (or use libvirt Vagrant provider, but not explained in this article).

Let’s go!

This example will test a specific patch of puppet-keystone on CentOS7, but you can adapt the Vagrant file to spawn a Ubuntu Trusty image.
Before running any command, let’s see what we are doing here.

Here is the Vagrantfile used to provision a virtual machine in the OpenStack Cloud. You’ll need to adjust your credentials:

This is the script that will be run inside the VM to prepare the system and run the functional tests. You can adapt the module and patchset you want to test:

Open a terminal, and let’s start:

vagrant plugin install vagrant-openstack-provider
vagrant box add dummy https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box
wget https://gist.githubusercontent.com/EmilienM/c0c89f650e6942767b33/raw/deb41e80cb9cdee799ffc3b7c622905ea54e5526/beaker.sh
wget https://gist.github.com/EmilienM/499c7708cbcd08df529b/raw/9f7a739ee67e2cfed1deb9479949822a442bbd61/Vagrantfile
vagrant up --provider=openstack --debug # --debug will help to see in real-time the ssh output when running the script within the VM

Here is a demo of what happens.

The script and Vagrantfile are here for information but you’ll probably have to adjust them to test what you like.

My next step is to look at OpenStack hypervisor provided by Beaker itself, but it’s still experimental.

Happy testing!