]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bextract-test
0289577ce9d4dc69b91c7f2e84454ff16e618d9a
[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 set_debug 0
11
12
13 cwd=`pwd`
14 scripts/copy-test-confs
15 scripts/cleanup
16 echo "${cwd}/build" >/tmp/file-list
17 change_jobname $JobName 
18
19 start_test
20
21 cat <<END_OF_DATA >tmp/bconcmds
22 @output /dev/null
23 messages
24 @$out tmp/log1.out
25 label storage=File1 volume=TestVolume001
26 label storage=File1 volume=TestVolume002
27 update Volume=TestVolume001 MaxVolBytes=3000000
28 run job=$JobName storage=File1 yes
29 wait
30 messages
31 @# 
32 @# now build the bsr file
33 @#
34 @$out tmp/log2.out
35 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
36 no
37 wait
38 messages
39 @$out
40 quit
41 END_OF_DATA
42
43 run_bacula
44 check_for_zombie_jobs storage=File1
45 stop_bacula
46
47 mkdir -p ${cwd}/tmp/bacula-restores
48 bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null
49 rstat=$?
50 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
51 bstat=$?
52 check_restore_diff
53 end_test