D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] Regression testing linux config [WAS: Debian and sound]

 

On 24 Jun, 2013, at 4:57 pm, tom wrote:

One thing I like is sort of unit testing - the ability to run simple tests that tell you if something is actually working or not.

Something I've taken from development practice and applied to operations. I have a simple shell script harness for running an arbitrary number of regression tests for each aspect of a host's config:

- Tests that are generic to all platforms (Can I ping the router? Can I ping <somewhere out on the Net>?)

- Tests that are specific to an OS (GNU/linux, darwin, cygwin, Solaris)

- Tests that are specific to whether the OS/distro uses launchd, inetd or xinetd

- Tests that are specific to the host

Output is a single line naming the test, colored green for success and red for failure.

Now, whenever I encounter an unexpected failure trying to do something I feel should JFW, I try to express the problem as a test which is failing. I run the tests fairly frequently -- every time I commit to or pull from source control, every time I login -- so I have a high degree of confidence in my somewhat over-complex config's health.

Just had a look at it with a view to posting it. For some reason (?) I wrote it in tcsh. I'll redo it in bash and put it up on github, and post the link. It's only a dozen or so lines.

--
Phil Hudson                  http://hudson-it.no-ip.biz
@UWascalWabbit                 PGP/GnuPG ID: 0x887DCA63


--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq