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