]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/multi-drive-test
baculum: Add module to check resource dependencies
[bacula/bacula] / regress / tests / multi-drive-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 TestName="multi-drive1-test"
12 JobName=backup
13 . scripts/functions
14
15 scripts/cleanup
16 scripts/copy-2disk-confs
17 scripts/prepare-disk-changer
18
19 echo "s/signature=MD5/signature=MD5; readfifo=yes/" > $tmp/1
20 echo "s/FileStorage/Device = FileStorage; Device=FileStorage2; Device=FileStorage3; Device=FileStorage4/" >> $tmp/1
21 sed -f $tmp/1 $conf/bacula-dir.conf > $tmp/2 
22 $bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Default")'
23 $bperl -e 'add_attribute("$tmp/2", "Label Format", "Vol", "Pool", "Inc")'
24 $bperl -e 'add_attribute("$tmp/2", "SpoolData",    "no",  "Job")'
25 cp $tmp/2 $conf/bacula-dir.conf
26
27 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "Label Media", "yes", "Device")'
28 $bperl -e 'extract_resource("$conf/bacula-sd.conf", "Device", "FileStorage")' > $tmp/2
29 for i in 2 3 4; do
30     sed "s/FileStorage/FileStorage$i/" $tmp/2 >> $conf/bacula-sd.conf
31 done
32
33 disable_plugins
34
35 echo "$cwd/build" >${cwd}/tmp/file-list
36 echo "$tmp/fifo" >>${cwd}/tmp/file-list
37
38 mkfifo $tmp/fifo
39 (sleep 15 > $tmp/fifo)&
40
41 change_jobname $JobName
42 start_test
43
44 # test with autolabel
45 #
46 #
47 # Write out bconsole commands
48 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
49 @output /dev/null
50 messages
51 @$out ${cwd}/tmp/log1.out
52 run level=full job=backup storage=File pool=Default yes
53 @sleep 3
54 run level=full job=backup storage=File pool=Default yes
55 @sleep 3
56 run level=full job=backup storage=File pool=Inc yes
57 @sleep 3
58 messages
59 status storage=File
60 status dir
61 messages
62 wait
63 quit
64 END_OF_DATA
65
66 run_bacula
67
68 check_for_zombie_jobs storage=File
69 check_for_zombie_jobs storage=tape
70 stop_bacula
71
72 touch $tmp/log2.out
73 check_two_logs
74 #check_restore_diff
75
76 end_test