Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 78

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Running the Regression Script</TITLE>
<META NAME="description" CONTENT="Running the Regression Script">
<META NAME="keywords" CONTENT="developers">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="developers.css">

<LINK REL="next" HREF="Testing_Binary_Installation.html">
<LINK REL="previous" HREF="Setting_up_Regession_Testin.html">
<LINK REL="up" HREF="Bacula_Regression_Testing.html">
<LINK REL="next" HREF="Testing_Binary_Installation.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1475"
  HREF="Testing_Binary_Installation.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1469"
  HREF="Bacula_Regression_Testing.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1463"
  HREF="Setting_up_Regession_Testin.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1471"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1473"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1476"
  HREF="Testing_Binary_Installation.html">Testing a Binary Installation</A>
<B> Up:</B> <A NAME="tex2html1470"
  HREF="Bacula_Regression_Testing.html">Bacula Regression Testing</A>
<B> Previous:</B> <A NAME="tex2html1464"
  HREF="Setting_up_Regession_Testin.html">Setting up Regession Testing</A>
 &nbsp; <B>  <A NAME="tex2html1472"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1474"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html1477"
  HREF="Running_Regression_Script.html#SECTION001521000000000000000">Setting the Configuration Parameters</A>
<LI><A NAME="tex2html1478"
  HREF="Running_Regression_Script.html#SECTION001522000000000000000">Building the Test Bacula</A>
<LI><A NAME="tex2html1479"
  HREF="Running_Regression_Script.html#SECTION001523000000000000000">Setting up your SQL engine</A>
<LI><A NAME="tex2html1480"
  HREF="Running_Regression_Script.html#SECTION001524000000000000000">Running the Disk Only Regression</A>
<LI><A NAME="tex2html1481"
  HREF="Running_Regression_Script.html#SECTION001525000000000000000">Other Tests</A>
<LI><A NAME="tex2html1482"
  HREF="Running_Regression_Script.html#SECTION001526000000000000000">If a Test Fails</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION001520000000000000000"></A>
<A NAME="5148"></A>
<A NAME="5149"></A>
<BR>
Running the Regression Script
</H1>

<P>
There are a number of different tests that may be run, such as: the standard
set that uses disk Volumes and runs under any userid; a small set of tests
that write to tape; another set of tests where you must be root to run them.
Normally, I run all my tests as non-root and very rarely run the root
tests.  The tests vary in length, and running the full tests including disk
based testing, tape based testing, autochanger based testing, and multiple
drive autochanger based testing can take 3 or 4 hours.

<P>

<H2><A NAME="SECTION001521000000000000000"></A>
<A NAME="5154"></A>
<A NAME="5155"></A>
<BR>
Setting the Configuration Parameters
</H2>

<P>
There is nothing you need to change in the source directory.  

<P>
To begin:

<P>
<PRE>
cd bacula/regress
</PRE>
<P>
The        
very first time you are going to run the regression scripts, you will
need to create a custom config file for your system. 
We suggest that you start by:

<P>
<PRE>
cp prototype.conf config
</PRE>
<P>
Then you can edit the <B>config</B> file directly.

<P>
<PRE>
                                                                                        
# Where to get the source to be tested
BACULA_SOURCE="${HOME}/bacula/bacula"

# Where to send email   !!!!! Change me !!!!!!!
EMAIL=your-name@your-domain.com
SMTP_HOST="localhost"

# Full "default" path where to find sqlite (no quotes!)
SQLITE3_DIR=${HOME}/depkgs/sqlite3
SQLITE_DIR=${HOME}/depkgs/sqlite

TAPE_DRIVE="/dev/nst0"
# if you don't have an autochanger set AUTOCHANGER to /dev/null
AUTOCHANGER="/dev/sg0"
# For two drive tests -- set to /dev/null if you do not have it 
TAPE_DRIVE1="/dev/null"

# This must be the path to the autochanger including its name
AUTOCHANGER_PATH="/usr/sbin/mtx"

# Set your database here
#WHICHDB="--with-sqlite=${SQLITE_DIR}"
#WHICHDB="--with-sqlite3=${SQLITE3_DIR}"
#WHICHDB="--with-mysql"
WHICHDB="--with-postgresql"

# Set this to "--with-tcp-wrappers" or "--without-tcp-wrappers"
TCPWRAPPERS="--with-tcp-wrappers"

# Set this to "" to disable OpenSSL support, "--with-openssl=yes"
# to enable it, or provide the path to the OpenSSL installation,
# eg "--with-openssl=/usr/local"
OPENSSL="--with-openssl"

# You may put your real host name here, but localhost is valid also
#  and it has the advantage that it works on a non-newtworked machine
HOST="localhost"
</PRE>
<P>

<UL>
<LI><B>BACULA_SOURCE</B> should be the full path to the Bacula source code 
   that you wish to test. It will be loaded configured, compiled, and
   installed with the "make setup" command, which needs to be done only
   once each time you change the source code.

<P>
</LI>
<LI><B>EMAIL</B> should be your email addres. Please remember  to change this
   or I will get a flood of unwanted  messages. You may or may not want to see
   these emails. In  my case, I don't need them so I direct it to the bit bucket.

<P>
</LI>
<LI><B>SMTP_HOST</B> defines where your SMTP server is.

<P>
</LI>
<LI><B>SQLITE_DIR</B> should be the full path to the sqlite package,  must
   be build before running a Bacula regression, if you are  using SQLite. This
   variable is ignored if you are using  MySQL or PostgreSQL. To use PostgreSQL,
   edit the Makefile  and change (or add) WHICHDB?=``<code>--</code>with-postgresql''.  For
   MySQL use ``WHICHDB=''<code>--</code>with-mysql``. 

<P>
The advantage of using SQLite is that it is totally independent of any
   installation you may have running on your system, and there is no
   special configuration or authorization that must be done to run it.
   With both MySQL and PostgreSQL, you must pre-install the packages,
   initialize them and ensure that you have authorization to access the 
   database and create and delete tables.

<P>
</LI>
<LI><B>TAPE_DRIVE</B> is the full path to your tape drive.  The base set of
   regression tests do not use a tape, so this is only important if you want to
   run the full tests. Set this to  /dev/null if you do not have a tape drive.

<P>
</LI>
<LI><B>TAPE_DRIVE1</B> is the full path to your second tape drive, if
   have one. The base set of
   regression tests do not use a tape, so  this is only important if you want to
   run the full two drive tests.  Set this to  /dev/null if you do not have a
   second tape drive.

<P>
</LI>
<LI><B>AUTOCHANGER</B> is the name of your autochanger control device.  Set this to
   /dev/null if you do not have an autochanger. 

<P>
</LI>
<LI><B>AUTOCHANGER_PATH</B> is the full path including the  program name for
   your autochanger program (normally  <B>mtx</B>. Leave the default value if you
   do not have one. 

<P>
</LI>
<LI><B>TCPWRAPPERS</B> defines whether or not you want the ./configure
   to be performed with tcpwrappers enabled.

<P>
</LI>
<LI><B>OPENSSL</B> used to enable/disable SSL support for Bacula
   communications and data encryption.

<P>
</LI>
<LI><B>HOST</B> is the hostname that it will use when building the
   scripts. The Bacula daemons will be named &lt;HOST&gt;-dir, &lt;HOST&gt;-fd,
   ... It is also the name of the HOST machine that to connect to the
   daemons by the network.  Hence the name should either be your real
   hostname (with an appropriate DNS or /etc/hosts entry) or <B>   localhost</B> as it is in the default file.

<P>
</LI>
<LI><B>bin</B> is the binary location.

<P>
</LI>
<LI><B>scripts</B> is the bacula scripts location (where we could find
  database creation script, autochanger handler, etc.)

<P>
</LI>
</UL>

<P>

<H2><A NAME="SECTION001522000000000000000"></A>
<A NAME="5184"></A>
<A NAME="5185"></A>
<BR>
Building the Test Bacula
</H2>

<P>
Once the above variables are set, you can build the Makefile by entering: 

<P>
<PRE>
./config xxx.conf
</PRE>
<P>
Where xxx.conf is the name of the conf file containing your system parameters.
This will build a Makefile from Makefile.in, and you should not need to
do this again unless you want to change the database or other regression
configuration parameter.

<P>

<H2><A NAME="SECTION001523000000000000000"></A>
<A NAME="5192"></A>
<BR>
Setting up your SQL engine
</H2>

If you are using SQLite or SQLite3, there is nothing more to do; you can   
simply run the tests as described in the next section.

<P>
If you are using MySQL or PostgreSQL, you will need to establish an
account with your database engine for the user name <B>regress</B> and
you will need to manually create a database named <B>regress</B> that can be
used by user name regress, which means you will have to give the user
regress sufficient permissions to use the database named regress.
There is no password on the regress account.

<P>
You have probably already done this procedure for the user name and
database named bacula.  If not, the manual describes roughly how to
do it, and the scripts in bacula/regress/build/src/cats named
create_mysql_database, create_postgresql_database, grant_mysql_privileges,
and grant_postgresql_privileges may be of a help to you.

<P>
Generally, to do the above, you will need to run under root to 
be able to create databases and modify permissions within MySQL and
PostgreSQL.

<P>

<H2><A NAME="SECTION001524000000000000000"></A>
<A NAME="5199"></A>
<A NAME="5200"></A>
<BR>
Running the Disk Only Regression
</H2>

<P>
The simplest way to copy the source code, configure it, compile it, link
it, and run the tests is to use a helper script:

<P>
<PRE>
./do_disk
</PRE>
<P>
This will run the base set of tests using disk Volumes.
If you are testing on a
non-Linux machine several of the of the tests may not be run.  In any case,
as we add new tests, the number will vary.  It will take about 1 hour
and you don't need to be root
to run these tests (I run under my regular userid).  The result should be
something similar to:

<P>
<PRE>
Test results
  ===== auto-label-test OK 12:31:33 =====
  ===== backup-bacula-test OK 12:32:32 =====
  ===== bextract-test OK 12:33:27 =====
  ===== bscan-test OK 12:34:47 =====
  ===== bsr-opt-test OK 12:35:46 =====
  ===== compressed-test OK 12:36:52 =====
  ===== compressed-encrypt-test OK 12:38:18 =====
  ===== concurrent-jobs-test OK 12:39:49 =====
  ===== data-encrypt-test OK 12:41:11 =====
  ===== encrypt-bug-test OK 12:42:00 =====
  ===== fifo-test OK 12:43:46 =====
  ===== backup-bacula-fifo OK 12:44:54 =====
  ===== differential-test OK 12:45:36 =====
  ===== four-concurrent-jobs-test OK 12:47:39 =====
  ===== four-jobs-test OK 12:49:22 =====
  ===== incremental-test OK 12:50:38 =====
  ===== query-test OK 12:51:37 =====
  ===== recycle-test OK 12:53:52 =====
  ===== restore2-by-file-test OK 12:54:53 =====
  ===== restore-by-file-test OK 12:55:40 =====
  ===== restore-disk-seek-test OK 12:56:29 =====
  ===== six-vol-test OK 12:57:44 =====
  ===== span-vol-test OK 12:58:52 =====
  ===== sparse-compressed-test OK 13:00:00 =====
  ===== sparse-test OK 13:01:04 =====
  ===== two-jobs-test OK 13:02:39 =====
  ===== two-vol-test OK 13:03:49 =====
  ===== verify-vol-test OK 13:04:56 =====
  ===== weird-files2-test OK 13:05:47 =====
  ===== weird-files-test OK 13:06:33 =====
  ===== migration-job-test OK 13:08:15 =====
  ===== migration-jobspan-test OK 13:09:33 =====
  ===== migration-volume-test OK 13:10:48 =====
  ===== migration-time-test OK 13:12:59 =====
  ===== hardlink-test OK 13:13:50 =====
  ===== two-pool-test OK 13:18:17 =====
  ===== fast-two-pool-test OK 13:24:02 =====
  ===== two-volume-test OK 13:25:06 =====
  ===== incremental-2disk OK 13:25:57 =====
  ===== 2drive-incremental-2disk OK 13:26:53 =====
  ===== scratch-pool-test OK 13:28:01 =====
Total time = 0:57:55 or 3475 secs
</PRE>
<P>
and the working tape tests are run with

<P>
<PRE>
make full_test
</PRE>
<P>
<PRE>
Test results
  
  ===== Bacula tape test OK =====
  ===== Small File Size test OK =====
  ===== restore-by-file-tape test OK =====
  ===== incremental-tape test OK =====
  ===== four-concurrent-jobs-tape OK =====
  ===== four-jobs-tape OK =====
</PRE>
<P>
Each separate test is self contained in that it initializes to run Bacula from
scratch (i.e. newly created database). It will also kill any Bacula session
that is currently running. In addition, it uses ports 8101, 8102, and 8103 so
that it does not intefere with a production system. 

<P>
Alternatively, you can do the ./do_disk work by hand with:

<P>
<PRE>
make setup
</PRE>
<P>
The above will then copy the source code within
the regression tree (in directory regress/build), configure it, and build it.
There should be no errors. If there are, please correct them before
continuing. From this point on, as long as you don't change the Bacula
source code, you should not need to repeat any of the above steps.  If
you pull down a new version of the source code, simply run <B>make setup</B>
again.

<P>
Once Bacula is built, you can run the basic disk only non-root regression test
by entering: 

<P>
<PRE>
make test
</PRE>
<P>

<H2><A NAME="SECTION001525000000000000000"></A>
<A NAME="5218"></A>
<A NAME="5219"></A>
<BR>
Other Tests
</H2>

<P>
There are a number of other tests that can be run as well. All the tests are a
simply shell script keep in the regress directory. For example the ''make
test`` simply executes <B>./all-non-root-tests</B>. The other tests, which
are invoked by directly running the script are:

<P>
<DL>
<DT><STRONG>all_non-root-tests</STRONG></DT>
<DD><A NAME="5225"></A>
   All non-tape tests not requiring root.  This is the standard set of tests,
that in general, backup some  data, then restore it, and finally compares the
restored data  with the original data.  

<P>
</DD>
<DT><STRONG>all-root-tests</STRONG></DT>
<DD><A NAME="5226"></A>
   All non-tape tests requiring root permission.  These are a relatively small
number of tests that require running  as root. The amount of data backed up
can be quite large. For  example, one test backs up /usr, another backs up
/etc. One  or more of these tests reports an error - I'll fix it one  day. 

<P>
</DD>
<DT><STRONG>all-non-root-tape-tests</STRONG></DT>
<DD><A NAME="5227"></A>
   All tape test not requiring root.  There are currently three tests, all run
without being root,  and backup to a tape. The first two tests use one volume,
and the third test requires an autochanger, and uses two  volumes. If you
don't have an autochanger, then this script  will probably produce an error. 

<P>
</DD>
<DT><STRONG>all-tape-and-file-tests</STRONG></DT>
<DD><A NAME="5228"></A>
   All tape and file tests not requiring  root. This includes just about
everything, and I don't run it  very often. 
</DD>
</DL>

<P>

<H2><A NAME="SECTION001526000000000000000"></A>
<A NAME="5231"></A>
<A NAME="5232"></A>
<BR>
If a Test Fails
</H2>

<P>
If you one or more tests fail, the line output will be similar to: 

<P>
<PRE>
  !!!!! concurrent-jobs-test failed!!! !!!!!
</PRE>
<P>
If you want to determine why the test failed, you will need to rerun the
script with the debug output turned on.  You do so by defining the
environment variable <B>REGRESS_DEBUG</B> with commands such as:

<P>
<PRE>
REGRESS_DEBUG=1
export REGRESS_DEBUG
</PRE>

<P>
Then from the "regress" directory (all regression scripts assume that
you have "regress" as the current directory), enter:

<P>
<PRE>
tests/test-name
</PRE>

<P>
where test-name should be the name of a test script - for example:
<B>tests/backup-bacula-test</B>.

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1475"
  HREF="Testing_Binary_Installation.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1469"
  HREF="Bacula_Regression_Testing.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1463"
  HREF="Setting_up_Regession_Testin.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1471"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1473"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1476"
  HREF="Testing_Binary_Installation.html">Testing a Binary Installation</A>
<B> Up:</B> <A NAME="tex2html1470"
  HREF="Bacula_Regression_Testing.html">Bacula Regression Testing</A>
<B> Previous:</B> <A NAME="tex2html1464"
  HREF="Setting_up_Regession_Testin.html">Setting up Regession Testing</A>
 &nbsp; <B>  <A NAME="tex2html1472"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1474"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>