]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bsr-test
Tweak more debug for FreeBSD to verify-data-test
[bacula/bacula] / regress / tests / bsr-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 #
7 # Run a simple backup of the Bacula build directory
8 #   then restore it. Used to generate BSR files.
9 #
10 TestName="bsr-test"
11 JobName=backup
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-confs
16
17 #
18 # Zap out any schedule in default conf file so that
19 #  it doesn't start during our test
20 #
21 outf="$tmp/sed_tmp"
22 echo "s%  Schedule =%# Schedule =%g" >${outf}
23 echo "s%  Write Bootstrap%# Write Bootstrap%g" >> ${outf}
24 cp $scripts/bacula-dir.conf $tmp/1
25 sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
26
27 $bperl -e "add_attribute('$conf/bacula-sd.conf', 'MaximumFileSize', '1MB', 'Device')"
28
29 change_jobname BackupClient1 $JobName
30 start_test
31
32 cat <<END_OF_DATA >$tmp/bconcmds
33 @$out /dev/null
34 messages
35 @$out $tmp/log1.out
36 label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
37 run job=$JobName yes
38 wait
39 messages
40 @# 
41 @# now do a restore
42 @#
43 @$out $tmp/log2.out
44 restore where=$tmp/bacula-restores select all done
45 @exec "sh -c 'cp $working/*.bsr $tmp/1.bsr'"
46 yes
47 wait
48 messages
49 quit
50 END_OF_DATA
51
52 run_bacula
53 check_for_zombie_jobs storage=File1
54 stop_bacula
55
56 check_two_logs
57 check_restore_diff
58
59 # here we can add checks on the BSR file
60 awk '/Volume=/ { nbvol++ } /FileIndex=/ { nbfdx++ } END { print "Found Volumes=" nbvol " FileIndexes=" nbfdx }' $tmp/1.bsr
61
62 end_test