]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/btape-fill-full-changer
baculum: Add strip_prefix, add_prefix, add_suffix and regex_where restore options...
[bacula/bacula] / regress / tests / btape-fill-full-changer
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Test the fill command in btape
7 #
8 TestName="btape-fill-full-changer"
9 JobName=btape-fill-changer
10 . scripts/functions
11
12 require_tape_drive
13 require_autochanger
14
15 scripts/cleanup
16 scripts/copy-btape-confs
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 # Limit Volume size for debugging without waiting too long
28 #
29 # cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
30 # sed -e 's%# MaximumVolumeSize = 400M%  MaximumVolumeSize = 400M%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
31
32 if test "$debug" -eq 1 ; then
33    $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
34 fill
35 m
36
37 quit
38 END_OF_DATA
39 else
40    $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log1.out 2>&1
41 fill
42 m
43
44 quit
45 END_OF_DATA
46 fi
47
48 grep "^The last block on the second tape matches\. Test succeeded\." ${cwd}/tmp/log1.out >/dev/null 2>&1
49 if [ $? != 0 ] ; then
50    echo " "
51    echo " "
52    echo "  !!!!! btape fill test failed!!! !!!!! "
53    echo "  !!!!! btape fill test failed!!! !!!!! " >>test.out
54    echo " "
55 else
56    echo "  ===== btape fill test OK ===== "
57    echo "  ===== btape fill test OK ===== " >>test.out
58    scripts/cleanup
59 fi