3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
7 # Test the test command in btape
16 scripts/copy-tape-confs
17 cp $rscripts/bacula-dir-vtape.conf $conf/bacula-dir.conf
18 cp $rscripts/bacula-sd-vtape.conf $conf/bacula-sd.conf
19 scripts/prepare-fake-autochanger
21 # we need at least 2 or 3G for this test
22 $bperl -e "add_attribute('$conf/bacula-sd.conf', 'MaximumVolumeSize', '3G', 'Device')"
24 change_jobname $JobName
27 $bin/disk-changer $working/ach load 1 $working/ach/drive0 0
29 if test "$debug" -eq 1 ; then
30 $bin/btape -w $tmp -c $conf/bacula-sd.conf LTO3_0 <<END_OF_DATA | tee $tmp/log1.out
36 $bin/btape -w $tmp -c $conf/bacula-sd.conf LTO3_0 <<END_OF_DATA >$tmp/log1.out 2>&1
47 echo " !!!!! btape test failed!!! !!!!! "
48 echo " !!!!! btape test failed!!! !!!!! " >>test.out
53 grep "The test autochanger worked" $tmp/log1.out > /dev/null
55 print_debug "btape autochanger test failed"
59 grep "End Forward space files test" $tmp/log1.out > /dev/null
61 print_debug "btape test failed"
65 # now try to use the fill command
66 $bperl -e "add_attribute('$conf/bacula-sd.conf', 'MaximumVolumeSize', '400M', 'Device')"
68 $bin/disk-changer $working/ach load 1 $working/ach/drive0 0
70 if test "$debug" -eq 1 ; then
71 $bin/btape -w $tmp -c $conf/bacula-sd.conf LTO3_0 <<END_OF_DATA | tee $tmp/log2.out
77 $bin/btape -w $tmp -c $conf/bacula-sd.conf LTO3_0 <<END_OF_DATA >$tmp/log2.out 2>&1
88 echo " !!!!! btape test failed!!! !!!!! "
89 echo " !!!!! btape test failed!!! !!!!! " >>test.out
94 grep "The last block of the first tape matches." $tmp/log2.out > /dev/null
96 print_debug "Could not find: The last block of the first tape matches."
97 print_debug "btape fill test failed"
101 grep "The first block on the second tape matches." $tmp/log2.out > /dev/null
102 if [ $? != 0 ] ; then
103 print_debug "Could not find: The first block on the second tape matches."
104 print_debug "btape fill test failed"