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