]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bscan-fast-tape
110c007f7d174f1ce41b86ee4cdde3a60e0e7aa6
[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 require_tape_drive
13
14 copy_tape_confs
15
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17
18 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
19 # sed "s%# Maximum File Size%  Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
20
21 change_jobname NightlySave $JobName
22 start_test
23
24 cat <<END_OF_DATA >tmp/bconcmds
25 @output /dev/null
26 messages
27 @$out tmp/log1.out
28 setdebug level=2 storage=DDS-4
29 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
30 run job=$JobName yes
31 wait
32 messages
33 quit
34 END_OF_DATA
35
36 echo "Starting Bacula tape writing"
37 #bin/btape -c bin/bacula-sd.conf /dev/nst0 <<END_OF_DATA
38 #rewind
39 #label
40 #Test001
41 #wr
42 #wr
43 #wr
44 #wr
45 #wr
46 #wr
47 #weof
48 #quit
49 #END_OF_DATA
50 #run_bacula
51 #check_for_zombie_jobs storage=DDS-4
52 #stop_bacula
53 echo "End writing tape"
54
55 #
56 # now drop and recreate the database
57 #
58 cd bin
59 ./drop_bacula_tables >/dev/null 2>&1
60 ./make_bacula_tables >/dev/null 2>&1
61 ./grant_bacula_privileges 2>&1 >/dev/null
62 cd ..
63
64 echo "Begin attempt to read tape that crashes the system"
65 echo "volume=TestVolume001" >tmp/bscan.bsr
66 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
67 exit
68 cat <<END_OF_DATA >tmp/bconcmds
69 @$out /dev/null
70 messages
71 @$out tmp/log2.out
72 @# 
73 @# now do a restore
74 @#
75 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
76 yes
77 wait
78 messages
79 @$out
80 quit
81 END_OF_DATA
82
83 run_bacula
84 check_for_zombie_jobs storage=DDS-4
85 stop_bacula
86 rm -f  ${cwd}/build/src/lib/dummy
87
88 check_two_logs
89 check_restore_diff
90 end_test