]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restore-by-file-test
Final changes
[bacula/bacula] / regress / tests / restore-by-file-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}/tmp/build" >/tmp/file-list
10 mkdir ${cwd}/tmp/build
11 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
12 cd ${cwd}/tmp/build
13 ls >../1
14 cd ..
15 sed s%\^%${cwd}/tmp/build/% 1 >restore-list
16 rm -f 1
17 cd ${cwd}
18
19 echo " "
20 echo " "
21 echo " === Starting restore-by-file-test ==="
22 echo " === Starting restore-by-file-test ===" >>working/log
23 echo " "
24
25 bin/bacula start 2>&1 >/dev/null
26 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
27 @output /dev/null
28 messages
29 @output tmp/log1.out
30 label storage=File volume=TestVolume001
31 run job=CompressedTest yes
32 wait
33 messages
34 @# 
35 @# now do a restore
36 @#
37 @output tmp/log2.out
38 restore where=${cwd}/tmp/bacula-restores storage=File
39 7
40 <${cwd}/tmp/restore-list
41
42 yes
43 wait
44 messages
45 @output
46 quit
47 END_OF_DATA
48 scripts/check_for_zombie_jobs storage=File
49 bin/bacula stop 2>&1 >/dev/null
50 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
51 bstat=$?
52 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
53 rstat=$?
54 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
55 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
56    echo " "
57    echo " "
58    echo "  !!!!! restore-by-file-test Bacula source failed!!! !!!!! "
59    echo "  !!!!! restore-by-file-test failed!!! !!!!! " >>test.out
60    echo " "
61 else
62    echo "  ===== restore-by-file-test Bacula source OK ===== "
63    echo "  ===== restore-by-file-test OK ===== " >>test.out
64    scripts/cleanup
65 fi