From 918cbe7601b07fa6db7973ff9a4f76208dae8f22 Mon Sep 17 00:00:00 2001 From: Toni Saario Date: Fri, 20 Dec 2024 16:13:02 +0200 Subject: [PATCH] Coin: Tweak VxWorks testrunner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add crash handling to avoid waiting until 10min timeout on each crash. Force restart on each crash by killing emulator. Make health check more robust to allow it to work even when emulator is down. This is done via wait in separate process which cannot be done with normal timeout command, as input to pipe that is not being read by emulator will block forever. Pick-to: 6.9 Change-Id: I86c3c86f936cc96d57b38983da48d1d73162399d Reviewed-by: Simo Fält --- coin/instructions/vxworks_testrunner.yaml | 26 +++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/coin/instructions/vxworks_testrunner.yaml b/coin/instructions/vxworks_testrunner.yaml index 9a52520065c..2d1b29291f3 100644 --- a/coin/instructions/vxworks_testrunner.yaml +++ b/coin/instructions/vxworks_testrunner.yaml @@ -22,11 +22,17 @@ instructions: # qtest_in_vxworks_complete echo is used to detect test process completion as it will # be echoed after test process ends normally or crashes when normal log lines are not present. + # Check that emulator is functioning - echo "cmd echo \"health check\"" > /tmp/guest.in - sleep 0.5 - read -t 5 echoline /tmp/guest.in ) & pid=$! + ( sleep 5 && kill -HUP $pid ) 2>/dev/null & watcher=$! + wait $pid 2>/dev/null && pkill -HUP -P $watcher + + if [[ "$?" -eq "0" ]]; then + read -t 5 echoline