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