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