]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/recycle-test
regress: Add more complex systemstate test with full restore
[bacula/bacula] / regress / tests / recycle-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   create three volumes and do six backups causing the
5 #   volumes to be recycled, and cycling through the volumes
6 #   twice. Tests maxvoljobs and volretention.
7 #
8 # Note, this test is a bit tricky, in that if you get too
9 #   much data in the regress/build directory, the test will
10 #   fail because it will run out of enough volumes to backup
11 #   all the data.
12 #
13 TestName="recycle-test"
14 JobName=Recycle
15 . scripts/functions
16
17 scripts/cleanup
18 scripts/copy-test-confs
19 echo "${cwd}/build" >${cwd}/tmp/file-list
20
21 change_jobname NightlySave $JobName
22 start_test
23
24 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
25 @$out /dev/null
26 messages
27 @$out ${cwd}/tmp/log1.out
28 label storage=File1 volume=TestVolume001
29 label storage=File1 volume=TestVolume002
30 label storage=File1 volume=TestVolume003
31 label storage=File1 volume=TestVolume004
32 @# Note, this is going to fail if the pruning gets
33 @#  to tight because the saved volume is too large.
34 @#  In that case, either add another volume, or
35 @#  increase the volume capacity a bit.
36 update Volume=TestVolume001 volretention=5s
37 update Volume=TestVolume001 maxvolbytes=200000000
38 update Volume=TestVolume002 volretention=5s
39 update Volume=TestVolume002 maxvolbytes=200000000
40 update Volume=TestVolume003 volretention=5s
41 update Volume=TestVolume003 maxvolbytes=200000000
42 update Volume=TestVolume004 volretention=5s
43 update Volume=TestVolume004 maxvolbytes=200000000
44 list volumes
45 setdebug level=150 storage=File1
46 setdebug level=50 dir
47 run job=$JobName storage=File1 level=full yes
48 run job=$JobName storage=File1 level=full yes
49 run job=$JobName storage=File1 level=full yes
50 wait
51 messages
52 list volumes
53 @sleep 12 
54 run job=$JobName storage=File1 level=full yes
55 run job=$JobName storage=File1 level=full yes
56 run job=$JobName storage=File1 level=full yes
57 wait
58 messages
59 list volumes
60 @sleep 12
61 run job=$JobName storage=File1 level=full yes
62 run job=$JobName storage=File1 level=full yes
63 run job=$JobName storage=File1 level=full yes
64 wait
65 messages
66 list volumes
67 @sleep 12
68 run job=$JobName storage=File1 level=full yes
69 run job=$JobName storage=File1 level=full yes
70 run job=$JobName storage=File1 level=full yes
71 wait
72 messages
73 list volumes
74 @sleep 12
75 run job=$JobName storage=File1 level=full yes
76 run job=$JobName storage=File1 level=full yes
77 run job=$JobName storage=File1 level=full yes
78 wait
79 messages
80 list volumes
81 @# 
82 @# now do a restore
83 @#
84 @$out ${cwd}/tmp/log2.out
85 restore where=${cwd}/tmp/bacula-restores select storage=File1
86 unmark *
87 mark *
88 done
89 yes
90 wait
91 messages
92 quit
93 END_OF_DATA
94
95 run_bacula
96 check_for_zombie_jobs storage=File1
97 stop_bacula
98
99 check_two_logs
100 check_restore_diff
101 end_test