]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/btape-test-tape
Pull regression truncate-test from Branch-9.1
[bacula/bacula] / regress / tests / btape-test-tape
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-tape"
11 JobName=btapetest
12 . scripts/functions
13
14 require_tape_drive
15
16 scripts/copy-btape-confs
17 scripts/cleanup-tape
18
19 change_jobname $JobName
20 start_test
21
22 if test "$debug" -eq 1 ; then
23   $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA | tee ${cwd}/tmp/log1.out
24 test
25 quit
26 END_OF_DATA
27 else
28   $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log1.out 2>&1
29 test
30 quit
31 END_OF_DATA
32 fi
33
34 if [ $? != 0 ] ; then
35    echo " "
36    echo " "
37    echo "  !!!!! btape test failed!!! !!!!! "
38    echo "  !!!!! btape 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 quit
53 END_OF_DATA
54 else
55   $bin/btape -c bin/bacula-sd.conf Drive-0 <<END_OF_DATA >${cwd}/tmp/log2.out 2>&1
56 test
57 quit
58 END_OF_DATA
59 fi
60
61 if [ $? != 0 ] ; then
62    echo " "
63    echo " "
64    echo "  !!!!! btape test failed!!! !!!!! "
65    echo "  !!!!! btape test failed!!! !!!!! " >>test.out
66    echo " "
67 else
68    echo "  ===== btape test OK ===== "
69    echo "  ===== btape test OK ===== " >>test.out
70    scripts/cleanup
71 fi