]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bextract-test
Final changes
[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
12 echo " "
13 echo " "
14 echo " === Starting bextract-test  ==="
15 echo " === Starting bextract-test  ===" >working/log
16 echo " "
17
18 bin/bacula start 2>&1 >/dev/null
19 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
20 @output /dev/null
21 messages
22 @output tmp/log1.out
23 label storage=File1 volume=TestVolume001
24 label storage=File1 volume=TestVolume002
25 update Volume=TestVolume001 MaxVolBytes=3000000
26 run job=NightlySave storage=File1 yes
27 wait
28 messages
29 @# 
30 @# now build the bsr file
31 @#
32 @output tmp/log2.out
33 restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
34 no
35 wait
36 messages
37 @output
38 quit
39 END_OF_DATA
40 scripts/check_for_zombie_jobs storage=File1
41 bin/bacula stop 2>&1 >/dev/null
42 mkdir -p ${cwd}/tmp/bacula-restores
43 bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null
44 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
45 bstat=$?
46 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
47 if [ $? != 0 -o $bstat != 0 ] ; then
48    echo " "
49    echo " "
50    echo "  !!!!! bextract-test Bacula source failed!!! !!!!! "
51    echo "  !!!!! bextract-test failed!!! !!!!! " >>test.out
52    if [ $bstat != 0 ] ; then
53       echo "  !!!!! Bad Job termination status     !!!!! "
54       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
55    else
56       echo "  !!!!! Restored files differ          !!!!! "
57       echo "  !!!!! Restored files differ          !!!!! " >>test.out
58    fi
59    echo " "
60 else
61    echo "  ===== bextract-test Bacula source OK ===== "
62    echo "  ===== bextract-test OK ===== " >>test.out
63    scripts/cleanup
64 fi