]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bscan-test
98278b2e550d587d574785002becda681bbfa219
[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 cwd=`pwd`
9 scripts/copy-test-confs
10 scripts/cleanup
11 echo "${cwd}/build" >/tmp/file-list
12 bin/bacula stop 2>&1 >/dev/null
13 bin/drop_sqlite_tables
14 bin/make_sqlite_tables
15
16 echo " "
17 echo " "
18 echo " === Starting bscan-test  ==="
19 echo " === Starting bscan-test  ===" >working/log
20 echo " "
21
22 bin/bacula start
23 bin/console -c bin/console.conf <<END_OF_DATA
24 @output /dev/null
25 messages
26 label storage=File1
27 TestVolume001
28 label storage=File1
29 TestVolume002
30 update Volume=TestVolume001
31 6
32 3000000
33 10
34 @output
35 run job=NightlySave storage=File1
36 yes
37 wait
38 messages
39 @#
40 @# now purge the Volume
41 @#
42 purge volume=TestVolume001
43 purge volume=TestVolume002
44 delete volume=TestVolume001
45 yes
46 delete volume=TestVolume002
47 yes
48 quit
49 END_OF_DATA
50 bin/bacula stop
51 echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
52 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 
53 bin/bacula start
54 bin/console -c bin/console.conf <<END_OF_DATA
55 @output /dev/null
56 messages
57 @# 
58 @# now do a restore
59 @#
60 restore where=${cwd}/tmp/bacula-restores
61 5
62 done
63 yes
64 wait
65 messages
66 quit
67 END_OF_DATA
68 bin/bacula stop
69 diff -r build  tmp/bacula-restores${cwd}/build
70 if [ $? != 0 ] ; then
71    echo " "
72    echo " "
73    echo "  ===== bscan-test Bacula source failed!!! ===== "
74    echo "  ===== bscan-test failed!!! ===== " >>test.out
75    echo " "
76 else
77    echo "  ===== bscan-test Bacula source OK ===== "
78    echo "  ===== bscan-test OK ===== " >>test.out
79    scripts/cleanup
80 fi