3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Show the broken media bug. Test by Graham Keeling.
10 # For the moment this test will always fail, so do not add
11 # it to the standard test set.
13 # - You begin writing a giant job onto a Volume
14 # - There are no other volumes available for writing (big mistake).
15 # - You start a second job that needs a Volume to write on.
16 # - The second job see that there are no JobMedia records associated with the
17 # Volume (not yet written), so it purges the Volume.
18 # - A sort of chaos then follows.
21 TestName="broken-media-bug-test"
26 /bin/cp -f scripts/broken-media-bug-bacula-dir.conf bin/bacula-dir.conf
27 /bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
28 /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
29 /bin/cp -f scripts/test-console.conf bin/bconsole.conf
30 hugefile=${cwd}/build/hugefile
32 echo "${cwd}/build" >${cwd}/tmp/file-list
36 echo "Creating huge ${hugefilesize}M file..."
37 dd if=/dev/urandom of="$hugefile" bs=1M count="$hugefilesize"
40 cat >tmp/bconcmds <<END_OF_DATA
44 setdebug level=150 storage=File
45 setdebug level=150 Director
46 label storage=File volume=TestVolume0001
47 label storage=File volume=TestVolume0002
55 # Give the first job a bit of time to get going.
58 cat >tmp/bconcmds <<END_OF_DATA
59 setdebug level=150 storage=File
60 setdebug level=150 Director
62 llist volume=TestVolume0001
63 llist volume=TestVolume0002
69 restore fileset=Set1 where=${cwd}/tmp/bacula-restores select all storage=File done
77 check_for_zombie_jobs storage=File