]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bscan-fast-tape
Tweak another attempt to fix script in file-span-vol-test to be FreeBSD compatibile
[bacula/bacula] / regress / tests / bscan-fast-tape
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory using the compressed option
9 #   then backup four times, each with incremental then 
10 #   do a bscan and restore.
11 #   It should require at least 4 different bsrs.
12 #
13 TestName="bscan-fast-tape"
14 JobName=bscanfasttape
15 . scripts/functions
16
17 require_tape_drive
18
19 copy_tape_confs
20
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22
23 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
24 # sed "s%# Maximum File Size%  Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
25
26 change_jobname NightlySave $JobName
27 start_test
28
29 cat <<END_OF_DATA >tmp/bconcmds
30 @$out /dev/null
31 messages
32 @$out tmp/log1.out
33 setdebug level=2 storage=tape
34 label storage=tape volume=TestVolume001 slot=0 pool=Default
35 run job=$JobName yes
36 wait
37 messages
38 quit
39 END_OF_DATA
40
41 echo "Starting Bacula tape writing"
42 #$bin/btape -c bin/bacula-sd.conf /dev/nst0 <<END_OF_DATA
43 #rewind
44 #label
45 #Test001
46 #wr
47 #wr
48 #wr
49 #wr
50 #wr
51 #wr
52 #weof
53 #quit
54 #END_OF_DATA
55 #run_bacula
56 #check_for_zombie_jobs storage=tape
57 #stop_bacula
58 echo "End writing tape"
59
60 #
61 # now drop and recreate the database
62 #
63 cd bin
64 ./drop_bacula_tables >/dev/null 2>&1
65 ./make_bacula_tables >/dev/null 2>&1
66 ./grant_bacula_privileges 2>&1 >/dev/null
67 cd ..
68
69 echo "Begin attempt to read tape that crashes the system"
70 echo "volume=TestVolume001" >tmp/bscan.bsr
71
72 bscan_libdbi
73
74 strace -o strace.new $bin/bscan -d200 -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf tape
75 exit
76 cat <<END_OF_DATA >tmp/bconcmds
77 @$out /dev/null
78 messages
79 @$out tmp/log2.out
80 @# 
81 @# now do a restore
82 @#
83 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
84 yes
85 wait
86 messages
87 quit
88 END_OF_DATA
89
90 run_bacula
91 check_for_zombie_jobs storage=tape
92 stop_bacula
93 rm -f  ${cwd}/build/src/lib/dummy
94
95 check_two_logs
96 check_restore_diff
97 end_test