fix netcat-openbsd compatibility
1 parent 923285d commit 160967254a75beeaa0ff3f15e639e7e951e10d1d
@Martin Nowak Martin Nowak authored on 27 Jan 2018
Showing 1 changed file
View
4
test/timeout.sh
die 'Fetching from unconnectable registry should fail immediately.'
fi
 
log ' Testing non-responding registry'
cat | nc --listen $PORT >/dev/null &
cat | nc -l $PORT >/dev/null &
PID=$!
if timeout 10s $DUB fetch dub --skip-registry=all --registry=http://localhost:$PORT; then
die 'Fetching from non-responding registry should fail.'
elif [ $? -eq 124 ]; then
for i in $(seq 0 $((${#res} - 1))); do
echo -n "${res:$i:1}"
sleep 1
done
} | nc --listen $PORT >/dev/null &
} | nc -l $PORT >/dev/null &
PID=$!
if timeout 10s time $DUB fetch dub --skip-registry=all --registry=http://localhost:$PORT; then
die 'Fetching from too slow registry should fail.'
elif [ $? -eq 124 ]; then