6 test -z "$tmpdir" && tmpdir
=/tmp
7 tmpf
="${tmpdir}/bnch$$"
9 nc
-q 1 2>&1 |
grep -q option
&& nc
='nc -w 1' # workaround for older netcat
14 # Allow generic tests to specify their own behavior completely.
15 test -x $commands && exec $commands
19 test -z "$bpid" ||
kill -9 $bpid
30 trap catch HUP INT QUIT TERM
32 if [ ! -x .
/beanstalkd
]; then
33 echo "Executable ./beanstalkd not found; do you need to compile first?"
37 .
/beanstalkd
-p $port >/dev
/null
2>/dev
/null
&
41 if ! ps
-p $bpid >/dev
/null
; then
42 echo "Could not start beanstalkd for testing, port $port is taken"
47 fgrep
-v "#" $commands |
$nc $server $port > "$tmpf"
50 diff $expected "$tmpf"