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