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