]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/multi-drive-group-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / multi-drive-group-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # This script is used to test multiple devices grouped in
9 # the director configuration
10 #
11 #
12 TestName="multi-drive-group-test"
13 JobName=backup
14 . scripts/functions
15
16 scripts/cleanup
17 scripts/copy-2disk-confs
18 scripts/prepare-disk-changer
19
20 echo "s/signature=MD5/signature=MD5; readfifo=yes/" > $tmp/1
21 echo "s/FileStorage/FileStorage; Device=FileStorage2; Device=FileStorage3; Device=FileStorage4/" >> $tmp/1
22 sed -f $tmp/1 $conf/bacula-dir.conf > $tmp/2 
23 # Allow auto label 
24 $bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Default")'
25 $bperl -e 'add_attribute("$tmp/2", "Action On Purge", "Truncate", "Pool", "Default")'
26 $bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Inc")'
27 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "Label Media", "yes", "Device")'
28
29 # set this to do round robbin
30 #$bperl -e 'set_maximum_concurrent_jobs("$conf/bacula-sd.conf", 1, "Device")'
31
32 $bperl -e 'add_attribute("$tmp/2", "Prefer Mounted Volumes", "no", "Job")';
33
34 # Disable spooling for each job
35 $bperl -e 'add_attribute("$tmp/2", "SpoolData",    "no",  "Job")'
36 cp $tmp/2 $conf/bacula-dir.conf
37
38 $bperl -e 'extract_resource("$conf/bacula-sd.conf", "Device", "FileStorage")' > $tmp/2
39 for i in 2 3 4; do
40     sed "s/FileStorage/FileStorage$i/" $tmp/2 >> $conf/bacula-sd.conf
41 done
42
43 disable_plugins
44
45 echo "$cwd/build" >${cwd}/tmp/file-list
46 echo "$tmp/fifo" >>${cwd}/tmp/file-list
47
48 mkfifo $tmp/fifo
49 (sleep 15 > $tmp/fifo
50  sleep 3 > $tmp/fifo
51 )&
52
53 change_jobname $JobName
54 start_test
55
56 # test with autolabel
57 #
58 #
59 # Write out bconsole commands
60 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
61 @out /dev/null
62 messages
63 @$out ${cwd}/tmp/log1.out
64 run level=full job=backup storage=File pool=Default yes
65 run level=full job=backup storage=File pool=Default yes
66 run level=full job=backup storage=File pool=Default yes
67 run level=full job=backup storage=File pool=Inc yes
68 run level=full job=backup storage=File pool=Inc yes
69 run level=full job=backup storage=File pool=Default yes
70 run level=full job=backup storage=File pool=Default yes
71 run level=full job=backup storage=File pool=Default yes
72 run level=full job=backup storage=File pool=Default yes
73 @sleep 3
74 messages
75 status storage=File
76 status dir
77 messages
78 wait
79 messages
80 quit
81 END_OF_DATA
82
83 run_bacula
84
85 check_for_zombie_jobs storage=File
86 check_for_zombie_jobs storage=tape
87 stop_bacula
88
89 touch $tmp/log2.out
90 check_two_logs
91 #check_restore_diff
92
93 end_test