]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/multi-drive1-test
Backport from Bacula Enterprise
[bacula/bacula] / regress / tests / multi-drive1-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", "Label Format", "Vol", "Pool", "Inc")'
26 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "Label Media", "yes", "Device")'
27
28 # set this to do round robbin
29 $bperl -e 'set_maximum_concurrent_jobs("$conf/bacula-sd.conf", 1, "Device")'
30
31 # Disable spooling for each job
32 $bperl -e 'add_attribute("$tmp/2", "SpoolData",    "no",  "Job")'
33 cp $tmp/2 $conf/bacula-dir.conf
34
35 $bperl -e 'extract_resource("$conf/bacula-sd.conf", "Device", "FileStorage")' > $tmp/2
36 for i in 2 3 4; do
37     sed "s/FileStorage/FileStorage$i/" $tmp/2 >> $conf/bacula-sd.conf
38 done
39
40 disable_plugins
41
42 echo "$cwd/build" >${cwd}/tmp/file-list
43 echo "$tmp/fifo" >>${cwd}/tmp/file-list
44
45 mkfifo $tmp/fifo
46 (sleep 15 > $tmp/fifo)&
47
48 change_jobname $JobName
49 start_test
50
51 # test with autolabel
52 #
53 #
54 # Write out bconsole commands
55 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
56 @out /dev/null
57 messages
58 @$out ${cwd}/tmp/log1.out
59 run level=full job=backup storage=File pool=Default yes
60 run level=full job=backup storage=File pool=Default yes
61 run level=full job=backup storage=File pool=Default yes
62 run level=full job=backup storage=File pool=Inc yes
63 run level=full job=backup storage=File pool=Inc yes
64 @sleep 3
65 messages
66 status storage=File
67 status dir
68 messages
69 wait
70 messages
71 quit
72 END_OF_DATA
73
74 run_bacula
75
76 check_for_zombie_jobs storage=File
77 check_for_zombie_jobs storage=tape
78 stop_bacula
79
80 touch $tmp/log2.out
81 check_two_logs
82 #check_restore_diff
83
84 end_test