]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/btape-fill-full-changer
Work on certification 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-2tape-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
25 if test "$debug" -eq 1 ; then
26    $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
27 fill
28 m
29
30 quit
31 END_OF_DATA
32 else
33    $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log1.out 2>&1
34 fill
35 m
36
37 quit
38 END_OF_DATA
39 fi
40
41 grep "^The last block on the tape matches\. Test succeeded\." ${cwd}/tmp/log1.out >/dev/null 2>&1
42 if [ $? != 0 ] ; then
43    echo " "
44    echo " "
45    echo "  !!!!! btape fill test failed!!! !!!!! "
46    echo "  !!!!! btape fill test failed!!! !!!!! " >>test.out
47    echo " "
48 else
49    echo "  ===== btape fill test OK ===== "
50    echo "  ===== btape fill test OK ===== " >>test.out
51    scripts/cleanup
52 fi