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