]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restore2-by-file-test
Begin simplification and cleanup of tests using shell functions
[bacula/bacula] / regress / tests / restore2-by-file-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then restore a few selected files.
5 #
6 TestName="restore2-by-file-test"
7 JobName=restore2byfile
8 . scripts/functions
9 set_debug 0
10
11 cwd=`pwd`
12 scripts/copy-test-confs
13 scripts/cleanup
14 echo "${cwd}/build" >/tmp/file-list
15 sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
16
17 start_test
18
19 cat <<END_OF_DATA >tmp/bconcmds
20 @output /dev/null
21 messages
22 @$out tmp/log1.out
23 label storage=File volume=TestVolume001
24 run job=CompressedTest yes
25 wait
26 messages
27 @# 
28 @# now do a restore
29 @#
30 @$out tmp/log2.out
31 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore2-list
32 yes
33 wait
34 messages
35 @output
36 quit
37 END_OF_DATA
38
39 run_bacula
40 check_for_zombie_jobs storage=File
41 stop_bacula
42
43 check_two_logs
44 dstat=0
45 for i in `cat ${cwd}/tmp/restore2-list`; do  
46    diff $i ${cwd}/tmp/bacula-restores$i
47    if [ $? != 0 ] ; then
48       dstat=1
49    fi
50 done
51 end_test