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