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