]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bextract-test
Doc updates
[bacula/bacula] / regress / tests / bextract-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   split the archive into two volumes, then build a BSR with
5 #   the restore command and use bextract to restore the files.
6 #
7 cwd=`pwd`
8 scripts/copy-test-confs
9 scripts/cleanup
10 echo "${cwd}/build" >/tmp/file-list
11 bin/bacula stop 2>&1 >/dev/null
12 cd bin
13 ./drop_bacula_tables >/dev/null 2>&1
14 ./make_bacula_tables >/dev/null 2>&1
15 ./grant_bacula_privileges 2>&1 >/dev/null
16 cd ..
17
18 echo " "
19 echo " "
20 echo " === Starting bextract-test  ==="
21 echo " === Starting bextract-test  ===" >working/log
22 echo " "
23
24 bin/bacula start 2>&1 >/dev/null
25 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
26 @output /dev/null
27 messages
28 @output tmp/log1.out
29 label storage=File1 volume=TestVolume001
30 label storage=File1 volume=TestVolume002
31 update Volume=TestVolume001 MaxVolBytes=3000000
32 run job=NightlySave storage=File1 yes
33 wait
34 messages
35 @# 
36 @# now build the bsr file
37 @#
38 @output tmp/log2.out
39 restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
40 no
41 wait
42 messages
43 @output
44 quit
45 END_OF_DATA
46 scripts/check_for_zombie_jobs storage=File1
47 bin/bacula stop 2>&1 >/dev/null
48 mkdir -p ${cwd}/tmp/bacula-restores
49 bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null
50 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
51 bstat=$?
52 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
53 if [ $? != 0 -o $bstat != 0 ] ; then
54    echo " "
55    echo " "
56    echo "  !!!!! bextract-test Bacula source failed!!! !!!!! "
57    echo "  !!!!! bextract-test failed!!! !!!!! " >>test.out
58    echo " "
59 else
60    echo "  ===== bextract-test Bacula source OK ===== "
61    echo "  ===== bextract-test OK ===== " >>test.out
62    scripts/cleanup
63 fi