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