6 test -z "$tmpdir" && tmpdir
=/tmp
7 tmpf
="${tmpdir}/bnch$$"
8 nc
='./sh-tests/netcat.py'
13 # Allow generic tests to specify their own behavior completely.
14 test -x $commands && exec $commands
18 test -z "$bpid" ||
kill -9 $bpid
29 trap catch HUP INT QUIT TERM
31 if [ ! -x .
/beanstalkd
]; then
32 echo "Executable ./beanstalkd not found; do you need to compile first?"
36 .
/beanstalkd
-p $port >/dev
/null
2>/dev
/null
&
40 if ! ps
-p $bpid >/dev
/null
; then
41 echo "Could not start beanstalkd for testing, port $port is taken"
46 fgrep
-v "#" $commands |
$nc $server $port > "$tmpf"
49 diff $expected "$tmpf"