]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/virtual-changer-test
Fix Virtual test
[bacula/bacula] / regress / tests / virtual-changer-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory. Create three
4 #   tapes, each in a different pool, then run two jobs both of which
5 #   want the disk that is not loaded.  Note, they both have     
6 #   prefers non-mounted tapes.  This should expose bug #801
7 #
8 # This script uses the virtual disk autochanger and two drives
9 #
10 TestName="virtual-changer-disk"
11 JobName="virtualchangerdisk"
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-2disk-drive-confs
16 scripts/prepare-two-disks
17
18 CLIENT=2drive2disk
19
20 echo "${cwd}/build" >${cwd}/tmp/file-list
21 #change_jobname Virtual $JobName
22 start_test
23
24 # Turn off Prefer Mounted Volumes so we use 2 drives
25 outf="${cwd}/tmp/sed_tmp"
26 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
27 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
28 # Comment the next line out to write everything to one drive
29 #  otherwise, it writes the two jobs to different drives
30 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
31
32 # Write out bconsole commands
33 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
34 @output /dev/null
35 messages
36 @$out ${cwd}/tmp/log1.out
37 setdebug level=200 storage=Virtual
38 @#setdebug level=200 client=$CLIENT 
39 label storage=Virtual volume=TestVolume001 slot=1 Pool=Default drive=0
40 label storage=Virtual volume=TestVolume002 slot=2 Pool=Full    drive=0
41 label storage=Virtual volume=TestVolume003 slot=3 Pool=Inc     drive=1
42 status storage=Virtual
43 run job=Virtual level=Full Pool=Default yes
44 run job=Virtual level=Full Pool=Default yes
45 run job=Virtual level=Full Pool=Default yes
46 run job=Virtual level=Full Pool=Default yes
47 run job=Virtual level=Full Pool=Default yes
48 @sleep 10
49 status storage=Virtual
50 list volumes
51 wait
52 list volumes
53 list jobs
54 status storage=Virtual
55 messages
56 quit
57 END_OF_DATA
58
59 # exit
60
61 run_bacula
62 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
63 @$out /dev/null
64 messages
65 @# 
66 @# now do a restore
67 @#
68 @$out ${cwd}/tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores select all storage=Virtual done
70 yes
71 wait
72 messages
73 @$out
74 quit
75 END_OF_DATA
76
77 run_bconsole
78
79 check_for_zombie_jobs storage=Virtual
80 stop_bacula
81
82 check_two_logs
83 check_restore_diff
84
85 end_test