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