#
General

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. 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 script in the Bacula SVN on the SourceForge SVN in the project tree named regress. I strongly recommend that you check it out of the SVN because afterwards, you can easily get updates made to them.

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 for the SVN trunk, but you can also set it up for any branch, such as the current Branch-2.4, where the currently released code resides.

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 (Kern runs it this way).

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

    cd
    mkdir bacula
    cd bacula
    svn checkout https://bacula.svn.sourceforge.net/svnroot/bacula/trunk/bacula
    svn checkout https://bacula.svn.sourceforge.net/svnroot/bacula/trunk/regress

This will get the base files that you need. The above should be needed only once. Thereafter to update to the latest code, you do:

    cd bacula/bacula
    svn update
    cd ../regress
    svn update

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 bacula/depkgs, then simply:

    cd bacula/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.