]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/btape-fill-full-changer
Eliminate btape flush + tweak btape regression scripts
[bacula/bacula] / regress / tests / btape-fill-full-changer
1 #!/bin/sh
2 #
3 # Test the fill command in btape
4 #
5 TestName="btape-fill-full-changer"
6 JobName=btape-fill-changer
7 . scripts/functions
8
9 require_tape_drive
10 require_autochanger
11
12 scripts/cleanup
13 scripts/copy-btape-confs
14
15 change_jobname $JobName
16 start_test
17
18 #
19 #  Increase block size to 262144
20 #
21 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
22 sed -e 's%64512%262144%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
23
24 if test "$debug" -eq 1 ; then
25    $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
26 fill
27 m
28
29 quit
30 END_OF_DATA
31 else
32    $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log1.out 2>&1
33 fill
34 m
35
36 quit
37 END_OF_DATA
38 fi
39
40 grep "^The last block on the tape matches\. Test succeeded\." ${cwd}/tmp/log1.out >/dev/null 2>&1
41 if [ $? != 0 ] ; then
42    echo " "
43    echo " "
44    echo "  !!!!! btape fill test failed!!! !!!!! "
45    echo "  !!!!! btape fill test failed!!! !!!!! " >>test.out
46    echo " "
47 else
48    echo "  ===== btape fill test OK ===== "
49    echo "  ===== btape fill test OK ===== " >>test.out
50    scripts/cleanup
51 fi