#!/bin/sh # # Copyright (C) 2000-2017 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # Copyright (C) 2000-2015 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # # Show the broken media bug. Test by Graham Keeling. # # For the moment this test will always fail, so do not add # it to the standard test set. # The problem: # - You begin writing a giant job onto a Volume # - There are no other volumes available for writing (big mistake). # - You start a second job that needs a Volume to write on. # - The second job see that there are no JobMedia records associated with the # Volume (not yet written), so it purges the Volume. # - A sort of chaos then follows. # TestName="broken-media-bug-test" . scripts/functions cwd=`pwd` scripts/cleanup /bin/cp -f scripts/broken-media-bug-bacula-dir.conf bin/bacula-dir.conf /bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/test-console.conf bin/bconsole.conf hugefile=${cwd}/build/hugefile hugefilesize=300 echo "${cwd}/build" >${cwd}/tmp/file-list start_test echo "Creating huge ${hugefilesize}M file..." dd if=/dev/urandom of="$hugefile" bs=1M count="$hugefilesize" echo "Done" cat >tmp/bconcmds <tmp/bconcmds <