#!/bin/sh # # Test for a tape truncation bug. # cwd=`pwd` scripts/copy-tape-confs scripts/cleanup-tape echo "${cwd}/build" >/tmp/file-list echo " " echo " " echo " === Starting truncate-bug-tape test at `date +%R:%S` ===" echo " === Starting truncate-bug-tape test at `date +%R:%S` ===" >>working/log echo " " bin/bacula start 2>&1 >/dev/null bin/bconsole -c bin/bconsole.conf <&1 >/dev/null @output /dev/null messages @output tmp/log1.out label storage=DDS-4 volume=TestVolume001 slot=0 @# do a bunch of saves so we have 12 files on the tape run job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes run level=Full job=NightlySave yes wait messages quit END_OF_DATA scripts/check_for_zombie_jobs storage=DDS-4 bin/bconsole -c bin/bconsole.conf <&1 >/dev/null @output /dev/null messages @output tmp/log1.out @# @# now do a restore @# restore where=${cwd}/tmp/bacula-restores storage=DDS-4 3 @# select JobId=4 (i.e. file five on the tape) 4 cd ${cwd}/build @# mark a single file mark configure done yes wait messages @output quit END_OF_DATA scripts/check_for_zombie_jobs storage=DDS-4 bin/bconsole -c bin/bconsole.conf <&1 >/dev/null @output /dev/null messages @output tmp/log2.out run level=Full job=NightlySave yes wait messages quit END_OF_DATA bin/bacula stop 2>&1 >/dev/null grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null bstat=$? grep "^ Termination: *Backup OK" tmp/log2.out 2>&1 >/dev/null rstat=$? if [ $bstat != 0 -o $rstat != 0 ] ; then echo " " echo " " echo " !!!!! truncate-bug-tape test Bacula source failed!!! !!!!! " echo " !!!!! truncate-bug-tape test failed!!! !!!!! " >>test.out echo " " else echo " ===== truncate-bug-tape test Bacula source OK ===== " echo " ===== truncate-bug-tape test OK ===== " >>test.out scripts/cleanup fi