[Fix] Close ncat server when error occurs to prevent uninterrupted test

This commit is contained in:
samuel 2023-04-25 15:09:32 +02:00
parent 97a93d2af3
commit 30d6b61e52
1 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,12 @@ send_request() (
ncat --listen --unixsock "${deployer_sock}" & ncat --listen --unixsock "${deployer_sock}" &
"${runner_bin}" --conf="${conf_file}" --errs="${errs_file}" \ "${runner_bin}" --conf="${conf_file}" --errs="${errs_file}" \
--daemon --stop --verbose || return $? --daemon --stop --verbose
code=$?
if [ "${code}" -ne 0 ]; then
echo "fail" | ncat --unixsock "${deployer_sock}"
return "${code}"
fi
( (
inotifywait --quiet --quiet --event create "${response_sock_dir}" inotifywait --quiet --quiet --event create "${response_sock_dir}"
echo "${request}" | ncat --unixsock "${runner_sock}" echo "${request}" | ncat --unixsock "${runner_sock}"