]> git.sur5r.net Git - bacula/bacula/blob - regress/regress/tests/restore2-by-file-test
Copy trunk regress into Branch-2.2
[bacula/bacula] / regress / 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 copy_test_confs
10
11 echo "${cwd}/build" >${cwd}/tmp/file-list
12 sed s%\^%${cwd}% ${cwd}/scripts/flist | sort | uniq >${cwd}/tmp/restore2-list
13
14 change_jobname CompressedTest $JobName
15 start_test
16
17 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
18 @output /dev/null
19 messages
20 @$out ${cwd}/tmp/log1.out
21 label storage=File volume=TestVolume001
22 run job=$JobName yes
23 wait
24 messages
25 @# 
26 @# now do a restore
27 @#
28 @$out ${cwd}/tmp/log2.out
29 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore2-list
30 yes
31 wait
32 messages
33 @output
34 quit
35 END_OF_DATA
36
37 run_bacula
38 check_for_zombie_jobs storage=File
39 stop_bacula
40
41 check_two_logs
42 dstat=0
43 for i in `cat ${cwd}/tmp/restore2-list`; do  
44    diff $i ${cwd}/tmp/bacula-restores$i
45    if [ $? != 0 ] ; then
46       dstat=1
47    fi
48 done
49 end_test