]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-jobs-tape
Backport from BEE
[bacula/bacula] / regress / tests / four-jobs-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then backup four times, each with incremental then finally restore.
5 #   It should require at least 4 different bsrs.
6 #
7 TestName="four-jobs-tape"
8 JobName=fourjobstape
9 . scripts/functions
10
11 require_tape_drive
12
13 scripts/cleanup-tape
14 scripts/copy-tape-confs
15 echo "${cwd}/build" >${cwd}/tmp/file-list
16
17 change_jobname $JobName
18 start_test
19
20 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
21 @$out /dev/null
22 estimate job=$JobName listing
23 estimate job=$JobName
24 estimate job=$JobName
25 messages
26 @$out ${cwd}/tmp/log1.out
27 label storage=tape volume=TestVolume001 slot=0 pool=Default
28 run job=$JobName yes
29 wait
30 messages
31 quit
32 END_OF_DATA
33 run_bacula
34
35 scripts/check_for_zombie_jobs storage=tape
36 echo "Backup 1 done"
37 # make some files for the incremental to pick up
38 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
39 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
40    
41 #
42 # run a second job
43 #
44 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
45 @$out /dev/null
46 messages
47 @$out ${cwd}/tmp/log1.out
48 run job=$JobName level=Incremental yes
49 wait
50 messages
51 quit
52 END_OF_DATA
53
54 run_bacula
55
56 scripts/check_for_zombie_jobs storage=tape
57 echo "Backup 2 done"
58 touch ${cwd}/build/src/dird/*.c
59 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
60 #
61 # run a third job
62 #
63 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
64 @$out /dev/null
65 messages
66 @$out ${cwd}/tmp/log1.out
67 run job=$JobName level=Incremental yes
68 wait
69 messages
70 quit
71 END_OF_DATA
72
73 run_bacula
74
75 scripts/check_for_zombie_jobs storage=tape
76 echo "Backup 3 done"
77 # make some files for the incremental to pick up
78 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
79 #
80 # run a fourth job
81 #
82 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
83 @$out /dev/null
84 messages
85 @$out ${cwd}/tmp/log1.out
86 run job=$JobName level=Incremental yes
87 wait
88 messages
89 quit
90 END_OF_DATA
91 run_bacula
92
93 scripts/check_for_zombie_jobs storage=tape
94 echo "Backup 4 done"
95
96 # now do several restores to ensure we cleanup between jobs
97 #
98 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
99 @$out /dev/null
100 restore where=${cwd}/tmp/bacula-restores select all done
101 yes
102 wait
103 restore where=${cwd}/tmp/bacula-restores select all done
104 yes
105 wait
106 @$out ${cwd}/tmp/log2.out
107 @#
108 @# now unmount the tape and start two restores
109 @#  at the same time
110 @#
111 unmount storage=tape
112 restore where=${cwd}/tmp/bacula-restores select all done
113 yes
114 restore where=${cwd}/tmp/bacula-restores select
115 unmark *
116 mark *
117 done
118 yes
119 mount storage=tape
120 wait
121 messages
122 quit
123 END_OF_DATA
124
125 run_bacula
126 check_for_zombie_jobs storage=tape
127 stop_bacula
128
129 check_two_logs
130 check_restore_diff
131 end_test