]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restore2-by-file-test
regress: Add test that mixes mssql and systemstate
[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 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 @$out /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 quit
34 END_OF_DATA
35
36 run_bacula
37 check_for_zombie_jobs storage=File
38 stop_bacula
39
40 check_two_logs
41 dstat=0
42 for i in `cat ${cwd}/tmp/restore2-list`; do  
43    diff $i ${cwd}/tmp/bacula-restores$i
44    if [ $? != 0 ] ; then
45       dstat=1
46    fi
47 done
48 end_test