]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bextract-test
Copy trunk regress into Branch
[bacula/bacula] / regress / tests / bextract-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   split the archive into two volumes, then build a BSR with
5 #   the restore command and use bextract to restore the files.
6 #
7 TestName="bextract-test"
8 JobName="bextract"
9 . scripts/functions
10
11 scripts/cleanup
12 scripts/copy-test-confs
13 echo "${cwd}/build" >${cwd}/tmp/file-list
14
15 change_jobname NightlySave $JobName 
16 start_test
17
18 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
19 @output /dev/null
20 messages
21 @$out ${cwd}/tmp/log1.out
22 label storage=File1 volume=TestVolume001
23 label storage=File1 volume=TestVolume002
24 update Volume=TestVolume001 MaxVolBytes=3000000
25 @#setdebug level=400 dir
26 @#setdebug level=400 storage=File1
27 run job=$JobName storage=File1 yes
28 wait
29 messages
30 @# 
31 @# now build the bsr file but do not restore
32 @#
33 @$out ${cwd}/tmp/log2.out
34 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
35 no
36 wait
37 messages
38 @$out
39 quit
40 END_OF_DATA
41
42 run_bacula
43 check_for_zombie_jobs storage=File1
44 stop_bacula
45
46 mkdir -p ${cwd}/tmp/bacula-restores
47 if test "$debug" -eq 1 ; then
48   bin/bextract -v -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores                
49 else
50   bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null
51 fi
52 rstat=$?
53 grep "^  Termination: *Backup OK" ${cwd}/tmp/log1.out 2>&1 >/dev/null
54 bstat=$?
55 check_restore_diff
56 end_test