1#!/bin/sh
2#
3#
4TestName="eot-fail-tape"
5JobName=eotfailtape
6. scripts/functions
7
8require_tape_drive
9
10scripts/cleanup-tape
11
12scripts/copy-tape-confs
13outf="${cwd}/tmp/sed_tmp"
14echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
15cp -f ${cwd}/bin/bareos-sd.conf ${cwd}/tmp/1
16sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bareos-sd.conf
17change_jobname $JobName
18
19# Directory to backup.
20# This directory will be created by setup_data().
21BackupDirectory="${tmp}/data"
22
23# Use a tgz to setup data to be backuped.
24# Data will be placed at "${tmp}/data/".
25setup_data data/small.tgz
26
27# the default fileset FS_TESTJOB backups all file and directories defined in "${tmp}/file-list".
28echo "${BackupDirectory}" >${tmp}/file-list
29
30
31start_test
32
33cat <<END_OF_DATA >${cwd}/tmp/bconcmds
34@$out /dev/null
35messages
36@$out tmp/log1.out
37label storage=tape volume=TestVolume001 slot=0 pool=Default
38@#update Volume=TestVolume001 MaxVolBytes=3000000
39run job=$JobName yes
40wait
41messages
42@#
43@# now do a restore
44@#
45@$out tmp/log2.out
46restore where=${cwd}/tmp/bareos-restores select all storage=tape done
47yes
48wait
49messages
50quit
51END_OF_DATA
52
53run_bareos
54check_for_zombie_jobs storage=tape
55stop_bareos
56
57check_two_logs
58check_restore_diff
59end_test
60