VMTH - Unit test your infrastructure automation

35 views
Skip to first unread message

Greg Retkowski

unread,
Apr 26, 2011, 9:40:41 PM4/26/11
to agile-system-...@googlegroups.com, dev...@googlegroups.com, devops-t...@googlegroups.com
Have you wished you had a way to unit-test your infrastructure automation
code? I have, and I created a tool to tackle this problem. I'm pleased to
announce the initial release of the Virtual Machine Test Harness (VMTH).

The VMTH provides a mechanism to unit-test your infrastructure automation
- puppet policies, chef recipes, release deployment scripts, etc. It uses
the snapshotting feature of the qemu virtual machine monitor to quickly
unit-test your automation code against a virtual machine running a system
image that matches the ones you use in your server deployments.

I created the VMTH after struggling with how to test puppet configurations
in my environment. Checking them in and then applying them to a physical
machine didn't feel right - it meant releasing the code before I was sure
it would work as intended. And it was hard to know how changes affected
classes that depended on them.

If most software can have a set of unit-tests that exercise functionality
before the software is released, why can't automation software have the
same safety-net? Tackling that problem was my inspiration for creating the
VMTH. I now use it to unit-test 60 different puppet classes, a full run
takes about five hours. It is integrated with my CI system, so any commit
to the puppet subtree triggers the tests on the CI system and I get a
message later in the day if my commit passes or fails unit tests.

I also use it to test large changes to our infrastructure before releasing
it to real machines. I recently used it to pre-test our rollout of Puppet
2.6 and our OS patching tools.

VMTH is available via github or as a ruby gem, and currently requires qemu
w/ kvm support to run. It is downloadable here!

https://github.com/gregretkowski/vmth/

Fabio Kung

unread,
Apr 26, 2011, 10:27:01 PM4/26/11
to agile-system-...@googlegroups.com, dev...@googlegroups.com, devops-t...@googlegroups.com
Congrats!

You will probably want to take a look at Vagrant too:


--
You received this message because you are subscribed to the Google Groups "Agile System Administration" group.
To post to this group, send email to agile-system-...@googlegroups.com.
To unsubscribe from this group, send email to agile-system-admini...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/agile-system-administration?hl=en.


Rick Arnett

unread,
Apr 27, 2011, 12:28:34 AM4/27/11
to agile-system-...@googlegroups.com, devops-t...@googlegroups.com, dev...@googlegroups.com

+1 for on topic posts.

--
Rick

Greg Retkowski

unread,
Apr 27, 2011, 1:24:44 PM4/27/11
to agile-system-...@googlegroups.com, dev...@googlegroups.com, devops-t...@googlegroups.com
Vagrant looks pretty cool, one of my fellow team members was looking into
it as a way to provide each developer with production-like instance of
linux that they could do their development on. We've been bitten by the
occasional developer who's bringing us code they developed on an alternate
linux distro - they/we go through some pain getting their code modified
to work in our production environment. Way easier for all parties involved
if they have access to that environment right on the desktop.

-- Greg

Reply all
Reply to author
Forward
0 new messages