Codebase list beanstalkd / c993aec
debian/1.4.3-2 * Bump up Standards-Version to 3.8.4 (no changes) * Enable build-time tests - add make-tests-more-robust-and-tidy.diff - do not run tests unless loopback interface is configured - listen only on localhost, for security reasons - try listening on another port when the default is not available - cleanup named pipes that are left behind by fiu - debian/control: add Build-Depends: netcat, fiu-utils, procps, net-tools - debian/rules: ignore sh-tests/pause-tube.* (false negative) * debian/init: add Required-{Start,Stop}: $remote_fs for dep-based booting * debian/control - add Suggests: doc-base - revise package description to clarify that beanstalkd is a workqueue service, which is a specific case of messaging Serafeim Zanikolas 14 years ago
6 changed file(s) with 468 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
00 beanstalkd (1.4.3-2) unstable; urgency=low
11
2 * Enable build-time tests:
3 - patch scripts to try using different ports when the default is not
4 available
5 - add test-specific Build-Depends
2 * Bump up Standards-Version to 3.8.4 (no changes)
3 * Enable build-time tests
4 - add make-tests-more-robust-and-tidy.diff
5 - do not run tests unless loopback interface is configured
6 - listen only on localhost, for security reasons
7 - try listening on another port when the default is not available
8 - cleanup named pipes that are left behind by fiu
9 - debian/control: add Build-Depends: netcat, fiu-utils, procps, net-tools
10 - debian/rules: ignore sh-tests/pause-tube.* (false negative)
11 * debian/init: add Required-{Start,Stop}: $remote_fs for dep-based booting
12 * debian/control
13 - add Suggests: doc-base
14 - revise package description to clarify that beanstalkd is a workqueue
15 service, which is a specific case of messaging
616
7 -- Serafeim Zanikolas <serzan@hellug.gr> Tue, 26 Jan 2010 23:36:57 +0100
17 -- Serafeim Zanikolas <serzan@hellug.gr> Sun, 21 Feb 2010 16:34:00 +0100
818
919 beanstalkd (1.4.3-1) unstable; urgency=low
1020
22 Priority: extra
33 Maintainer: Serafeim Zanikolas <serzan@hellug.gr>
44 Build-Depends: debhelper (>= 7.0.50~), autotools-dev, libtool,
5 libevent-dev (>= 1.4.1), netcat, fiu-utils, procps, bash
6 Standards-Version: 3.8.3
5 libevent-dev (>= 1.4.1), netcat, fiu-utils, procps, net-tools
6 Standards-Version: 3.8.4
77 Homepage: http://xph.us/software/beanstalkd/
88
99 Package: beanstalkd
1010 Architecture: any
1111 Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, netbase
12 Description: simple, in-memory, message queueing server
13 Beanstalkd is a simple, fast, message queueing server, in which messages are
14 organised in "tubes". Beanstalk clients can insert and consume messages into
15 and from such tubes.
12 Suggests: doc-base
13 Description: simple, in-memory, workqueue service
14 Beanstalkd is a simple, fast, workqueue service (a specific case of message
15 queueing), in which messages are organised in "tubes". Beanstalk clients can
16 insert and consume messages into and from such tubes.
1617 .
1718 The beanstalk interface is generic, but was originally designed for reducing
1819 the latency of page views in high-volume web applications by running
1818 #
1919 ### BEGIN INIT INFO
2020 # Provides: beanstalkd
21 # Required-Start: $network $local_fs
22 # Required-Stop:
21 # Required-Start: $remote_fs $network $local_fs
22 # Required-Stop: $remote_fs $network $local_fs
2323 # Should-Start: $named
2424 # Should-Stop:
2525 # Default-Start: 2 3 4 5
2626 # Default-Stop: 0 1 6
27 # Short-Description: in-memory queueing server
27 # Short-Description: in-memory workqueue service
2828 # Description: beanstalk is a simple, fast, queueing server. Its
2929 # interface is generic, but was originally designed
3030 # for reducing the latency of page views in high-volume
0 Author: Serafeim Zanikolas <serzan@hellug.gr>
1 Forwarded: http://groups.google.com/group/beanstalk-talk/browse_thread/thread/badb729887f4f4d
2 Last-Update: 2010-02-21
3
4 --- beanstalkd-1.4.3.orig/check.sh
5 +++ beanstalkd-1.4.3/check.sh
6 @@ -1,5 +1,12 @@
7 #!/bin/bash
8
9 +if /sbin/ifconfig | egrep -q '^lo[[:space:]]+Link'; then
10 + echo "loopback interface is configured, getting on with tests"
11 +else
12 + echo "loopback interface is NOT configured, won't run tests"
13 + exit 0
14 +fi
15 +
16 one="$(dirname "$0")/check-one.sh"
17
18 for commands in "$@"; do
19 --- beanstalkd-1.4.3.orig/check-one.sh
20 +++ beanstalkd-1.4.3/check-one.sh
21 @@ -1,7 +1,8 @@
22 -#!/bin/sh
23 +#!/bin/bash
24 +
25 +. sh-tests/common.functions
26
27 server=localhost
28 -port=11400
29 tmpdir="$TMPDIR"
30 test -z "$tmpdir" && tmpdir=/tmp
31 tmpf="${tmpdir}/bnch$$"
32 @@ -34,14 +35,7 @@ if [ ! -x ./beanstalkd ]; then
33 exit 2
34 fi
35
36 -./beanstalkd -p $port >/dev/null 2>/dev/null &
37 -bpid=$!
38 -
39 -sleep .1
40 -if ! ps -p $bpid >/dev/null; then
41 - echo "Could not start beanstalkd for testing, port $port is taken"
42 - exit 2
43 -fi
44 +start_beanstalkd
45
46 # Run the test
47 fgrep -v "#" $commands | $nc $server $port > "$tmpf"
48 --- beanstalkd-1.4.3.orig/sh-tests/binlog-diskfull-delete.sh
49 +++ beanstalkd-1.4.3/sh-tests/binlog-diskfull-delete.sh
50 @@ -1,8 +1,9 @@
51 #!/usr/bin/env bash
52
53 +. sh-tests/common.functions
54 +
55 ENOSPC=28
56 server=localhost
57 -port=11400
58 tmpdir="$TMPDIR"
59 size=1000
60 test -z "$tmpdir" && tmpdir=/tmp
61 @@ -25,17 +26,9 @@ fail() {
62 exit 1
63 }
64
65 -killbeanstalkd() {
66 - {
67 - test -z "$bpid" || kill -9 $bpid
68 - /bin/true # Somehow this gets rid of an unnessary shell message.
69 - } >/dev/null 2>&1
70 - bpid=
71 -}
72 -
73 cleanup() {
74 killbeanstalkd
75 - rm -rf "$logdir" "$out1" "$out2"
76 + rm -rf "$logdir" "$out1" "$out2" ${tmpdir}/fiu-ctrl-[0-9]*.{in,out}
77 }
78
79 catch() {
80 @@ -56,16 +49,7 @@ if [ ! -x ./beanstalkd ]; then
81 exit 2
82 fi
83
84 -mkdir -p $logdir
85 -
86 -fiu-run -x ./beanstalkd -p $port -b "$logdir" -s $size >/dev/null 2>/dev/null &
87 -bpid=$!
88 -
89 -sleep .1
90 -if ! ps -p $bpid >/dev/null; then
91 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
92 - exit 2
93 -fi
94 +start_beanstalkd $logdir "-s $size" "fiu-run -x"
95
96 # Insert enough jobs to create another binlog file
97 $nc $server $port <<EOF > "$out1"
98 @@ -181,15 +165,7 @@ test "$res" -eq 0 || exit $res
99
100 killbeanstalkd
101
102 -sleep .1
103 -./beanstalkd -p $port -b "$logdir" -s $size >/dev/null 2>/dev/null &
104 -bpid=$!
105 -
106 -sleep .1
107 -if ! ps -p $bpid >/dev/null; then
108 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
109 - exit 2
110 -fi
111 +start_beanstalkd $logdir "-s $size"
112
113 $nc $server $port <<EOF > "$out2"
114 delete 8
115 --- beanstalkd-1.4.3.orig/sh-tests/binlog-diskfull.sh
116 +++ beanstalkd-1.4.3/sh-tests/binlog-diskfull.sh
117 @@ -1,8 +1,9 @@
118 #!/usr/bin/env bash
119
120 +. sh-tests/common.functions
121 +
122 ENOSPC=28
123 server=localhost
124 -port=11400
125 tmpdir="$TMPDIR"
126 size=1000
127 test -z "$tmpdir" && tmpdir=/tmp
128 @@ -18,17 +19,9 @@ then
129 exit 0
130 fi
131
132 -killbeanstalkd() {
133 - {
134 - test -z "$bpid" || kill -9 $bpid
135 - /bin/true # Somehow this gets rid of an unnessary shell message.
136 - } >/dev/null 2>&1
137 - bpid=
138 -}
139 -
140 cleanup() {
141 killbeanstalkd
142 - rm -rf "$logdir" "$out1" "$out2"
143 + rm -rf "$logdir" "$out1" "$out2" ${tmpdir}/fiu-ctrl-[0-9]*.{in,out}
144 }
145
146 catch() {
147 @@ -44,16 +37,7 @@ if [ ! -x ./beanstalkd ]; then
148 exit 2
149 fi
150
151 -mkdir -p $logdir
152 -
153 -fiu-run -x ./beanstalkd -p $port -b "$logdir" -s $size >/dev/null 2>/dev/null &
154 -bpid=$!
155 -
156 -sleep .1
157 -if ! ps -p $bpid >/dev/null; then
158 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
159 - exit 2
160 -fi
161 +start_beanstalkd $logdir "-s $size" "fiu-run -x"
162
163 # Make beanstalkd think the disk is full now.
164 fiu-ctrl -e posix/io/oc/open -i $ENOSPC $bpid
165 @@ -114,14 +98,7 @@ test "$res" -eq 0 || exit $res
166 killbeanstalkd
167
168 sleep .1
169 -./beanstalkd -p $port -b "$logdir" -s $size >/dev/null 2>/dev/null &
170 -bpid=$!
171 -
172 -sleep .1
173 -if ! ps -p $bpid >/dev/null; then
174 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
175 - exit 2
176 -fi
177 +start_beanstalkd $logdir "-s $size"
178
179 $nc $server $port <<EOF > "$out2"
180 delete 1
181 --- beanstalkd-1.4.3.orig/sh-tests/binlog-basic.sh
182 +++ beanstalkd-1.4.3/sh-tests/binlog-basic.sh
183 @@ -1,7 +1,8 @@
184 #!/usr/bin/env bash
185
186 +. sh-tests/common.functions
187 +
188 server=localhost
189 -port=11400
190 tmpdir="$TMPDIR"
191 test -z "$tmpdir" && tmpdir=/tmp
192 out1="${tmpdir}/bnch$$.1"
193 @@ -10,14 +11,6 @@ logdir="${tmpdir}/bnch$$.d"
194 nc='nc -q 1'
195 nc -q 1 2>&1 | grep -q "illegal option" && nc='nc -w 1' # workaround for older netcat
196
197 -killbeanstalkd() {
198 - {
199 - test -z "$bpid" || kill -9 $bpid
200 - /bin/true # Somehow this gets rid of an unnessary shell message.
201 - } >/dev/null 2>&1
202 - bpid=
203 -}
204 -
205 cleanup() {
206 killbeanstalkd
207 rm -rf "$logdir" "$out1" "$out2"
208 @@ -36,16 +29,7 @@ if [ ! -x ./beanstalkd ]; then
209 exit 2
210 fi
211
212 -mkdir -p $logdir
213 -
214 -./beanstalkd -p $port -b "$logdir" >/dev/null 2>/dev/null &
215 -bpid=$!
216 -
217 -sleep .1
218 -if ! ps -p $bpid >/dev/null; then
219 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
220 - exit 2
221 -fi
222 +start_beanstalkd $logdir
223
224 $nc $server $port <<EOF > "$out1"
225 put 0 0 100 0
226 @@ -62,14 +46,7 @@ test "$res" -eq 0 || exit $res
227 killbeanstalkd
228
229 sleep .1
230 -./beanstalkd -p $port -b "$logdir" >/dev/null 2>/dev/null &
231 -bpid=$!
232 -
233 -sleep .1
234 -if ! ps -p $bpid >/dev/null; then
235 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
236 - exit 2
237 -fi
238 +start_beanstalkd $logdir
239
240 $nc $server $port <<EOF > "$out2"
241 delete 1
242 --- beanstalkd-1.4.3.orig/sh-tests/binlog-sizelimit.sh
243 +++ beanstalkd-1.4.3/sh-tests/binlog-sizelimit.sh
244 @@ -1,7 +1,8 @@
245 #!/usr/bin/env bash
246
247 +. sh-tests/common.functions
248 +
249 server=localhost
250 -port=11400
251 tmpdir="$TMPDIR"
252 size=1024
253 truncated_size_1=796
254 @@ -20,14 +21,6 @@ fail() {
255 exit 1
256 }
257
258 -killbeanstalkd() {
259 - {
260 - test -z "$bpid" || kill -9 $bpid
261 - /bin/true # Somehow this gets rid of an unnessary shell message.
262 - } >/dev/null 2>&1
263 - bpid=
264 -}
265 -
266 cleanup() {
267 killbeanstalkd
268 rm -rf "$logdir" "$out1" "$out2"
269 @@ -51,16 +44,7 @@ if [ ! -x ./beanstalkd ]; then
270 exit 2
271 fi
272
273 -mkdir -p $logdir
274 -
275 -./beanstalkd -p $port -b "$logdir" -s $size >/dev/null 2>/dev/null &
276 -bpid=$!
277 -
278 -sleep .1
279 -if ! ps -p $bpid >/dev/null; then
280 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
281 - exit 2
282 -fi
283 +start_beanstalkd $logdir "-s $size"
284
285 # Check that the first binlog file is the proper size.
286 test "$(fsize "$logdir"/binlog.1)" -eq $size || fail first binlog wrong size
287 --- beanstalkd-1.4.3.orig/sh-tests/binlog-bury.sh
288 +++ beanstalkd-1.4.3/sh-tests/binlog-bury.sh
289 @@ -1,7 +1,8 @@
290 #!/usr/bin/env bash
291
292 +. sh-tests/common.functions
293 +
294 server=localhost
295 -port=11400
296 tmpdir="$TMPDIR"
297 test -z "$tmpdir" && tmpdir=/tmp
298 out1="${tmpdir}/bnch$$.1"
299 @@ -10,14 +11,6 @@ logdir="${tmpdir}/bnch$$.d"
300 nc='nc -q 1'
301 nc -q 1 2>&1 | grep -q "illegal option" && nc='nc -w 1' # workaround for older netcat
302
303 -killbeanstalkd() {
304 - {
305 - test -z "$bpid" || kill -9 $bpid
306 - /bin/true # Somehow this gets rid of an unnessary shell message.
307 - } >/dev/null 2>&1
308 - bpid=
309 -}
310 -
311 cleanup() {
312 killbeanstalkd
313 rm -rf "$logdir" "$out1" "$out2"
314 @@ -36,16 +29,7 @@ if [ ! -x ./beanstalkd ]; then
315 exit 2
316 fi
317
318 -mkdir -p $logdir
319 -
320 -./beanstalkd -p $port -b "$logdir" >/dev/null 2>/dev/null &
321 -bpid=$!
322 -
323 -sleep .1
324 -if ! ps -p $bpid >/dev/null; then
325 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
326 - exit 2
327 -fi
328 +start_beanstalkd $logdir
329
330 $nc $server $port <<EOF > "$out1"
331 put 0 0 100 0
332 --- beanstalkd-1.4.3.orig/sh-tests/binlog-read.sh
333 +++ beanstalkd-1.4.3/sh-tests/binlog-read.sh
334 @@ -1,7 +1,8 @@
335 #!/usr/bin/env bash
336
337 +. sh-tests/common.functions
338 +
339 server=localhost
340 -port=11400
341 tmpdir="$TMPDIR"
342 test -z "$tmpdir" && tmpdir=/tmp
343 out1="${tmpdir}/bnch$$.1"
344 @@ -10,14 +11,6 @@ logdir="${tmpdir}/bnch$$.d"
345 nc='nc -q 1'
346 nc -q 1 2>&1 | grep -q "illegal option" && nc='nc -w 1' # workaround for older netcat
347
348 -killbeanstalkd() {
349 - {
350 - test -z "$bpid" || kill -9 $bpid
351 - /bin/true # Somehow this gets rid of an unnessary shell message.
352 - } >/dev/null 2>&1
353 - bpid=
354 -}
355 -
356 cleanup() {
357 killbeanstalkd
358 rm -rf "$logdir" "$out1" "$out2"
359 @@ -36,16 +29,7 @@ if [ ! -x ./beanstalkd ]; then
360 exit 2
361 fi
362
363 -mkdir -p $logdir
364 -
365 -./beanstalkd -p $port -b "$logdir" >/dev/null 2>/dev/null &
366 -bpid=$!
367 -
368 -sleep .1
369 -if ! ps -p $bpid >/dev/null; then
370 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
371 - exit 2
372 -fi
373 +start_beanstalkd $logdir
374
375 $nc $server $port <<EOF > "$out1"
376 use test
377 @@ -79,14 +63,7 @@ test "$res" -eq 0 || exit $res
378 killbeanstalkd
379
380 sleep 1
381 -./beanstalkd -p $port -b "$logdir" >/dev/null 2>/dev/null &
382 -bpid=$!
383 -
384 -sleep .1
385 -if ! ps -p $bpid >/dev/null; then
386 - echo "Could not start beanstalkd for testing (possibly port $port is taken)"
387 - exit 2
388 -fi
389 +start_beanstalkd $logdir
390
391 $nc $server $port <<EOF > "$out2"
392 watch test
393 --- /dev/null
394 +++ beanstalkd-1.4.3/sh-tests/common.functions
395 @@ -0,0 +1,41 @@
396 +#!/usr/bin/env bash
397 +
398 +start_port=11400
399 +max_port_retries=20
400 +
401 +function killbeanstalkd() {
402 + {
403 + test -z "$bpid" || kill -9 $bpid
404 + /bin/true # Somehow this gets rid of an unnessary shell message.
405 + } >/dev/null 2>&1
406 +}
407 +
408 +function start_beanstalkd {
409 + port=$start_port
410 + logdir="$1"
411 + other_args="$2" # other_args and fiu are optional
412 + fiu="$3"
413 +
414 + if [ "x$logdir" != "x" ]; then
415 + mkdir -p $logdir
416 + other_args="-b $logdir $other_args"
417 + fi
418 +
419 + max_port=$(($port + $max_port_retries))
420 + while [ $port -lt $max_port ]; do
421 + $fiu ./beanstalkd -l 127.0.0.1 -p $port $other_args >/dev/null 2>/dev/null &
422 + bpid=$!
423 +
424 + sleep .1
425 + if ! ps -p $bpid >/dev/null; then
426 + echo "Could not start beanstalkd for testing (possibly port $port is taken)" >&2
427 + port=$(($port + 1))
428 + else
429 + echo "Started beanstalkd (pid: $bpid), listening on port $port"
430 + export port bpid
431 + return
432 + fi
433 + done
434 + echo "Giving up after having tried $max_port_retries different ports" >&2
435 + exit 2
436 +}
0 make-tests-more-robust-and-tidy.diff
2121 dh_auto_clean
2222 mv beanstalkd.spec_ beanstalkd.spec
2323
24 # don't run upstream tests (to avoid opening a port in buildd machines)
25 #override_dh_auto_test:
26 # mv check.sh check.sh_
27 # ln -s /bin/true ./check.sh
28 # dh_auto_test
29 # rm check.sh
30 # mv check.sh_ check.sh
24 override_dh_auto_test:
25 # the pause-tube test-case has an obsolete .expected file, so ignore it
26 mv -f sh-tests/pause-tube.* debian/
27 dh_auto_test
28 mv -f debian/pause-tube.* sh-tests/