]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/dummy-test
Fix status alignment output reported by Wanderlei Huttel
[bacula/bacula] / regress / tests / dummy-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # This is a simple dummy test (copied from incremental-test), which
9 #   simply runs some jobs then does not clean up at the end.
10 #   This permits testing programs such as bconsole and bat with a little
11 #   bit of data.
12 #
13 TestName="dummy-test"
14 JobName=Incremental 
15 . scripts/functions
16
17 ${rscripts}/cleanup
18 ${rscripts}/copy-test-confs
19 echo "${tmpsrc}" >${tmp}/file-list
20 mkdir -p ${tmpsrc}
21 cp -p ${src}/src/dird/*.c ${tmpsrc}
22 cd ${tmp}
23 echo "${tmpsrc}/ficheriro1.txt" >restore-list
24 echo "${tmpsrc}/ficheriro2.txt" >>restore-list
25 cd ${cwd}
26
27 change_jobname CompressedTest $JobName
28 start_test
29
30 cat <<END_OF_DATA >${tmp}/bconcmds
31 @output /dev/null
32 messages
33 @$out ${tmp}/log1.out
34 @#setdebug level=100 storage=File
35 @#setdebug level=200 client
36 @#setdebug level=100 director
37 label storage=File volume=TestVolume001
38 label storage=File volume=TestVolume002
39 run job=$JobName yes
40 status client
41 wait
42 messages
43 quit
44 END_OF_DATA
45
46 run_bacula
47 check_for_zombie_jobs storage=File
48 #
49 # Now create two new files to be restored later
50 #
51 sleep 1
52 echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt
53 cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt
54
55 cat <<END_OF_DATA >${tmp}/bconcmds
56 @output /dev/null
57 messages
58 @$out ${tmp}/log1.out
59 @# Force Incremental on the second Volume
60 update volume=TestVolume001 VolStatus=Used
61 run level=Differential job=$JobName yes
62 wait
63 messages
64 quit
65 END_OF_DATA
66
67 run_bconsole
68
69 sleep 1
70 touch ${tmpsrc}/ficheriro1.txt
71 touch ${tmpsrc}/ficheriro2.txt
72
73 cat <<END_OF_DATA >${tmp}/bconcmds
74 @output /dev/null
75 messages
76 @$out ${tmp}/log1.out
77 run level=Incremental job=$JobName yes
78 wait
79 messages
80 quit
81 END_OF_DATA
82
83 run_bconsole
84
85 sleep 1
86 cd ${tmpsrc}
87 cp -f ficheriro2.txt 1
88 sed "s%a%b%g" 1 >ficheriro2.txt
89 rm -f 1
90 cd ${cwd}
91 cat <<END_OF_DATA >${tmp}/bconcmds
92 @output /dev/null
93 messages
94 @$out ${tmp}/log1.out
95 run level=Differential job=$JobName yes
96 wait
97 messages
98 quit
99 END_OF_DATA
100
101 run_bconsole
102
103 sleep 1
104 touch ${tmpsrc}/ficheriro1.txt
105 touch ${tmpsrc}/ficheriro2.txt
106 cat <<END_OF_DATA >${tmp}/bconcmds
107 @output /dev/null
108 messages
109 @$out ${tmp}/log1.out
110 run level=Incremental job=$JobName yes
111 wait
112 messages
113 quit
114 END_OF_DATA
115
116 run_bconsole
117
118 sleep 1
119 touch ${tmpsrc}/ficheriro1.txt
120 touch ${tmpsrc}/ficheriro2.txt
121 cat <<END_OF_DATA >${tmp}/bconcmds
122 @output /dev/null
123 messages
124 @$out ${tmp}/log1.out
125 run level=Incremental job=$JobName yes
126 wait
127 messages
128 quit
129 END_OF_DATA
130
131 run_bconsole
132
133 sleep 1
134 touch ${tmpsrc}/ficheriro1.txt
135 touch ${tmpsrc}/ficheriro2.txt
136 cat <<END_OF_DATA >${tmp}/bconcmds
137 @output /dev/null
138 messages
139 @$out ${tmp}/log1.out
140 run level=Incremental job=$JobName yes
141 wait
142 messages
143 quit
144 END_OF_DATA
145
146 run_bconsole
147 sleep 1
148 touch ${tmpsrc}/ficheriro1.txt
149 touch ${tmpsrc}/ficheriro2.txt
150
151 cat <<END_OF_DATA >${tmp}/bconcmds
152 @output /dev/null
153 messages
154 @$out ${tmp}/log1.out
155 setdebug level=200 storage=File
156 run level=Incremental job=$JobName yes
157 wait
158 messages
159 @# 
160 @# now do a restore
161 @#
162 @$out ${tmp}/log2.out
163 setdebug level=10 storage=File
164 restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list
165 yes
166 wait
167 status client
168 status storage=File
169 messages
170 quit
171 END_OF_DATA
172
173 run_bconsole
174 check_for_zombie_jobs storage=File
175
176 #
177 #  Stop early to leave everything defined, Bacula running, ...
178 #
179 exit
180
181
182 # The rest of this is not executed
183 stop_bacula
184
185 check_two_logs
186 #
187 # Delete .c files because we will only restored the txt files
188 #
189 rm -f ${tmpsrc}/*.c
190 check_restore_tmp_build_diff
191 end_test