30 Days of DevOps Day 26: Infrastructure as Code to be Tested

Day 26 of 30 Days of DevOps ties us in nicely to 30 Days of DevOps Day 24: Infrastructure as Code Definitions

Share an example of infrastructure as code that needs to be tested.

As this isn’t an area I’m super experienced in, I’m hoping that some of you can help me with examples?

oh, here’s another description/article:

I’m currently involved in a project around moving servers from a “classic datacenter” VMware setup to cloud-based infrastructure (as Code). The requirements, as prepared by the architect are around network segments, port openings, server sizes and naming standards.

As this is hundreds of servers and a range of networks (shell) scripts are used to “construct and deploy” the solution. And mistakes happen, simply because we are humans, and bugs like this occurs:

  • naming conventions are not followed
  • server open on port http, but should be httpS
  • servers included in the wrong network segment
  • OS are not patched after initial deploy

So the system under test is a totally different thing than in classic software development. Luckily it’s usually an easy fix - unless it’s actually a live end-user facing system you are restarting.

There’s less ambiguity wrt infrastructure tests as the requirements usually are very explicit (noone asks for a server that “looks nice”). So we can automate a lot of it, if we dare to be smart about it. for more info on “Pester” and “Open Validation Framework” read:

BTW: we recently added “code review” to the project… what’s next 3 amigos? :smiley:

1 Like

This is a weak point for me. Stephan Kämper did a great sidebar on testing infrastructure as code in our More Agile Testing book, if anyone wants to read that, ping me and I’ll send the sidebar. And, ping Stephan on Twitter, @S_2K, I’m sure he’d help! Might also be something on his website.


On Twitter I found