]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-jobs-tape
ebl tweak regress scripts to be able to change binary location
[bacula/bacula] / regress / tests / four-jobs-tape
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-tape"
8 JobName=fourjobstape
9 . scripts/functions
10
11 require_tape_drive
12
13 scripts/cleanup-tape
14 scripts/copy-tape-confs
15 echo "${cwd}/build" >${cwd}/tmp/file-list
16
17 change_jobname $JobName
18 start_test
19
20 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
21 @$out /dev/null
22 estimate job=$JobName listing
23 estimate job=$JobName
24 estimate job=$JobName
25 messages
26 @$out ${cwd}/tmp/log1.out
27 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
28 run job=$JobName yes
29 wait
30 messages
31 quit
32 END_OF_DATA
33
34 run_bacula
35
36 scripts/check_for_zombie_jobs storage=DDS-4
37 echo "Backup 1 done"
38 # make some files for the incremental to pick up
39 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
40 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
41    
42 #
43 # run a second job
44 #
45 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
46 @$out /dev/null
47 messages
48 @$out ${cwd}/tmp/log1.out
49 run job=$JobName level=Incremental yes
50 wait
51 messages
52 quit
53 END_OF_DATA
54
55 run_bacula
56
57 scripts/check_for_zombie_jobs storage=DDS-4
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 >${cwd}/tmp/bconcmds
65 @$out /dev/null
66 messages
67 @$out ${cwd}/tmp/log1.out
68 run job=$JobName level=Incremental yes
69 wait
70 messages
71 quit
72 END_OF_DATA
73 run_bacula
74
75 scripts/check_for_zombie_jobs storage=DDS-4
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 >${cwd}/tmp/bconcmds
83 @$out /dev/null
84 messages
85 @$out ${cwd}/tmp/log1.out
86 run job=$JobName level=Incremental yes
87 wait
88 messages
89 quit
90 END_OF_DATA
91 run_bacula
92
93 scripts/check_for_zombie_jobs storage=DDS-4
94 echo "Backup 4 done"
95
96 # now do several restores to ensure we cleanup between jobs
97 #
98 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
99 @$out /dev/null
100 restore where=${cwd}/tmp/bacula-restores select all done
101 yes
102 wait
103 restore where=${cwd}/tmp/bacula-restores select all done
104 yes
105 wait
106 @$out ${cwd}/tmp/log2.out
107 @#
108 @# now unmount the tape and start two restores
109 @#  at the same time
110 @#
111 unmount storage=DDS-4
112 restore where=${cwd}/tmp/bacula-restores select all done
113 yes
114 restore where=${cwd}/tmp/bacula-restores select
115 unmark *
116 mark *
117 done
118 yes
119 mount storage=DDS-4
120 wait
121 messages
122 @$out
123 quit
124 END_OF_DATA
125
126 run_bacula
127 check_for_zombie_jobs storage=DDS-4
128 stop_bacula
129
130 check_two_logs
131 check_restore_diff
132 end_test