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