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