]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/sparse-compressed-test
2c863669c855eac42e3849eeb3d7231b746f9b5b
[bacula/bacula] / regress / tests / sparse-compressed-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the Sparse option
4 #   then restore it.
5 #
6 cwd=`pwd`
7 scripts/copy-test-confs
8 scripts/cleanup
9 echo "${cwd}/build" >/tmp/file-list
10 bin/bacula stop 2>&1 >/dev/null
11 bin/drop_sqlite_tables
12 bin/make_sqlite_tables
13
14 echo " "
15 echo " "
16 echo " === Starting sparse-compressed-test ==="
17 echo " === Starting sparse-compressed-test ===" >>working/log
18 echo " "
19
20 bin/bacula start 2>&1 >/dev/null
21 bin/console -c bin/console.conf <<END_OF_DATA
22 @output /dev/null
23 messages
24 @output tmp/log1.out
25 label storage=File volume=TestVolume001
26 run job=SparseCompressedTest yes
27 wait
28 messages
29 @# 
30 @# now do a restore
31 @#
32 @output tmp/log2.out   
33 restore current all
34 yes
35 wait
36 messages
37 @output
38 quit
39 END_OF_DATA
40 bin/bacula stop 2>&1 >/dev/null
41 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
42 bstat=$?
43 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
44 rstat=$?
45 diff -r build /tmp/bacula-restores${cwd}/build
46 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
47    echo " "
48    echo " "
49    echo "  !!!!! sparse-compressed-test Bacula source failed!!! !!!!! "
50    echo "  !!!!! sparse-compressed-test failed!!! !!!!! " >>test.out
51    echo " "
52 else
53    echo "  ===== sparse-compressed-test Bacula source OK ===== "
54    echo "  ===== sparse-compressed-test OK ===== " >>test.out
55    scripts/cleanup
56 fi