3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Create a 60MB file with random bytes. Back it up to 6 Volumes
9 # each constrained to 10MB using the automatic labeling feature.
11 TestName="six-vol-test"
15 if test ! -c /dev/urandom ; then
16 echo "No random device. Test skipped.\n"
21 scripts/copy-testa-confs
22 # copy special conf file
23 /bin/cp -f scripts/testb-bacula-dir.conf bin/bacula-dir.conf
25 echo "${cwd}/tmp/largefile" >${cwd}/tmp/file-list
26 # Create 56MB file with random data
27 echo "Creating a 56MB file with random data ..."
28 dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000 >/dev/null 2>&1
29 echo "largefile created"
31 change_jobname MultiVol $JobName
34 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
37 @$out ${cwd}/tmp/log1.out
38 setdebug level=50 storage=File
39 run job=$JobName storage=File yes
40 run job=$JobName storage=File yes
41 run job=$JobName storage=File yes
42 run job=$JobName storage=File yes
43 run job=$JobName storage=File yes
50 @$out ${cwd}/tmp/log2.out
52 select * from JobMedia where JobId=4;
53 select * from JobMedia where JobId=5;
55 setdebug level=50 storage=File
56 restore where=${cwd}/tmp/bacula-restores select storage=File
67 check_for_zombie_jobs storage=File
71 #diff ${cwd}/tmp/largefile ${cwd}/tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
72 diff ${cwd}/tmp/largefile ${cwd}/tmp/bacula-restores${cwd}/tmp/largefile