]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/filed-crypto-test
Final changes
[bacula/bacula] / regress / tests / filed-crypto-test
1 #!/bin/sh
2 #
3 # Run a simple backup (with encryption) of the Bacula build directory
4 #   then verify the signatures.
5 #
6 debug=0
7 if test "$debug" -eq 1 ; then
8   out="tee"
9 else
10   out="output"
11 fi
12
13 cwd=`pwd`
14 scripts/copy-crypto-confs
15 scripts/cleanup
16 echo "${cwd}/build" >/tmp/file-list
17
18 echo " "
19 echo " "
20 echo " === Starting Filed Encryption Test at `date +%R:%S` ==="
21 echo " === Starting Filed Encryption Test at `date +%R:%S` ===" >>working/log
22 echo " "
23
24 cat <<END_OF_DATA >tmp/bconcmds
25 @$out /dev/null
26 messages
27 @$out tmp/log1.out
28 setdebug level=1 storage=File sd
29 label storage=File volume=TestVolume001
30 run job=NightlySave yes
31 wait
32 messages
33 @# 
34 @# now do a restore
35 @#
36 @$out tmp/log2.out
37 restore where=${cwd}/tmp/bacula-restores storage=File
38 5
39 mark *
40
41 yes
42 wait
43 messages
44 @$out
45 quit
46 END_OF_DATA
47
48 if test "$debug" -eq 1 ; then
49   bin/bacula start
50   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
51 else
52   bin/bacula start 2>&1 >/dev/null
53   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
54 fi
55
56 sleep 2
57 scripts/check_for_zombie_jobs storage=File 
58 bin/bacula stop 2>&1 >/dev/null
59 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
60 bstat=$?
61 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
62 if [ $? != 0 -o $bstat != 0 ] ; then
63    echo " "
64    echo " "
65    echo "  !!!!! Filed Encryption Verification failed!!! !!!!! "
66    echo "  !!!!! Filed Encryption Verification failed!!! !!!!! " >>test.out
67    if [ $bstat != 0 ] ; then
68       echo "  !!!!! Bad Job termination status     !!!!! "
69       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
70    else
71       echo "  !!!!! Restored files differ          !!!!! "
72       echo "  !!!!! Restored files differ          !!!!! " >>test.out
73    fi
74    echo " "
75 else
76    echo "  ===== Filed Encryption Verification Test OK ===== "
77    echo "  ===== Filed Encryption Verification Test OK ===== " >>test.out
78    scripts/cleanup
79 fi