Coin: VxWorks intel related instructions

Startup the correct emulator for each arch.

Add a health check for emulator during test start. If emulator
does not respond, restart it. Occurs in declarative tests where
tests hang and crash. After the crashes the pipes also need to be
reset, only emulator reset is not sufficient.

Read variables from WIND_CC_SYSROOT which is the VSB path, so
correct VSB is used.

Change-Id: If918ee45d4fa3a452c484a48fe9507f12f788e86
Reviewed-by: Simo Fält <simo.falt@qt.io>
This commit is contained in:
Toni Saario 2024-08-26 14:46:43 +03:00
parent f1d8cc0291
commit 6f6def28a7
2 changed files with 42 additions and 6 deletions

View File

@ -18,8 +18,22 @@ instructions:
maxTimeInSeconds: 60
maxTimeBetweenOutput: 60
userMessageOnFailure: "Failed to mkfifo"
- type: EnvironmentVariable
variableName: VXWORKS_EMULATOR_TYPE
variableValue: "arm"
enable_if:
condition: property
property: target.arch
equals_value: ARMV7
- type: EnvironmentVariable
variableName: VXWORKS_EMULATOR_TYPE
variableValue: "intel"
enable_if:
condition: property
property: target.arch
equals_value: X86_64
- type: ExecuteCommand
command: "{{.Env.HOME}}/vxworks_qemu_launcher.sh"
command: "{{.Env.HOME}}/vxworks_qemu_launcher.sh {{.Env.VXWORKS_EMULATOR_TYPE}}"
maxTimeInSeconds: 60
maxTimeBetweenOutput: 60
userMessageOnFailure: "Failed to start VxWorks emulator"
@ -43,11 +57,11 @@ instructions:
hosts["iptables.test-net.qt.local"]="172.31.1.1"
declare -A env_vars
env_vars["LD_LIBRARY_PATH"]=$VXWORKS_TEST_LIBS_PATH
env_vars["ICU_DATA"]="/opt/fsl_imx6_2_0_6_2_VSB/3pp/ICU/icu/source/data/in/icudt73l.dat"
env_vars["LD_LIBRARY_PATH"]="$VXWORKS_TEST_LIBS_PATH"
env_vars["ICU_DATA"]="$WIND_CC_SYSROOT/3pp/ICU/icu/source/data/in/icudt73l.dat"
env_vars["TMPDIR"]="/tmp"
env_vars["QT_QPA_FONTDIR"]="/opt/fsl_imx6_2_0_6_2_VSB/fonts"
env_vars["VXWORKS_CERTS_DIR"]="/opt/fsl_imx6_2_0_6_2_VSB/certs"
env_vars["QT_QPA_FONTDIR"]="$WIND_CC_SYSROOT/fonts"
env_vars["VXWORKS_CERTS_DIR"]="$WIND_CC_SYSROOT/certs"
env_vars["HOME"]="/home/qt/work/vxworkshome"
env_vars["QML_LOADERTHREAD_STACK_SIZE"]="131072"
env_vars["QTEST_FUNCTION_TIMEOUT"]="600000"

View File

@ -22,9 +22,31 @@ 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.out
read -t 1 testline</tmp/guest.out
if [[ -z "$testline" ]]; then
echo "Restarting stuck emulator"
pkill qemu-system
rm /tmp/guest.in /tmp/guest.out
mkfifo /tmp/guest.in /tmp/guest.out
/bin/bash /home/qt/vxworks_qemu_launcher.sh $VXWORKS_EMULATOR_TYPE
sleep 1
/bin/bash /home/qt/work/coin_vxworks_vars.sh
sleep 1
else
echo "Emulator responding"
fi
# Empty output
while read -t 1 line; do
echo $line
done < /tmp/guest.out
echo "cmd cd $testdir" > /tmp/guest.in
sleep 0.5
sleep 1
echo "</home/qt/work/vx.sh" > /tmp/guest.in
while read -t 600 line; do