Sophie

Sophie

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

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>Writing a Regression Test</TITLE>
<META NAME="description" CONTENT="Writing a Regression Test">
<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="previous" HREF="Running_Single_Test.html">
<LINK REL="up" HREF="Bacula_Regression_Testing.html">
<LINK REL="next" HREF="Bacula_MD5_Algorithm.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1521"
  HREF="Bacula_MD5_Algorithm.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1515"
  HREF="Bacula_Regression_Testing.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1511"
  HREF="Running_Single_Test.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1517"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1519"
  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="tex2html1522"
  HREF="Bacula_MD5_Algorithm.html">Bacula MD5 Algorithm</A>
<B> Up:</B> <A NAME="tex2html1516"
  HREF="Bacula_Regression_Testing.html">Bacula Regression Testing</A>
<B> Previous:</B> <A NAME="tex2html1512"
  HREF="Running_Single_Test.html">Running a Single Test</A>
 &nbsp; <B>  <A NAME="tex2html1518"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1520"
  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="tex2html1523"
  HREF="Writing_Regression_Test.html#SECTION001551000000000000000">Running the Tests by Hand</A>
<LI><A NAME="tex2html1524"
  HREF="Writing_Regression_Test.html#SECTION001552000000000000000">Directory Structure</A>
<LI><A NAME="tex2html1525"
  HREF="Writing_Regression_Test.html#SECTION001553000000000000000">Adding a New Test</A>
<LI><A NAME="tex2html1526"
  HREF="Writing_Regression_Test.html#SECTION001554000000000000000">Running a Test Under The Debugger</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION001550000000000000000"></A>
<A NAME="5274"></A>
<A NAME="5275"></A>
<BR>
Writing a Regression Test
</H1>

<P>
Any developer, who implements a major new feature, should write a regression
test that exercises and validates the new feature. Each regression test is a
complete test by itself. It terminates any running Bacula, initializes the
database, starts Bacula, then runs the test by using the console program. 

<P>

<H2><A NAME="SECTION001551000000000000000"></A>
<A NAME="5280"></A>
<A NAME="5281"></A>
<BR>
Running the Tests by Hand
</H2>

<P>
You can run any individual test by hand by cd'ing to the <B>regress</B>
directory and entering: 

<P>
<PRE>
tests/&lt;test-name&gt;
</PRE>
<P>

<H2><A NAME="SECTION001552000000000000000"></A>
<A NAME="5289"></A>
<A NAME="5290"></A>
<BR>
Directory Structure
</H2>

<P>
The directory structure of the regression tests is: 

<P>
<PRE>
  regress                - Makefile, scripts to start tests
    |------ scripts      - Scripts and conf files
    |-------tests        - All test scripts are here
    |
    |------------------ -- All directories below this point are used
    |                       for testing, but are created from the
    |                       above directories and are removed with
    |                       "make distclean"
    |
    |------ bin          - This is the install directory for
    |                        Bacula to be used testing
    |------ build        - Where the Bacula source build tree is
    |------ tmp          - Most temp files go here
    |------ working      - Bacula working directory
    |------ weird-files  - Weird files used in two of the tests.
</PRE>
<P>

<H2><A NAME="SECTION001553000000000000000"></A>
<A NAME="5297"></A>
<A NAME="5298"></A>
<BR>
Adding a New Test
</H2>

<P>
If you want to write a new regression test, it is best to start with one of
the existing test scripts, and modify it to do the new test. 

<P>
When adding a new test, be extremely careful about adding anything to any of
the daemons' configuration files. The reason is that it may change the prompts
that are sent to the console. For example, adding a Pool means that the
current scripts, which assume that Bacula automatically selects a Pool, will
now be presented with a new prompt, so the test will fail. If you need to
enhance the configuration files, consider making your own versions. 

<P>

<H2><A NAME="SECTION001554000000000000000"></A>
<A NAME="5303"></A>
<BR>
Running a Test Under The Debugger
</H2>

You can run a test under the debugger (actually run a Bacula daemon
under the debugger) by first setting the environment variable
<B>REGRESS_WAIT</B> with commands such as:

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

<P>
Then executing the script.  When the script prints the following line:

<P>
<PRE>
Start Bacula under debugger and enter anything when ready ...
</PRE>

<P>
You start the Bacula component you want to run under the debugger in a
different shell window.  For example:

<P>
<PRE>
cd .../regress/bin
gdb bacula-sd 
(possibly set breakpoints, ...)
run -s -f
</PRE>

<P>
Then enter any character in the window with the above message. 
An error message will appear saying that the daemon you are debugging
is already running, which is the case. You can simply ignore the
error message.  

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1521"
  HREF="Bacula_MD5_Algorithm.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1515"
  HREF="Bacula_Regression_Testing.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1511"
  HREF="Running_Single_Test.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1517"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1519"
  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="tex2html1522"
  HREF="Bacula_MD5_Algorithm.html">Bacula MD5 Algorithm</A>
<B> Up:</B> <A NAME="tex2html1516"
  HREF="Bacula_Regression_Testing.html">Bacula Regression Testing</A>
<B> Previous:</B> <A NAME="tex2html1512"
  HREF="Running_Single_Test.html">Running a Single Test</A>
 &nbsp; <B>  <A NAME="tex2html1518"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1520"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

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