]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bextract-test
regress: add function to create many dirs
[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 @$out /dev/null
20 messages
21 @$out ${cwd}/tmp/log1.out
22 label storage=File1 volume=TestVolume001 pool=Default
23 label storage=File1 volume=TestVolume002 pool=Default
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 quit
39 END_OF_DATA
40
41 run_bacula
42 check_for_zombie_jobs storage=File1
43 stop_bacula
44
45 mkdir -p ${cwd}/tmp/bacula-restores
46 if test "$debug" -eq 1 ; then
47   $bin/bextract -v -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores                
48 else
49   $bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null
50 fi
51 rstat=$?
52 grep "^  Termination: *Backup OK" ${cwd}/tmp/log1.out 2>&1 >/dev/null
53 bstat=$?
54 check_restore_diff
55 end_test