"Fossies" - the Fresh Open Source Software Archive

Member "bareos-Release-20.0.2/regress/README" (10 Jun 2021, 7642 Bytes) of package /linux/misc/bareos-Release-20.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 Bareos Regression
    2 =================
    3 
    4 Origial author: Kern Sibbald
    5 
    6 This is Bareos's regression script directory.
    7 
    8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    9 Warning!!!! Make sure not to run it on the same system
   10 with your production Catalog because the tables will all
   11 be deleted (dropped and recreated).
   12 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   13 
   14 bareos-regress package
   15 ======================
   16 
   17 When using the bareos-regress package,
   18 the software is already preconfigured to test bareos,
   19 provided by the normal install packages.
   20 The Bareos packages include a package that provide the required configuration:
   21 bareos-regress-config
   22 
   23   # as root: stop all running bareos daemon
   24 
   25   # switch to user to bareos
   26   su - bareos -s /bin/bash
   27 
   28   # enable debug output
   29   export REGRESS_DEBUG=1
   30 
   31   # run a single test (and verify that it ends with "OK"
   32   tests/backup-bareos-test
   33 
   34   # run all disk tests
   35   ./all-disk-tests
   36 
   37 
   38 
   39 Local Build
   40 ===========
   41 
   42 get sources from github
   43 -----------------------
   44 
   45   # get Bareos core
   46   git clone https://github.com/bareos/bareos-regress
   47 
   48   # get bareos-regress
   49   git clone https://github.com/bareos/bareos-regress
   50 
   51 To set it up, create your personal configuration file, by
   52 copying prototype.conf to config or simply editing prototype.conf
   53 directly then copying it to the file config.
   54 
   55   cd bareos-regress
   56   cp prototype.conf config
   57 
   58 You must end up with a file named config in the main regress
   59 directory that has all the specifications that correspond to
   60 your system.
   61 
   62 Note, be sure it is not your production database
   63 because Bareos will delete all the tables
   64 and recreate them.
   65 
   66 Then do:
   67 
   68    make setup
   69 
   70 You run the above one time.
   71 This will substitute all variables in the *.in files,
   72 copy the Bareos source, configure and build it.
   73 If you change your source, you will need to redo this command.
   74 
   75 If you only change some bareos-regress *.in files,
   76 only a "make sed" is required.
   77 
   78 Then you can run any of the tests in the tests subdirectory.
   79 Each test whose name ends in -root requires you to be root for
   80 a resonable run.  Each test is totally independent of any other
   81 test. Aside from the required "make setup", each test is totally
   82 self-initalizing and should clean up after itself.
   83 
   84 All the tests expect you to execute them from the main regress
   85 directory.
   86 
   87 Running the disk based tests:
   88 
   89 You can run all the disk based tests by doing:
   90 
   91   ./do_disk
   92 
   93 The disk based tests are totally separate from any production
   94 system, provided you have configured the database appropriately
   95 as noted above.
   96 
   97 Running all the "standard" tests:
   98 
   99 You can run all the disk and most of the tape tests by doing:
  100 
  101   ./do_all
  102 
  103 ======== Important !!! ============
  104 When running the tape tests, Bareos will write on any tape that
  105 is in the tape drive that you have configured.  If it is a production
  106 Bareos tape, it will be destroyed.  If you have configured an Autochanger,
  107 Bareos will write on the tapes in slots 1 and 2 thus destroying any
  108 information on those tapes, even if they are Bareos production tapes.
  109 ===================================
  110 
  111 Each of the above calls one or more scripts. By looking at the
  112 scripts available in this directory, you can see that there are a number
  113 of options for running tests.
  114 
  115 You can run them individually as:
  116 
  117    tests/two-jobs-test
  118 
  119 or all non-root tests (my normal testing under my account)
  120 
  121   ./all-non-root-tests
  122 
  123 or all tests
  124 
  125    su
  126    ./all-tests
  127 
  128 
  129 after running the root tests, while still root, it is a good idea
  130 to do:
  131 
  132    make reset
  133 
  134 this cleans up any files that may be created with root permissions.
  135 
  136 Tape test naming convention:
  137 
  138 The last part of the tape test name indicates (in general) what kind
  139 of test it is.  They are broken (for the most part) into test names
  140 ending with:
  141 
  142   -test     => a disk based test
  143   -tape     => a tape based test (can be a standalone tape drive
  144                 or an autochanger). Only one tape will be used
  145                 and it is assumed to be mounted.
  146   -changer  => you have an autochanger
  147 
  148 
  149 Adding tests
  150 ============
  151 
  152 If you want to add more tests, you can start from the example tests/1-example-test
  153 and follow the instructions in this file, especially about where the configuration comes from
  154 (configs/BASE plus individual extensions).
  155 
  156 To avoid re-doing a make setup if you have made a change to the
  157 conf files, and you do not need a new copy of the source, you can simply do:
  158 
  159    make sed
  160 
  161 
  162 
  163 Debugging failed tests
  164 ======================
  165 
  166 Prior versions required editing the tests/xxxx and changing a debug flag.
  167 However, that has been replaced by two environment variables:
  168 
  169    REGRESS_DEBUG
  170    REGRESS_WAIT
  171 
  172 If you define REGRESS_DEBUG, e.g.
  173 
  174    REGRESS_DEBUG=1
  175    export REGRESS_DEBUG
  176 
  177 then run a test, it will display the job and debug output.
  178 
  179 If you define REGRESS_WAIT, the script will stop and request:
  180 
  181 Start Bareos under debugger and enter anything when ready ...
  182 
  183 At this point, you can start any of the daemons under the debugger,
  184 then answer the message by entering any character.  The script will
  185 then continue. For any daemon or daemons that you have manually started,
  186 you will see an error message when the script attempts to run a second
  187 copy, but those messages can be ignored.  This makes it reasonably easy
  188 to run any component or components under the debugger if necessary.
  189 
  190 Explicit example:
  191 
  192 In shell window 1.
  193 
  194 cd regress
  195 export REGRESS_DEBUG=1
  196 export REGRESS_WAIT=1
  197 tests/name-of-script-test
  198 (wait until it tells you to start the debugger)
  199 
  200 In shell window 2
  201 
  202 cd regress/bin
  203 gdb bareos-xx    (where xx is the component you want to debug).
  204 (possibly set a break point -- normally not)
  205 run -s -f
  206 (wait for the output to stop)
  207 
  208 In shell window 1
  209 (enter any character or simply a return)
  210 (ignore the error message it prints complaining that the daemon
  211 you are debugging is already running, which is in fact the case).
  212 
  213 That is all there is to it.  The debugger window will get some
  214 output and will stop waiting for input if anything goes wrong
  215 like a seg fault.  At that point, you can enter commands.
  216 
  217 The procedure avoids modifying the test scripts and trying to
  218 find pids and the such.  If you want less debug output when
  219 debugging, don't set REGRESS_DEBUG=1.
  220 
  221 
  222 Troubleshooting
  223 ===============
  224 
  225 If you run from time to time on a computer that is not connected
  226 to the network, please be sure that "hostname" is set to "localhost",
  227 otherwise, your tests may fail because the hostname used by Bareos's
  228 ./configure cannot be properly resolved.
  229 
  230 Anyway, you can debug where it is happening in the source code using the
  231 following example.  For example, here I get the following backtrace:
  232 
  233 ======= Backtrace: =========
  234 /lib/libc.so.6[0xb7b9d6e1]
  235 /lib/libc.so.6(cfree+0x89)[0xb7b9ed79]
  236 /home/kern/bareos/regress/bin/bareos-fd[0x8082ae5]
  237 /home/kern/bareos/regress/bin/bareos-fd[0x8082d58]
  238 /home/kern/bareos/regress/bin/bareos-fd[0x80838ac]
  239 /home/kern/bareos/regress/bin/bareos-fd[0x807aa3f]
  240 /home/kern/bareos/regress/bin/bareos-fd[0x807ac29]
  241 /home/kern/bareos/regress/bin/bareos-fd[0x804d188]
  242 /lib/libc.so.6(__libc_start_main+0xdc)[0xb7b4ef9c]
  243 /home/kern/bareos/regress/bin/bareos-fd[0x804cd21]
  244 
  245 Now to convert this into something more meaningful, kill off any hung Bareos
  246 processes.  Note the one that was running -- above you see that it was
  247 bareos-fd, then bring the same binary up in the debugger.  Then start at the
  248 first bareos-fd line, and feed the hex number to gdb as follows:
  249 
  250 info symbol 0x8082ae5
  251 free_addresses(dlist*) + 53 in section .text
  252 
  253 info symbol 0x8082d58
  254 add_address(dlist**, IPADDR::i_type, unsigned short, int, char const*, char
  255 const*, char**) + 568 in section .text