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