]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restore2-by-file-test
Update disk tests
[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 change_jobname CompressedTest $JobName
18 start_test
19
20 cat <<END_OF_DATA >tmp/bconcmds
21 @output /dev/null
22 messages
23 @$out tmp/log1.out
24 label storage=File volume=TestVolume001
25 run job=$JobName yes
26 wait
27 messages
28 @# 
29 @# now do a restore
30 @#
31 @$out tmp/log2.out
32 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore2-list
33 yes
34 wait
35 messages
36 @output
37 quit
38 END_OF_DATA
39
40 run_bacula
41 check_for_zombie_jobs storage=File
42 stop_bacula
43
44 check_two_logs
45 dstat=0
46 for i in `cat ${cwd}/tmp/restore2-list`; do  
47    diff $i ${cwd}/tmp/bacula-restores$i
48    if [ $? != 0 ] ; then
49       dstat=1
50    fi
51 done
52 end_test