From f7f162a5dac39bf1b8300723672b49f60bde169b Mon Sep 17 00:00:00 2001 From: kakwa Date: Thu, 27 Apr 2017 23:12:35 +0200 Subject: [PATCH] few hacks to allow parallele execution --- tests/external_test.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tests/external_test.sh b/tests/external_test.sh index 54fd5b5..c8fbd3f 100755 --- a/tests/external_test.sh +++ b/tests/external_test.sh @@ -1,5 +1,7 @@ #!/bin/sh +PORT=`awk -v min=10000 -v max=20000 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'` + if which timeout >/dev/null 2>&1 then TO="timeout 120" @@ -7,20 +9,31 @@ else TO="" fi -$TO ./uts-server -c tests/cfg/uts-server.cnf -D -p ./uts-server.pid & +export TMPDIR='./tests/cfg/' +CFG=`mktemp` + +clean_clean_exit(){ + rm - $CFG + clean_exit $1 +} +sed "s/2020/$PORT/" tests/cfg/uts-server.cnf >$CFG + +$TO ./uts-server -c $CFG -D -p ./uts-server.pid & sleep 1 -./goodies/timestamp-file.sh -i README.rst -u http://localhost:2020 -r -O "-cert" || exit 1 -./goodies/timestamp-file.sh -i README.rst -u http://localhost:2020 -r -O "-cert" || exit 1 -./goodies/timestamp-file.sh -i README.rst -u http://localhost:2020 -r -O "-cert" || exit 1 +./goodies/timestamp-file.sh -i README.rst -u http://localhost:$PORT -r -O "-cert" || clean_exit 1 +./goodies/timestamp-file.sh -i README.rst -u http://localhost:$PORT -r -O "-cert" || clean_exit 1 +./goodies/timestamp-file.sh -i README.rst -u http://localhost:$PORT -r -O "-cert" || clean_exit 1 kill `cat ./uts-server.pid` -$TO ./uts-server -c tests/cfg/uts-server-ssl.cnf -D -p ./uts-server.pid & +sed "s/2020/$PORT/" tests/cfg/uts-server-ssl.cnf >$CFG + +$TO ./uts-server -c $CFG -D -p ./uts-server.pid & sleep 1 -./goodies/timestamp-file.sh -i README.rst -u https://localhost:2020 -r -O "-cert" -C '-k' || exit 1 -./goodies/timestamp-file.sh -i README.rst -u https://localhost:2020 -r -O "-cert" -C '-k' || exit 1 -./goodies/timestamp-file.sh -i README.rst -u https://localhost:2020 -r -O "-cert" -C '-k' || exit 1 +./goodies/timestamp-file.sh -i README.rst -u https://localhost:$PORT -r -O "-cert" -C '-k' || clean_exit 1 +./goodies/timestamp-file.sh -i README.rst -u https://localhost:$PORT -r -O "-cert" -C '-k' || clean_exit 1 +./goodies/timestamp-file.sh -i README.rst -u https://localhost:$PORT -r -O "-cert" -C '-k' || clean_exit 1 kill `cat ./uts-server.pid`