]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/compressed-test
ac886b06e4a9fda2403520c857eb3007643cf4f6
[bacula/bacula] / regress / tests / compressed-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed 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 compressed-test ==="
17 echo " === Starting 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 status all
24 status all
25 messages
26 @output tmp/log1.out
27 label storage=File volume=TestVolume001
28 run job=CompressedTest yes
29 wait
30 messages
31 @# 
32 @# now do a restore
33 @#
34 @output tmp/log2.out
35 restore where=${cwd}/tmp/bacula-restores
36 5
37 done
38 yes
39 wait
40 messages
41 @output
42 quit
43 END_OF_DATA
44 bin/bacula stop 2>&1 >/dev/null
45 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
46 bstat=$?
47 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
48 rstat=$?
49 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
50 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
51    echo " "
52    echo " "
53    echo "  !!!!! compressed-test Bacula source failed!!! !!!!! "
54    echo "  !!!!! compressed-test failed!!! !!!!! " >>test.out
55    echo " "
56 else
57    echo "  ===== compressed-test Bacula source OK ===== "
58    echo "  ===== compressed-test OK ===== " >>test.out
59    scripts/cleanup
60 fi