]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/file-span-vol-test
Tweak remove unused regression tests + add some new ones
[bacula/bacula] / regress / tests / file-span-vol-test
1 #!/bin/sh
2 #
3 # Run a simple backup of a big file but 
4 #   split the archive into four volumes, two of which are
5 #   totally full. I.e. make sure that bsr selects all tapes 
6 #   including those fully spanned.
7 #
8 TestName="file-span-vol-test"
9 JobName=SpanVol
10 . scripts/functions
11
12 scripts/cleanup
13 scripts/copy-test-confs
14 rm -f $cwd/build/big
15
16 dd if=/dev/zero of=$tmp/big count=10000 > /dev/null
17
18 echo "$tmp/big" >${cwd}/tmp/file-list
19 echo "${cwd}/build" >>${cwd}/tmp/file-list
20 change_jobname NightlySave $JobName
21 start_test
22
23 # Remove last / and convert all / to cd commands
24 CD=`echo $tmp | sed 's:/$::' | sed 's:/:\ncd :g'`
25
26 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
27 @output /dev/null
28 messages
29 @$out ${cwd}/tmp/log1.out
30 label storage=File1 volume=TestVolume004
31 label storage=File1 volume=TestVolume003
32 label storage=File1 volume=TestVolume002
33 label storage=File1 volume=TestVolume001
34 update Volume=TestVolume004 MaxVolBytes=3000000
35 update Volume=TestVolume003 MaxVolBytes=3000000
36 update Volume=TestVolume002 MaxVolBytes=3000000
37 run job=$JobName fileset=SimpleSet storage=File1 yes
38 wait
39 list volumes
40 messages
41 @# 
42 @# now do a restore
43 @#
44 @$out ${cwd}/tmp/log2.out
45 restore where=$tmp/bacula-restores select storage=File1
46 unmark *
47 $CD
48 mark big
49 done
50 yes
51 wait
52 messages
53 quit
54 END_OF_DATA
55
56 run_bacula
57 check_for_zombie_jobs storage=File1
58 stop_bacula
59
60 check_two_logs
61
62 diff -q $tmp/big $tmp/bacula-restores/$tmp/big
63 if [ $? -ne 0 ]; then
64     print_debug "ERROR: $tmp/big $tmp/bacula-restores/$tmp/big are different"
65     print_debug `ls -l $tmp/big $tmp/bacula-restores/$tmp/big are different`
66     rstat=1
67 fi
68
69 end_test