tests/fixed-block-size-tape
tests/bscan-tape
tests/btape-fill-tape
+tests/truncate-bug-tape
echo " "
echo " "
echo "Test results"
echo " "
echo " "
-echo " === Starting auto-label-test `date +%R:%S` ==="
-echo " === Starting auto-label-test `date +%R:%S` ===" >>working/log
+echo " === Starting auto-label-test at `date +%R:%S` ==="
+echo " === Starting auto-label-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting Bacula tape test `date +%R:%S` ==="
-echo " === Starting Bacula tape test `date +%R:%S` ===" >>working/log
+echo " === Starting Bacula tape test at `date +%R:%S` ==="
+echo " === Starting Bacula tape test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting Backup Bacula Test `date +%R:%S` ==="
-echo " === Starting Backup Bacula Test `date +%R:%S` ===" >>working/log
+echo " === Starting Backup Bacula Test at `date +%R:%S` ==="
+echo " === Starting Backup Bacula Test at `date +%R:%S` ===" >>working/log
echo " "
#bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting bextract-test `date +%R:%S` ==="
-echo " === Starting bextract-test `date +%R:%S` ===" >working/log
+echo " === Starting bextract-test at `date +%R:%S` ==="
+echo " === Starting bextract-test at `date +%R:%S` ===" >working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting bscan-tape `date +%R:%S` ==="
-echo " === Starting bscan-tape `date +%R:%S` ===" >>working/log
+echo " === Starting bscan-tape at `date +%R:%S` ==="
+echo " === Starting bscan-tape at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting bscan-test `date +%R:%S` ==="
-echo " === Starting bscan-test `date +%R:%S` ===" >working/log
+echo " === Starting bscan-test at `date +%R:%S` ==="
+echo " === Starting bscan-test at `date +%R:%S` ===" >working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting bsr-opt-test `date +%R:%S` ==="
-echo " === Starting bsr-opt-test `date +%R:%S` ===" >working/log
+echo " === Starting bsr-opt-test at `date +%R:%S` ==="
+echo " === Starting bsr-opt-test at `date +%R:%S` ===" >working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting btape fill test `date +%R:%S` ==="
-echo " === Starting btape fill test `date +%R:%S` ===" >>working/log
+echo " === Starting btape fill test at `date +%R:%S` ==="
+echo " === Starting btape fill test at `date +%R:%S` ===" >>working/log
echo " "
bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >tmp/log1.out
echo " "
echo " "
-echo " === Starting btape fill test `date +%R:%S` ==="
-echo " === Starting btape fill test `date +%R:%S` ===" >>working/log
+echo " === Starting btape fill test at `date +%R:%S` ==="
+echo " === Starting btape fill test at `date +%R:%S` ===" >>working/log
echo " "
exit
bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >tmp/log1.out
echo " "
echo " "
-echo " === Starting compressed-test `date +%R:%S` ==="
-echo " === Starting compressed-test `date +%R:%S` ===" >>working/log
+echo " === Starting compressed-test at `date +%R:%S` ==="
+echo " === Starting compressed-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting concurrent-jobs-test `date +%R:%S` ==="
-echo " === Starting concurrent-jobs-test `date +%R:%S` ===" >>working/log
+echo " === Starting concurrent-jobs-test at `date +%R:%S` ==="
+echo " === Starting concurrent-jobs-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting decremental-test `date +%R:%S` ==="
-echo " === Starting decremental-test `date +%R:%S` ===" >>working/log
+echo " === Starting decremental-test at `date +%R:%S` ==="
+echo " === Starting decremental-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting Fixed Block Size test `date +%R:%S` ==="
-echo " === Starting Fixed Block Size test `date +%R:%S` ===" >>working/log
+echo " === Starting Fixed Block Size test at `date +%R:%S` ==="
+echo " === Starting Fixed Block Size test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting four-concurrent-jobs-tape `date +%R:%S` ==="
-echo " === Starting four-concurrent-jobs-tape `date +%R:%S` ===" >>working/log
+echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ==="
+echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting four-concurrent-jobs-test `date +%R:%S` ==="
-echo " === Starting four-concurrent-jobs-test `date +%R:%S` ===" >>working/log
+echo " === Starting four-concurrent-jobs-test at `date +%R:%S` ==="
+echo " === Starting four-concurrent-jobs-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting four-jobs-tape `date +%R:%S` ==="
-echo " === Starting four-jobs-tape `date +%R:%S` ===" >>working/log
+echo " === Starting four-jobs-tape at `date +%R:%S` ==="
+echo " === Starting four-jobs-tape at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting four-jobs-test `date +%R:%S` ==="
-echo " === Starting four-jobs-test `date +%R:%S` ===" >>working/log
+echo " === Starting four-jobs-test at `date +%R:%S` ==="
+echo " === Starting four-jobs-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting incremental-tape test `date +%R:%S` ==="
-echo " === Starting incremental-tape test `date +%R:%S` ===" >>working/log
+echo " === Starting incremental-tape test at `date +%R:%S` ==="
+echo " === Starting incremental-tape test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting incremental-test `date +%R:%S` ==="
-echo " === Starting incremental-test `date +%R:%S` ===" >>working/log
+echo " === Starting incremental-test at `date +%R:%S` ==="
+echo " === Starting incremental-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting query-test `date +%R:%S` ==="
-echo " === Starting query-test `date +%R:%S` ===" >>working/log
+echo " === Starting query-test at `date +%R:%S` ==="
+echo " === Starting query-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting recycle-test `date +%R:%S` ==="
-echo " === Starting recycle-test `date +%R:%S` ===" >working/log
+echo " === Starting recycle-test at `date +%R:%S` ==="
+echo " === Starting recycle-test at `date +%R:%S` ===" >working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting restore-by-file-tape test `date +%R:%S` ==="
-echo " === Starting restore-by-file-tape test `date +%R:%S` ===" >>working/log
+echo " === Starting restore-by-file-tape test at `date +%R:%S` ==="
+echo " === Starting restore-by-file-tape test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting restore-by-file-test `date +%R:%S` ==="
-echo " === Starting restore-by-file-test `date +%R:%S` ===" >>working/log
+echo " === Starting restore-by-file-test at `date +%R:%S` ==="
+echo " === Starting restore-by-file-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting restore-disk-seek-test `date +%R:%S` ==="
-echo " === Starting restore-disk-seek-test `date +%R:%S` ===" >>working/log
+echo " === Starting restore-disk-seek-test at `date +%R:%S` ==="
+echo " === Starting restore-disk-seek-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start -v -v 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting restore2-by-file-test `date +%R:%S` ==="
-echo " === Starting restore2-by-file-test `date +%R:%S` ===" >>working/log
+echo " === Starting restore2-by-file-test at `date +%R:%S` ==="
+echo " === Starting restore2-by-file-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting six-vol-test `date +%R:%S` ==="
-echo " === Starting six-vol-test `date +%R:%S` ===" >>working/log
+echo " === Starting six-vol-test at `date +%R:%S` ==="
+echo " === Starting six-vol-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting Small File Size test `date +%R:%S` ==="
-echo " === Starting Small File Size test `date +%R:%S` ===" >>working/log
+echo " === Starting Small File Size test at `date +%R:%S` ==="
+echo " === Starting Small File Size test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting span-vol-test `date +%R:%S` ==="
-echo " === Starting span-vol-test `date +%R:%S` ===" >working/log
+echo " === Starting span-vol-test at `date +%R:%S` ==="
+echo " === Starting span-vol-test at `date +%R:%S` ===" >working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting sparse-compressed-test `date +%R:%S` ==="
-echo " === Starting sparse-compressed-test `date +%R:%S` ===" >>working/log
+echo " === Starting sparse-compressed-test at `date +%R:%S` ==="
+echo " === Starting sparse-compressed-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting sparse-test `date +%R:%S` ==="
-echo " === Starting sparse-test `date +%R:%S` ===" >>working/log
+echo " === Starting sparse-test at `date +%R:%S` ==="
+echo " === Starting sparse-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
--- /dev/null
+#!/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/bacula start
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@tee /dev/null
+messages
+@tee 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 <<END_OF_DATA
+@tee /dev/null
+messages
+@tee 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
+@tee
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@tee /dev/null
+messages
+@tee 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
echo " "
echo " "
-echo " === Starting two-jobs-test `date +%R:%S` ==="
-echo " === Starting two-jobs-test `date +%R:%S` ===" >>working/log
+echo " === Starting two-jobs-test at `date +%R:%S` ==="
+echo " === Starting two-jobs-test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting two-vol-test `date +%R:%S` ==="
-echo " === Starting two-vol-test `date +%R:%S` ===" >working/log
+echo " === Starting two-vol-test at `date +%R:%S` ==="
+echo " === Starting two-vol-test at `date +%R:%S` ===" >working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting Two Volume Tape test `date +%R:%S` ==="
-echo " === Starting Two Volume Tape test `date +%R:%S` ===" >>working/log
+echo " === Starting Two Volume Tape test at `date +%R:%S` ==="
+echo " === Starting Two Volume Tape test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting verify Volume Test `date +%R:%S` ==="
-echo " === Starting verify Volume Test `date +%R:%S` ===" >>working/log
+echo " === Starting verify Volume Test at `date +%R:%S` ==="
+echo " === Starting verify Volume Test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting weird filenames test `date +%R:%S` ==="
-echo " === Starting weird filenames test `date +%R:%S` ===" >>working/log
+echo " === Starting weird filenames test at `date +%R:%S` ==="
+echo " === Starting weird filenames test at `date +%R:%S` ===" >>working/log
echo " "
bin/bacula start 2>&1 >/dev/null
echo " "
echo " "
-echo " === Starting weird filenames2 test `date +%R:%S` ==="
-echo " === Starting weird filenames2 test `date +%R:%S` ===" >>working/log
+echo " === Starting weird filenames2 test at `date +%R:%S` ==="
+echo " === Starting weird filenames2 test at `date +%R:%S` ===" >>working/log
echo " "
bin/testls weird-files2 >${cwd}/tmp/original