An introduction to infrastructure testing with PowerShell Pester
When a software developer is asked about testing, they’ll most likely talk about unit, integration, functional, or acceptance testing. These are the kinds of tests that have been around for decades and are considered formal testing strategies. Then, one day, system administrators decided they wanted in on the coding action, and infrastructure development was born. I’m going to define an “infrastructure developer” as anyone that writes code to provision and manage any kind of infrastructure.
Infrastructure code, by its nature, changes stuff in an environment. It provisions VMs, installs software, copies files, and so on. It’s advisable to write unit tests to check the code itself, integration tests to ensure the code changed the stuff you intended, and acceptance tests to test the result. However, there’s a gray area in there that’s like a combination of integration and acceptance testing; I’m calling this infrastructure testing.
Infrastructure testing is primarily testing the result of infrastructure code or just ensuring the infrastructure works as expected; no code involved at all. Think of infrastructure testing as simply writing code to ensure servers are online, registry keys are created in the right spot, files are where they’re supposed to be, user accounts are created correctly, etc…
Read the full article on 4SysOps.