<commit_before>#!/bin/sh

if which timeout >/dev/null 2>&1
then
    TO="timeout 120"
else
    TO=""
fi

$TO ./uts-server -c tests/cfg/uts-server.cnf -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

kill `cat ./uts-server.pid`

$TO ./uts-server -c tests/cfg/uts-server-ssl.cnf -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

kill `cat ./uts-server.pid`<commit_msg>few hacks to allow parallele execution<commit_after>#!/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"
else
    TO=""
fi

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:$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`

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:$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`
{'fraction_non_alphanumeric': 0.20739700374531836, 'fraction_numerical': 0.03277153558052434, 'mean_word_length': 2.843525179856115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '477580', 'n_tokens_mistral': 913, 'n_tokens_neox': 831, 'n_words': 232}