]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/three-pool-recycle-test
Copy trunk regress into Branch
[bacula/bacula] / regress / tests / three-pool-recycle-test
1 #!/bin/sh
2 #
3 # This is Arno's test.  It uses three pools, three tapes, and
4 #  an autochanger. Note, the Director has four Pools in its 
5 #  conf:  Default, Full, Inc, and Scratch.  Default is used in the
6 #  NightlySave job by default.  What is backed up is what
7 #  is in ${cwd}/tmp/file-list, which is by default the Bacula
8 #  source code (i.e. the build directory).
9 #
10 #  Note, we use the virtual disk autochanger.
11 #
12 TestName="three-pool-recycle-test"
13 JobName=Three-pool-recycle
14 . scripts/functions
15
16 cwd=`pwd`
17 scripts/cleanup
18 scripts/copy-2disk-confs
19 scripts/prepare-two-disks
20
21 # remove Client Run Before Job
22 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
23 sed "s%Client Run Before Job%#Client Run Before Job%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
24
25 echo "${cwd}/build" >${cwd}/tmp/file-list
26
27 start_test
28
29 # Write out bconsole commands to a file
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
31 @output /dev/null
32 messages
33 @$out ${cwd}/tmp/log1.out
34 @#setdebug level=150 storage=DDS-4
35 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Full drive=0
36 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
37 label storage=DDS-4 volume=TestVolume003 slot=3 pool=Scratch drive=0
38 update Volume=TestVolume001 maxvoljobs=1
39 update Volume=TestVolume002 maxvoljobs=1
40 update Volume=TestVolume003 volretention=7s
41 update Volume=TestVolume003 maxvoljobs=1
42 list volumes
43 llist volume=TestVolume003
44 @# should pull Scratch volume
45 run job=NightlySave1 level=Full pool=Inc yes
46 wait
47 update Volume=TestVolume003 volretention=7s
48 update Volume=TestVolume003 maxvoljobs=1
49 messages
50 list volumes
51 llist volume=TestVolume003
52 run job=NightlySave1 level=Full pool=Default yes
53 wait
54 messages
55 list volumes
56 llist volume=TestVolume003
57 run job=NightlySave1 level=Full pool=Full yes
58 wait
59 @sleep 10
60 messages
61 list volumes
62 llist volume=TestVolume003
63 @# should recycle Scratch pool
64 run job=NightlySave2 level=Full pool=Inc yes
65 wait
66 update Volume=TestVolume003 volretention=7s
67 update Volume=TestVolume003 maxvoljobs=1
68 @sleep 10
69 messages
70 list volumes
71 @# should recycle Scratch pool
72 llist volume=TestVolume003
73 @#setdebug level=50 dir
74 run job=NightlySave2 level=Full pool=Default yes
75 wait
76 update Volume=TestVolume003 volretention=7s
77 update Volume=TestVolume003 maxvoljobs=1
78 @sleep 10
79 messages
80 list volumes
81 @# should recycle Scratch pool
82 run job=NightlySave2 level=Full pool=Full yes
83 status storage=DDS-4
84 messages
85 wait
86 list volumes
87 messages
88 @# 
89 @# now do a restore
90 @#
91 @$out ${cwd}/tmp/log2.out
92 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
93 yes
94 wait
95 messages
96 @$out
97 quit
98 END_OF_DATA
99
100 run_bacula
101 check_for_zombie_jobs storage=DDS-4
102 stop_bacula
103
104 check_two_logs
105 check_restore_diff
106 end_test