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