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