]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/btape-test-changer
Work on certification scripts
[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 Drive-0 <<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 Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
27
28 test
29 yes
30 quit
31 END_OF_DATA
32 fi
33
34 if [ $? != 0 ] ; then
35    echo " "
36    echo " "
37    echo "  !!!!! btape-changer test failed!!! !!!!! "
38    echo "  !!!!! btape-changer test failed!!! !!!!! " >>test.out
39    echo " "
40    exit 1
41 fi
42
43 #
44 #  Increase block size to 262144
45 #
46 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
47 sed -e 's%64512%262144%' ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
48
49 if test "$debug" -eq 1 ; then
50   $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log2.out
51 test
52 yes
53 quit
54 END_OF_DATA
55 else
56   $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log2.out 2>&1
57 test
58 yes
59 quit
60 END_OF_DATA
61 fi
62
63 if [ $? != 0 ] ; then
64    echo " "
65    echo " "
66    echo "  !!!!! btape-changer test failed!!! !!!!! "
67    echo "  !!!!! btape-changer test failed!!! !!!!! " >>test.out
68    echo " "
69 else
70    echo "  ===== btape-changer test OK ===== "
71    echo "  ===== btape-changer test OK ===== " >>test.out
72    scripts/cleanup
73 fi