Setting up Regession Testing

This document is intended mostly for developers who wish to ensure that their changes to Bacula don't introduce bugs in the base code. However, you don't need to be a developer to run the regression scripts, and we recommend them before putting your system into production, and before each upgrade, especially if you build from source code. They are simply shell scripts that drive Bacula through bconsole and then typically compare the input and output with diff.

You can find the existing regression scripts in the Bacula developer's git repository on SourceForge. We strongly recommend that you clone the repository because afterwards, you can easily get pull the updates that have been made.

To get started, we recommend that you create a directory named bacula, under which you will put the current source code and the current set of regression scripts. Below, we will describe how to set this up.

The top level directory that we call bacula can be named anything you want. Note, all the standard regression scripts run as non-root and can be run on the same machine as a production Bacula system (the developers run it this way).

To create the directory structure for the current trunk and to clone the repository, do the following (note, we assume you are working in your home directory in a non-root account):

git clone git://bacula.git.sourceforge.net/gitroot/bacula bacula

This will create the directory bacula and populate it with three directories: bacula, gui, and regress. bacula contains the Bacula source code; gui contains certain gui programs that you will not need, and regress contains all the regression scripts. The above should be needed only once. Thereafter to update to the latest code, you do:

cd bacula
git pull

If you want to test with SQLite and it is not installed on your system, you will need to download the latest depkgs release from Source Forge and unpack it into depkgs, then simply:

cd depkgs
make

There are two different aspects of regression testing that this document will discuss: 1. Running the Regression Script, 2. Writing a Regression test.

Kern Sibbald 2010-08-30