]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-jobs-test
baculum: Add strip_prefix, add_prefix, add_suffix and regex_where restore options...
[bacula/bacula] / regress / tests / four-jobs-test
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-test"
13 JobName=SpanVol
14 . scripts/functions
15
16 scripts/cleanup
17 scripts/copy-test-confs
18 echo "${cwd}/build" >${cwd}/tmp/file-list
19
20 change_jobname CompressedTest $JobName
21 start_test
22
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
24 @output /dev/null
25 estimate job=$JobName listing
26 estimate job=$JobName
27 estimate job=$JobName
28 messages
29 @$out ${cwd}/tmp/log1.out
30 label storage=File volume=TestVolume001
31 run job=$JobName yes
32 wait
33 messages
34 quit
35 END_OF_DATA
36
37 run_bacula
38 check_for_zombie_jobs storage=File
39 # make some files for the incremental to pick up
40 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
41 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
42    
43 #
44 # run a second job
45 #
46 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
47 @output /dev/null
48 messages
49 @$out  ${cwd}/tmp/log1.out
50 run job=$JobName yes
51 wait
52 messages
53 quit
54 END_OF_DATA
55
56 run_bconsole
57 check_for_zombie_jobs storage=File
58
59 touch ${cwd}/build/src/dird/*.c
60 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
61 #
62 # run a third job
63 #
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
65 @output /dev/null
66 messages
67 @$out ${cwd}/tmp/log1.out
68 run job=$JobName yes
69 wait
70 messages
71 quit
72 END_OF_DATA
73
74 run_bconsole
75 check_for_zombie_jobs storage=File
76
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 @output /dev/null
84 messages
85 @$out ${cwd}/tmp/log1.out
86 run job=$JobName yes
87 wait
88 messages
89 quit
90 END_OF_DATA
91
92 run_bconsole
93 check_for_zombie_jobs storage=File
94
95
96 # now do several restores to ensure we cleanup between jobs
97 #
98 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
99 @output /dev/null
100 restore where=${cwd}/tmp/bacula-restores select all storage=File done
101 yes
102 wait
103 restore where=${cwd}/tmp/bacula-restores select all storage=File done
104 yes
105 wait
106 @$out ${cwd}/tmp/log2.out
107 restore where=${cwd}/tmp/bacula-restores select storage=File
108 unmark *
109 mark *
110 done
111 yes
112 wait
113 messages
114 quit
115 END_OF_DATA
116
117 run_bconsole
118 check_for_zombie_jobs storage=File
119 stop_bacula
120
121 check_two_logs
122 check_restore_diff
123 end_test