3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Test of ANSI labeled tapes
8 # Run a simple backup of the Bacula build directory
9 # to a tape then restore it, we do that twice to ensure that
10 # we can correctly append to a tape.
11 # We also use the purge and the relabel commands as
12 # well as a pile of status storage commands.
14 TestName="ansi-label-tape"
20 scripts/copy-tape-confs
21 /bin/cp -f scripts/ansi-sd-tape.conf bin/bacula-sd.conf
24 echo "${cwd}/build" >${cwd}/tmp/file-list
26 change_jobname NightlySave $JobName
29 # Write out bconsole commands
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out ${cwd}/tmp/log1.out
34 @#setdebug level=200 storage=tape
35 label storage=tape volume=Vol001 slot=0 pool=Default
37 relabel pool=Default storage=tape oldVolume=Vol001 volume=Vol002 slot=0
39 relabel pool=Default storage=tape oldVolume=Vol002 volume=Vol001 slot=0
48 @$out ${cwd}/tmp/log2.out
49 setdebug level=200 storage=tape
50 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
58 check_for_zombie_jobs storage=tape
62 # Now do a second backup after making a few changes
64 touch ${cwd}/build/src/dird/*.c
65 echo "test test" > ${cwd}/build/src/dird/xxx
67 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
70 @$out ${cwd}/tmp/log1.out
72 @#setdebug level=300 storage=tape
78 @# now do a second restore
80 @$out ${cwd}/tmp/log2.out
82 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
91 check_for_zombie_jobs storage=tape