]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/file-span-vol-test
Tweak add copyright to regression tests that do not have one
[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 all / to cd commands
27 CD=`echo $tmp | sed 's:/$::' | sed 's:/:\ncd :g'`
28
29 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
30 @output /dev/null
31 messages
32 @$out ${cwd}/tmp/log1.out
33 label storage=File1 volume=TestVolume004
34 label storage=File1 volume=TestVolume003
35 label storage=File1 volume=TestVolume002
36 label storage=File1 volume=TestVolume001
37 update Volume=TestVolume004 MaxVolBytes=3000000
38 update Volume=TestVolume003 MaxVolBytes=3000000
39 update Volume=TestVolume002 MaxVolBytes=3000000
40 run job=$JobName fileset=SimpleSet storage=File1 yes
41 wait
42 list volumes
43 messages
44 @# 
45 @# now do a restore
46 @#
47 @$out ${cwd}/tmp/log2.out
48 restore where=$tmp/bacula-restores select storage=File1
49 unmark *
50 $CD
51 mark big
52 done
53 yes
54 wait
55 messages
56 quit
57 END_OF_DATA
58
59 run_bacula
60 check_for_zombie_jobs storage=File1
61 stop_bacula
62
63 check_two_logs
64
65 diff -q $tmp/big $tmp/bacula-restores/$tmp/big
66 if [ $? -ne 0 ]; then
67     print_debug "ERROR: $tmp/big $tmp/bacula-restores/$tmp/big are different"
68     print_debug `ls -l $tmp/big $tmp/bacula-restores/$tmp/big are different`
69     rstat=1
70 fi
71
72 end_test