]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/btape-fill-full-tape
regress: make truncate-test check for wrongly truncating an already truncated volume
[bacula/bacula] / regress / tests / btape-fill-full-tape
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 #
7 # Test the fill command in btape
8 #
9 TestName="btape-fill-full-tape"
10 JobName=btape-fill
11 . scripts/functions
12
13 require_tape_drive
14
15 scripts/copy-btape-confs
16 scripts/cleanup-tape
17
18 change_jobname $JobName
19 start_test
20
21 #
22 #  Increase block size to 262144
23 #
24 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
25 sed -e 's%64512%262144%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
26
27
28 if test "$debug" -eq 1 ; then
29    $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
30 fill
31 s
32
33 quit
34 END_OF_DATA
35 else
36    $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log1.out 2>&1
37 fill
38 s
39
40 quit
41 END_OF_DATA
42 fi
43
44 grep "^The last block on the tape matches\. Test succeeded\." ${cwd}/tmp/log1.out >/dev/null 2>&1
45 if [ $? != 0 ] ; then
46    echo " "
47    echo " "
48    echo "  !!!!! btape fill test failed!!! !!!!! "
49    echo "  !!!!! btape fill test failed!!! !!!!! " >>test.out
50    echo " "
51 else
52    echo "  ===== btape fill test OK ===== "
53    echo "  ===== btape fill test OK ===== " >>test.out
54 #  scripts/cleanup
55 fi