osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38847?usp=email )
Change subject: testenv: respawn.sh: don't respawn on segfault ......................................................................
testenv: respawn.sh: don't respawn on segfault
Do not respawn the process if it segfaulted or aborted abnormally in another way (exit code >= 128).
Change-Id: I6f3f6218095643609a8b8869b57dde6b6bdb77a0 --- M _testenv/data/scripts/respawn.sh 1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/38847/1
diff --git a/_testenv/data/scripts/respawn.sh b/_testenv/data/scripts/respawn.sh index 3b079c7..1044c60 100755 --- a/_testenv/data/scripts/respawn.sh +++ b/_testenv/data/scripts/respawn.sh @@ -12,7 +12,12 @@ $* & LAST_PID=$! wait $LAST_PID - echo "respawn: $i: stopped pid $LAST_PID with status $?" + LAST_STATUS=$? + echo "respawn: $i: stopped pid $LAST_PID with status $LAST_STATUS" + if [ $LAST_STATUS -ge 128 ]; then + echo "respawn: process was terminated abnormally, not respawning" + exit 1 + fi if [ $SLEEP_BEFORE_RESPAWN -gt 0 ]; then echo "respawn: sleeping $SLEEP_BEFORE_RESPAWN seconds..." sleep $SLEEP_BEFORE_RESPAWN