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
46 echo " !!!!! btape test failed!!! !!!!! "
47 echo " !!!!! btape test failed!!! !!!!! " >>test.out
52 grep "This is NOT correct" $tmp/log1.out >/dev/null
54 print_debug "btape test command failed failed"
59 grep "The test autochanger worked" $tmp/log1.out > /dev/null
61 print_debug "btape autochanger test failed"
65 grep "End Forward space files test" $tmp/log1.out > /dev/null
67 print_debug "btape test failed"
71 # now try to use the fill command
72 $bperl -e "add_attribute('$conf/bacula-sd.conf', 'MaximumVolumeSize', '400M', 'Device')"
74 $bin/disk-changer $working/ach load 1 $working/ach/drive0 0
76 if test "$debug" -eq 1 ; then
77 $bin/btape -w $tmp -c $conf/bacula-sd.conf LTO3_0 <<END_OF_DATA | tee $tmp/log2.out
83 $bin/btape -w $tmp -c $conf/bacula-sd.conf LTO3_0 <<END_OF_DATA >$tmp/log2.out 2>&1
94 echo " !!!!! btape test failed!!! !!!!! "
95 echo " !!!!! btape test failed!!! !!!!! " >>test.out
100 grep "The last block of the first tape matches." $tmp/log2.out > /dev/null
101 if [ $? != 0 ] ; then
102 print_debug "Could not find: The last block of the first tape matches."
103 print_debug "btape fill test failed"
107 grep "The first block on the second tape matches." $tmp/log2.out > /dev/null
108 if [ $? != 0 ] ; then
109 print_debug "Could not find: The first block on the second tape matches."
110 print_debug "btape fill test failed"