]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bscan-test
59c4905400e42347613ace7d9560f763b518e242
[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
13 scripts/cleanup
14 scripts/copy-test-confs
15 echo "${cwd}/build" >/tmp/file-list
16
17 change_jobname NightlySave $JobName
18 start_test
19
20 cat <<END_OF_DATA >tmp/bconcmds
21 @$out /dev/null
22 messages
23 @$out tmp/log1.out
24 label storage=File1
25 TestVolume001
26 label storage=File1
27 TestVolume002
28 update Volume=TestVolume001 MaxVolBytes=3000000
29 run job=$JobName storage=File1
30 yes
31 wait
32 messages
33 @$out /dev/null
34 @#
35 @# now purge the Volume
36 @#
37 purge volume=TestVolume001
38 purge volume=TestVolume002
39 delete volume=TestVolume001
40 yes
41 delete volume=TestVolume002
42 yes
43 messages
44 quit
45 END_OF_DATA
46
47 run_bacula
48 check_for_zombie_jobs storage=File1
49 stop_bacula
50
51 echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
52
53 if test "$debug" -eq 1 ; then
54   bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
55 else
56   bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
57 fi
58
59 cat <<END_OF_DATA >tmp/bconcmds
60 @$out /dev/null
61 messages
62 @$out tmp/log2.out
63 @# 
64 @# now do a restore
65 @#
66 @#setdebug level=400 storage=File1
67 restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
68 yes
69 wait
70 messages
71 @$out
72 quit
73 END_OF_DATA
74
75 # now run restore
76 run_bacula
77 check_for_zombie_jobs storage=File1
78 stop_bacula
79
80 check_two_logs
81 check_restore_diff
82 end_test