]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-jobs-test
Delete unwanted subdirectory
[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" >/tmp/file-list
14
15 change_jobname CompressedTest $JobName
16 start_test
17
18 cat <<END_OF_DATA >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 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 >tmp/bconcmds
43 @output /dev/null
44 messages
45 @$out  tmp/log1.out
46 run job=$JobName
47 yes
48 wait
49 messages
50 quit
51 END_OF_DATA
52
53 run_bconsole
54 check_for_zombie_jobs storage=File
55
56 echo "Backup 2 done"
57 touch ${cwd}/build/src/dird/*.c
58 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
59 #
60 # run a third job
61 #
62 cat <<END_OF_DATA >tmp/bconcmds
63 @output /dev/null
64 messages
65 @output tmp/log1.out
66 label storage=File volume=TestVolume001
67 run job=$JobName yes
68 wait
69 messages
70 quit
71 END_OF_DATA
72
73 run_bconsole
74 check_for_zombie_jobs storage=File
75
76 echo "Backup 3 done"
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 >tmp/bconcmds
83 @output /dev/null
84 messages
85 @output tmp/log1.out
86 label storage=File volume=TestVolume001
87 run job=$JobName yes
88 wait
89 messages
90 quit
91 END_OF_DATA
92
93 run_bconsole
94 check_for_zombie_jobs storage=File
95
96 echo "Backup 4 done"
97
98 # now do several restores to ensure we cleanup between jobs
99 #
100 cat <<END_OF_DATA >tmp/bconcmds
101 @output /dev/null
102 restore where=${cwd}/tmp/bacula-restores select all storage=File done
103 yes
104 wait
105 restore where=${cwd}/tmp/bacula-restores select all storage=File done
106 yes
107 wait
108 @$out tmp/log2.out
109 restore where=${cwd}/tmp/bacula-restores select storage=File
110 unmark *
111 mark *
112 done
113 yes
114 wait
115 messages
116 @output
117 quit
118 END_OF_DATA
119
120 run_bconsole
121 check_for_zombie_jobs storage=File
122 stop_bacula
123
124 check_two_logs
125 check_restore_diff
126 end_test