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