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