• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

configs/H13-Sep-2021-3,9423,459

data/H03-May-2022-

debian/H13-Sep-2021-13275

packaging/H13-Sep-2021-9576

scripts/H13-Sep-2021-16,71214,213

tests/H13-Sep-2021-43,69936,018

CTestCustom.cmakeH A D13-Sep-2021840 2621

DartConfiguration.tcl.inH A D13-Sep-2021411 1615

DartTestfile.txt.inH A D13-Sep-202111.9 KiB175167

LICENSEH A D13-Sep-202146 KiB947776

MakefileH A D13-Sep-20211.9 KiB9460

READMEH A D13-Sep-20217.5 KiB256175

README.ctestH A D13-Sep-202111 KiB250190

all-changer-testsH A D13-Sep-2021318 169

all-dev-testsH A D13-Sep-20212 KiB7160

all-disk-testsH A D13-Sep-20213.9 KiB137127

all-root-testsH A D13-Sep-2021296 1611

all-tape-testsH A D13-Sep-2021974 3728

bwatchH A D13-Sep-202157 31

debugH A D13-Sep-2021232 138

do_allH A D13-Sep-202141 42

do_all_no_setupH A D13-Sep-202125 31

do_all_tapesH A D13-Sep-202147 42

do_all_testsH A D13-Sep-2021377 2119

do_devH A D13-Sep-2021374 2014

do_diskH A D13-Sep-2021291 1614

do_disk_no_setupH A D13-Sep-2021275 1513

do_tapeH A D13-Sep-2021327 1714

endtimeH A D13-Sep-2021295 1310

experimental-allH A D13-Sep-2021622 3225

experimental-diskH A D13-Sep-2021620 3326

experimental-disk-and-tapeH A D13-Sep-2021635 3225

experimental-tapeH A D13-Sep-2021610 3225

make-ctest-addsH A D13-Sep-2021382 125

misc-testsH A D13-Sep-202147 32

nightly-allH A D13-Sep-2021639 3427

nightly-diskH A D13-Sep-2021614 3427

nightly-disk-and-tapeH A D13-Sep-2021645 3427

nightly-disk-and-tape-and-changerH A D13-Sep-2021672 3427

nightly-tapeH A D13-Sep-2021614 3427

prototype.confH A D13-Sep-20213 KiB10825

rtestH A D13-Sep-2021714 3620

runH A D13-Sep-2021710 2713

run_bareos_regressionH A D13-Sep-20212.4 KiB13983

run_bconsoleH A D13-Sep-202161 42

run_multipleH A D13-Sep-2021246 1412

startover_libdbi.shH A D13-Sep-20212 KiB7048

starttimeH A D13-Sep-2021114 74

tapeH A D13-Sep-202136 31

README

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

README.ctest

1
2Bareos Regression Suite and CTest
3==================================================================
4
5Thanks to Frank Sweetser, the Bareos regression scripts have now been modified
6to use the ctest component of cmake.  The major gain from this, since Bareos
7already had a working test framework in place, is the ability to have the
8results of each test submitted to a centralized dashboard system.  All of the
9test results are aggregated and summarized, where all of the developers can
10quickly see how the regression tests are running.
11====
12
13How to Use CTest
14==================================================================
15
16For more complete documentation on ctest, go to:
17
18http://www.cmake.org/Wiki/CMake#CTest
19
20The first step is to install the cmake package, which includes ctest.  If your
21distribution does already package it, you can download it directly from the
22source:
23
24http://www.cmake.org
25
26Next, you must edit your regression config file and add a paramter called
27SITE_NAME to identify the machine running the tests.  Ideally, it should
28contain something to identify yourself to whoever is viewing the test results
29as well as something to allow you to identify which machine is running the
30tests, ie
31
32SITE_NAME=kern-bareos-gumbie
33
34Once you have cmake installed, you can perform one of two different kinds of
35runs to submit test results.  The most common kind will be Nightly runs.  A
36Nightly CTest backup will update the source directory (as defined by the
37BAREOS_SOURCE setting in your config file) to the current version, run the
38specified list of tests, and submit all of the results to the server.  Note
39that all of the results in a given 24 hour period (starting at 9pm EST) are
40lumped together to appear as a single block, rather than each test showing up
41as a different run.
42
43The simplest way to trigger a nightly run is to use one of the two provided
44scripts.  The nightly-all script will run all non root tests, both tape and
45disk based, while the nightly-disk script will run only the disk based tests.
46So, you can choose between the following scripts:
47
48 cd <regress>
49 ./nightly-all         # does disk and tape testing
50 ./nightly-disk        # disk only tests
51
52 ./experimental-all    # experimental disk and tape testing
53 ./experimental-disk   # experimental disk testing
54
55We recommend that you start with the ./experimental-disk runs so that
56you can check that everything is working fine.  Once that is done,
57try a nightly-xxx run.  The difference is the experimental runs are just
58that -- they are things where you are experimenting and it is expected that
59something might be broken (bad ctest configuration, experimental source
60code, ...), and nightly runs are not expected to fail.
61
62If you are a developer and you have modified your local Git repository, you
63should be running the experimental tests -- they are designed for developers.
64If you do modify your local repository and commit it, then run a nightly
65test.
66
67If you are just doing testing on a nightly basis (no development in your
68source repository), then please use the nightly tests.
69
70All the old scripts (./do_all, do_file, all-non-root-tests, ...) manually
71run the tests outside of ctest.
72
73Periodically, however, you may want to submit a single test separately from a
74weekly run.  This may be a test of a particular patch you're working on, or
75perhaps a new OS patch.  For these one-shot tests, you will want to manually
76run ctest in Experimental mode, something like:
77
78REGRESS_DEBUG=1 ctest -D Experimental -R all-non-root:auto-label-test
79
80The '-D Experimental' option tells ctest to submit the test results as
81Experimental instead of Nightly.  We reccomend you use the REGRESS_DEBUG
82environmental variable to ensure that any errors from the test are logged in
83the dashboard (all of the ctest wrapper scripts set it).  The '-R <pattern>'
84option gives ctest a regular expression.  Any tests with a name as defined in
85DartTestfile.txt that matches the pattern will be run.
86
87Note that you must have run ./scripts/do_sed at least once already in order to
88use Experimental mode.
89====
90
91Updating and Building Within CTest:
92==================================================================
93Before each Nightly run, ctest will automatically update the BAREOS_SOURCE
94directory, and submit these updates along with the test results.  Any
95Experimental runs will not.
96
97Before either type of run actually begins running tests, ctest will run the
98script scripts/update-ctest.  This script first compares the version of
99BUILD_SOURCE with that of the build/ directory.  If the two versions differ, or
100if the build/ directory does not exist, it will automatically run 'make setup'
101for you.
102====
103
104Viewing the Dashboard:
105==================================================================
106You can view the dashboard at:
107
108http://regress.bareos.org/index.php?project=bareos
109
110Results will not be visible as soon as they are submitted to the server.
111Processing is currently done every 10 minutes, so you may have to wait up to 15
112minutes or so before your results show up.
113====
114
115Getting CTest running on Solaris (thanks to Robert Hartzell):
116============================================================
117The regression is working in zone on opensolaris build 126
118
119 create a zone and install these pkg's:
120    SUNWcmake, SUNWmysql5, SUNWlibm, gcc-dev
121    SUNWgtar, SUNWgit, SUNWperl584usr,
122    and most of SUNWgnu*
123
124 In the config file I edited the "WHICHDB=" line to read:
125     WHICHDB="--with-mysql=/usr/mysql/5.0"
126
127 And then in the shell:
128 $ export LDFLAGS="-L/usr/mysql/5.0/lib/mysql -R/usr/mysql/5.0/lib/mysql"
129 $ PATH=/usr/gnu/bin:$PATH
130
131 When i first ran "make setup" it failed... couldn't create the database
132 so I had to run /usr/mysql/5.0/bin/mysql -u root mysql and do this:
133    grant all privileges on regress.* to ''@localhost;
134    grant all privileges on regress.* to ''@"%";
135====
136
137CTest script details:
138=========================================================
139Email from Frank describing the flow when running a ctest and some of the
140problems that come up.
141
1420. Start off with a local Git repository at version A, and the master
143repository at version B.
144
1451. nightly-disk is started.
146
1472. nightly-disk runs scripts/config_dart
148
1493. config_dart runs scripts/create_sed
150
1514. create_sed pulls bversion and bdate out of the current local repo, so gets
152version A values.
153
1545. config_dart then creates DartConfiguration.tcl from the .in file, leaving a
155BuildName parameter of A.
156
1576. nightly-disk then runs 'ctest -D Nightly'.  This implicitly tells ctest to
158perform Update, Configure, Build, Test, and Submit stages, in that order.
159
1607. The Update stage runs 'git pull' on the local repository.  The local
161repository is now updated to version B from the master, but since the
162DartConfiguration.tcl file was already created and has not been updated, the
163Update.xml file has the version A BuildName still.
164
1658. Next, the Configure stage runs.  Since the configure process is handled in
166tandem with the build process by 'make setup', this just calls /bin/true so as
167to not throw any false errors, and can effectively be treated as a no-op.
168
1699. Next is the Build stage, which is handled by calling scripts/update-ctest.
170
17110.  update-ctest checks the Git versions of regress/build vs BAREOS_SOURCE.
172Since the two are different (regress/build is still version A, while
173BAREOS_SOURCE has been updated to B) it calls 'make setup'.
174
17511. 'make setup' copies BAREOS_SOURCE to regress/build and configures and
176builds it.  It then calls scripts/do_sed
177
17812. do_sed calls scripts/config_dart again.  Since regress/build has been
179updated to B, it regenerates DartConfiguration.tcl with a version B BuildName.
180
18113. ctest now generates the Build.xml results file, but since BuildName was
182still A while this stage began, this is what appears in the XML BuildName.
183
18414. Done with the Build stage, ctest moves on to the Test stage, where it
185actually calls the various test/ scripts as defined by DartTestfile.txt and
186filtered by the -R option.  At this point, since ctest is beginning a new
187stage, it appears to re-read DartConfiguration.tcl (I believe this is intended
188to allow ctest to bootstrap itself in a virgin cmake managed source code tree,
189where the test configuration should be generated by cmake).  The final
190Test.xml file, therefore, contains a version B BuildName string, as opposed to
191all previous steps, which have version A.
192
19315. Finally, ctest flings the results at the dashboard.  The dashboard does
194ignores in what order or grouping XML files are submitted, and instead uses
195the site/buildname tuple to distinguish them (at least for Nightly runs, I'm
196not so sure about Experimental ones).  In this case, instead of one complete
197run, the dashboard sees two runs, one of which is Update through Make, and a
198second one which is Test only.
199
200For a sample of the problem, take a look at the fsweetser 2.3 sqlite3 Nightly
201runs at
202
203http://regress.bareos.org:8081/Bareos/Dashboard/Dashboard?trackid=29
204
205The Update and Build information show up with a BuildName of
206bareos-2.­3.­10-26Feb08-Linux-sqlite3, then aftegit pull hit the Test
207information shows up with bareos-2.­3.­11-03Mar08-Linux-sqlite3.  (Ignore for
208the moment the fact my timestamps are at 6:59PM, rather than at 9PM where
209they're supposed to be; this seems to be a Fedora specific client side issue I
210haven't tracked down yet.)
211
212Looking more closely at the test submitted to the public dashboard
213(http://public.kitware.com/dashboard.php), I get the impression that the
214BuildName parameter was misnamed, and intended to be treated more as a build
215platform name, rather than the name of the build being tested.  Rather than
216create a hook to tag the version being tested, everyone as far as I can tell
217just seems to rely on the timestamp of the test.
218======
219
220Important Note:
221======================================================================
222NOTE !!!!!!!!! ctest can actually back out changes that have been made to
223your local source repository (this was true for SVN, but I (Kern) am
224not sure it is true now that we have switched to git).
225
226As a consequence, it is probably better not to
227use a directory in which you are developing code for Nightly tests.  Seee the
228below explanation given by Frank Sweetser.
229
230When a Nightly run is done, the timestamp is set to the last occurring
231instance of the time defined by the NightlyStartTime parameter.  The piece
232that I missed is that, in addition to using that timestamp for reporting to
233the dashboard, the update stage also uses that point in time to determine
234exactly which version of the repository to check out.
235
236So if you make commit changes at 10PM EST, and then run a Nightly test run,
237the NightlyStartTime of 9PM EST will back out those changes in the local
238repository.  Any subsequent runs that are started at 9PM EST the following day
239or later will include them.  This implies to me that NightlyStartTime should
240be set such that you don't expect any developers to commit any changes in
241between NightlyStartTime and the time at which the ctest run actually starts.
242
243The alternative is to make use of the Experimental track.  While it normally
244just uses the local source tree as is, you can manually have it update:
245
246ctest -D ExperimentalUpdate
247
248Unlike Nightly, this will update to whatever the latest version of the
249repository is.
250