]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/btape-test-changer
Big backport from Enterprise
[bacula/bacula] / regress / tests / btape-test-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 test command in btape
7 #
8 TestName="btape-test-changer"
9 JobName=btapechanger
10 . scripts/functions
11
12
13 require_tape_drive
14 require_autochanger
15
16 scripts/cleanup
17 scripts/copy-2tape-confs
18
19 change_jobname $JobName
20 start_test
21
22 if test "$debug" -eq 1 ; then
23   $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
24 capcmd
25 speed
26 test
27 yes
28 quit
29 END_OF_DATA
30 else
31   $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
32 capcmd
33 speed
34 test
35 yes
36 quit
37 END_OF_DATA
38 fi
39
40 if [ $? != 0 ] ; then
41    echo " "
42    echo " "
43    echo "  !!!!! btape-changer test failed!!! !!!!! "
44    echo "  !!!!! btape-changer test failed!!! !!!!! " >>test.out
45    echo " "
46    exit 1
47 fi
48
49 #
50 #  Increase block size to 262144
51 #
52 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
53 sed -e 's%64512%262144%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
54
55 if test "$debug" -eq 1 ; then
56   $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log2.out
57 test
58 yes
59 quit
60 END_OF_DATA
61 else
62   $bin/btape -w $tmp -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log2.out 2>&1
63 test
64 yes
65 quit
66 END_OF_DATA
67 fi
68
69 if [ $? != 0 ] ; then
70    echo " "
71    echo " "
72    echo "  !!!!! btape-changer test failed!!! !!!!! "
73    echo "  !!!!! btape-changer test failed!!! !!!!! " >>test.out
74    echo " "
75 else
76    echo "  ===== btape-changer test OK ===== "
77    echo "  ===== btape-changer test OK ===== " >>test.out
78    scripts/cleanup
79 fi