]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/three-pool-test
Tweak add copyright to regression tests that do not have one
[bacula/bacula] / regress / tests / three-pool-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-disk"
14 JobName="threepooldisk"
15 . scripts/functions
16
17 scripts/cleanup
18 scripts/copy-2disk-drive-confs
19 scripts/prepare-disk-changer
20 CLIENT=2drive2disk
21
22 echo "${cwd}/build" >${cwd}/tmp/file-list
23 change_jobname NightlySave $JobName
24 start_test
25
26 # Turn off Prefer Mounted Volumes so we use 2 drives
27 outf="${cwd}/tmp/sed_tmp"
28 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
29 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
30 # Comment the next line out to write everything to one drive
31 #  otherwise, it writes the two jobs to different drives
32 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
33
34 # Write out bconsole commands
35 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
36 @out /dev/null
37 messages
38 @$out ${cwd}/tmp/log1.out
39 @#setdebug level=200 storage=tape
40 @#setdebug level=200 client=$CLIENT 
41 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=0
42 label storage=tape volume=TestVolume002 slot=2 Pool=Full    drive=0
43 label storage=tape volume=TestVolume003 slot=3 Pool=Inc     drive=1
44 status storage=tape
45 run job=$JobName level=Full Pool=Default yes
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 setdebug level=200 storage=tape
51 @sleep 10
52 status storage=tape
53 list volumes
54 wait
55 list volumes
56 list jobs
57 status storage=tape
58 messages
59 quit
60 END_OF_DATA
61
62 # exit
63
64 run_bacula
65 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
66 @out /dev/null
67 messages
68 @# 
69 @# now do a restore
70 @#
71 @$out ${cwd}/tmp/log2.out
72 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
73 yes
74 wait
75 messages
76 quit
77 END_OF_DATA
78
79 run_bconsole
80
81 check_for_zombie_jobs storage=tape
82 stop_bacula
83
84 check_two_logs
85 check_restore_diff
86
87 end_test