function start_web() {
local service_logfile="${mode%\.test}_server.log"
- ./unittest_${1}.rb >> ${service_logfile} 2>&1 &
+ ./unittest_"${1}".rb >> "${service_logfile}" 2>&1 &
webrick_pid=$!
local timeout=0
while [ ${timeout} -lt 20 ]; do
- local res=$(curl http://localhost:62434/ping 2>/dev/null)
- if [ "x$res" == "xpong" ]; then
+ local res
+ res=$(curl http://localhost:62434/ping 2>/dev/null)
+ if [ "$res" == "pong" ]; then
# server is up and running
return 0
fi
sleep 1
- let timeout=timeout+1
+ (( timeout=timeout+1 ))
done
if kill -0 ${webrick_pid} 2>/dev/null; then
fi
sleep 1
- let timeout=timeout+1
+ (( timeout=timeout+1 ))
done
if kill -0 ${webrick_pid} 2>/dev/null; then
local service_logfile="${mode%\.test}_server.log"
- ./unittest_zeromq.rb >> ${service_logfile} 2>&1 &
+ ./unittest_zeromq.rb >> "${service_logfile}" 2>&1 &
zeromq_pid=$!
local timeout=0
fi
sleep 1
- let timeout=timeout+1
+ (( timeout=timeout+1 ))
done
if kill -0 ${zeromq_pid} 2>/dev/null; then
fi
sleep 1
- let timeout=timeout+1
+ (( timeout=timeout+1 ))
done
if kill -0 ${zeromq_pid} 2>/dev/null; then
}
function start_unix() {
- if [ -z "$socat" -o ! -x "$socat" ]; then
+ if [ -z "$socat" ] || [ ! -x "$socat" ]; then
echo "INFO: Skipping \"UNIX socket\" test because \"socat\" executable wasn't found!"
exit 77
fi
fi
sleep 1
- let timeout=timeout+1
+ (( timeout=timeout+1 ))
done
if kill -0 ${socat_pid} 2>/dev/null; then
fi
sleep 1
- let timeout=timeout+1
+ (( timeout=timeout+1 ))
done
if kill -0 ${socat_pid} 2>/dev/null; then
function run_test() {
if [ $new_api -eq 0 ]; then
- ./$mode
+ ./"$mode"
else
$orig
fi
}
-mode=`basename "$mode"`
+mode=$(basename "$mode")
case "$mode" in
remotebackend_pipe.test)