]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bscan-test
Final changes
[bacula/bacula] / regress / tests / bscan-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   split the archive into two volumes then bscan it
5 #   into the catalog after the backup. It also to a limited
6 #   extent tests the purge volume and delete volume commands.
7 #
8
9 TestName="bscan-test"
10 JobName=bscan
11 . scripts/functions
12 set_debug 0
13
14 cwd=`pwd`
15 scripts/cleanup
16 scripts/copy-test-confs
17 echo "${cwd}/build" >/tmp/file-list
18
19 change_jobname NightlySave $JobName
20 start_test
21
22 cat <<END_OF_DATA >tmp/bconcmds
23 @$out /dev/null
24 messages
25 @$out tmp/log1.out
26 label storage=File1
27 TestVolume001
28 label storage=File1
29 TestVolume002
30 update Volume=TestVolume001 MaxVolBytes=3000000
31 run job=$JobName storage=File1
32 yes
33 wait
34 messages
35 @$out /dev/null
36 @#
37 @# now purge the Volume
38 @#
39 purge volume=TestVolume001
40 purge volume=TestVolume002
41 delete volume=TestVolume001
42 yes
43 delete volume=TestVolume002
44 yes
45 messages
46 quit
47 END_OF_DATA
48
49 run_bacula
50 check_for_zombie_jobs storage=File1
51 stop_bacula
52
53 echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
54
55 if test "$debug" -eq 1 ; then
56   bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
57 else
58   bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
59 fi
60
61 cat <<END_OF_DATA >tmp/bconcmds
62 @$out /dev/null
63 messages
64 @$out tmp/log2.out
65 @# 
66 @# now do a restore
67 @#
68 @#setdebug level=400 storage=File1
69 restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
70 yes
71 wait
72 messages
73 @$out
74 quit
75 END_OF_DATA
76
77 # now run restore
78 run_bacula
79 check_for_zombie_jobs storage=File1
80 stop_bacula
81
82 check_two_logs
83 check_restore_diff
84 end_test