]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-jobs-test
Updates
[bacula/bacula] / regress / tests / four-jobs-test
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-test"
8 JobName=SpanVol
9 . scripts/functions
10 set_debug 0
11
12 cwd=`pwd`
13 scripts/cleanup
14 scripts/copy-test-confs
15 echo "${cwd}/build" >/tmp/file-list
16
17 change_jobname CompressedTest $JobName
18 start_test
19
20 cat <<END_OF_DATA >tmp/bconcmds
21 @output /dev/null
22 estimate job=$JobName listing
23 estimate job=$JobName listing
24 estimate job=$JobName listing
25 messages
26 @$out tmp/log1.out
27 label storage=File volume=TestVolume001
28 run job=$JobName yes
29 wait
30 messages
31 quit
32 END_OF_DATA
33
34 run_bacula
35 check_for_zombie_jobs storage=File
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 >tmp/bconcmds
45 @output /dev/null
46 messages
47 @$out  tmp/log1.out
48 run job=$JobName
49 yes
50 wait
51 messages
52 quit
53 END_OF_DATA
54
55 run_bconsole
56 check_for_zombie_jobs storage=File
57
58 echo "Backup 2 done"
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 >tmp/bconcmds
65 @output /dev/null
66 messages
67 @output tmp/log1.out
68 label storage=File volume=TestVolume001
69 run job=$JobName yes
70 wait
71 messages
72 quit
73 END_OF_DATA
74
75 run_bconsole
76 check_for_zombie_jobs storage=File
77
78 echo "Backup 3 done"
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 >tmp/bconcmds
85 @output /dev/null
86 messages
87 @output tmp/log1.out
88 label storage=File volume=TestVolume001
89 run job=$JobName yes
90 wait
91 messages
92 quit
93 END_OF_DATA
94
95 run_bconsole
96 check_for_zombie_jobs storage=File
97
98 echo "Backup 4 done"
99
100 # now do several restores to ensure we cleanup between jobs
101 #
102 cat <<END_OF_DATA >tmp/bconcmds
103 @output /dev/null
104 restore where=${cwd}/tmp/bacula-restores select all storage=File done
105 yes
106 wait
107 restore where=${cwd}/tmp/bacula-restores select all storage=File done
108 yes
109 wait
110 @$out tmp/log2.out
111 restore where=${cwd}/tmp/bacula-restores select storage=File
112 unmark *
113 mark *
114 done
115 yes
116 wait
117 messages
118 @output
119 quit
120 END_OF_DATA
121
122 run_bconsole
123 check_for_zombie_jobs storage=File
124 stop_bacula
125
126 check_two_logs
127 check_restore_diff
128 end_test