]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/fixed-block-size-tape
Pull regression truncate-test from Branch-9.1
[bacula/bacula] / regress / tests / fixed-block-size-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 # Run a simple backup of the Bacula build directory 
9 #   to a tape where we set the minimum and maximum block
10 #   sizes.
11 #
12 TestName="fixed-block-size-tape"
13 JobName=fixedblocksize
14 . scripts/functions
15
16 require_tape_drive
17
18 copy_tape_confs
19
20 echo "${cwd}/build" >${cwd}/tmp/file-list
21
22 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
23 echo "s%# Maximum Block Size%  Maximum Block Size%" >${cwd}/tmp/2
24 echo "s%# Minimum Block Size%  Minimum Block Size%" >>${cwd}/tmp/2
25 sed -f ${cwd}/tmp/2 ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
26 if [ $? != 0 ] ; then
27    echo " "
28    echo " "
29    echo "!!!! sed problem in Fixed Block Size test !!!!!"
30    echo " "
31    exit 1
32 fi
33 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
34
35 change_jobname NightlySave $JobName
36 start_test
37
38
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
40 @$out /dev/null
41 messages
42 @$out ${cwd}/tmp/log1.out
43 setdebug level=51 storage=tape
44 label storage=tape volume=TestVolume001 slot=0 pool=Default
45 run job=$JobName yes
46 wait
47 messages
48 @# 
49 @# now do a restore
50 @#
51 @$out ${cwd}/tmp/log2.out
52 restore where=${cwd}/tmp/bacula-restores select storage=tape
53 unmark *
54 mark *
55 done
56 yes
57 wait
58 messages
59 quit
60 END_OF_DATA
61
62 run_bacula
63 check_for_zombie_jobs storage=tape
64 stop_bacula
65
66 check_two_logs
67 check_restore_diff
68 end_test