views:

280

answers:

2

I'm wondering if anyone has any best practices for automating the testing of installers on various machines with potentially different hardware / software profiles and by specifying various options to the installer. The idea would be that I could write "unit test like" code to set up a machine, run the installer, then test that certain things are true. Tests might look similar to:

Test:
    Boot Machine without IIS
    Run Installer
    Assert Installer Had Errors

Test:
    Boot Machine with IIS
    Run Installer
    Assert Installer Ran

Test_Fixture:
    SetUp:
        Boot Machine with IIS

    Test:
        Run Installer without IIS install
        Assert Website Not Installed

    Test:
        Run Installer with IIS install
        Assert Website Installed

I know I could create lots of VMs, but waiting for a VM to boot for each functional test sounds like way more work than I want. What I really want is a way to virtualize the installer environment. Any suggestions?

+1  A: 

If you have the installer runnable from the command line, it's easy to have a script to call it automatically.

Then you can use a web app testing tool to see it the install was successful, like this one http://seleniumhq.org/ For this you will need an unique way to test a new install - like a page with the current version.

Mercer Traieste
+3  A: 

We have created a set of VMs and find it is very easy to manage. We run the tests for 13 different Windows installers over night. The VMs we have created our very bare bones, so it is possible to run a number of tests in parallel.

LanceSc
How do you test the install on the VM, and how are you returning each VM to its steady state after the test?
Jeff
Our setup is that one computer drives a series of VMWare images. This computer uses the VIX API from VMWare to start, stop, and revert images. Once an image is running using the VIX API you send a command line argument to the VMWare image to start the install. Our installs must be able to run without user interface, so we can pass all arguments on the command line. We then spot check files and run a basic test. If there is an issue we perform a logged install. After finishing the test we simply revert the image. Before releasing we still have a human look test them for fit and finish.
LanceSc