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