Coin: Add vxworks test instructions
Adds testrunner and emulator start for VxWorks. Change-Id: I4ae63fb2019ff154d65b5b136f0c681e36db9e79 Reviewed-by: Simo Fält <simo.falt@qt.io>
This commit is contained in:
parent
092b3a0ff9
commit
80bbbe542f
@ -23,6 +23,13 @@ instructions:
|
||||
condition: property
|
||||
property: target.osVersion
|
||||
in_values: [QNX_710]
|
||||
- type: AppendToEnvironmentVariable
|
||||
variableName: TESTRUNNER
|
||||
variableValue: " {{.AgentWorkingDir}}/coin_vxworks_qemu_runner.sh"
|
||||
enable_if:
|
||||
condition: property
|
||||
property: target.osVersion
|
||||
in_values: [VxWorks]
|
||||
- type: Group
|
||||
enable_if:
|
||||
condition: property
|
||||
@ -52,6 +59,8 @@ instructions:
|
||||
property: host.os
|
||||
equals_value: Windows
|
||||
|
||||
- !include "{{qt/qtbase}}/vxworks_test_env_setup.yaml"
|
||||
|
||||
# Keep the testrun quiet for ASAN testruns, since there are FAILs happening all over the place...
|
||||
- type: EnvironmentVariable
|
||||
variableName: CTEST_ARGS
|
||||
@ -117,7 +126,7 @@ instructions:
|
||||
command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}"
|
||||
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 10800
|
||||
maxTimeInSeconds: 14400
|
||||
maxTimeBetweenOutput: "{{.Env.COIN_COMMAND_OUTPUT_TIMEOUT}}"
|
||||
userMessageOnFailure: >
|
||||
Failed to run tests.
|
||||
@ -131,7 +140,7 @@ instructions:
|
||||
command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}"
|
||||
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
|
||||
ignoreExitCode: true
|
||||
maxTimeInSeconds: 10800
|
||||
maxTimeInSeconds: 14400
|
||||
maxTimeBetweenOutput: "{{.Env.COIN_COMMAND_OUTPUT_TIMEOUT}}"
|
||||
userMessageOnFailure: >
|
||||
Failed to run tests.
|
||||
|
@ -45,3 +45,15 @@ instructions:
|
||||
- condition: property
|
||||
property: features
|
||||
not_contains_value: DisableTests
|
||||
- type: Group
|
||||
instructions:
|
||||
- !include "{{qt/qtbase}}/vxworks_testrunner.yaml"
|
||||
enable_if:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: property
|
||||
property: target.osVersion
|
||||
equals_value: VxWorks
|
||||
- condition: property
|
||||
property: features
|
||||
not_contains_value: DisableTests
|
||||
|
85
coin/instructions/vxworks_test_env_setup.yaml
Normal file
85
coin/instructions/vxworks_test_env_setup.yaml
Normal file
@ -0,0 +1,85 @@
|
||||
type: Group
|
||||
instructions:
|
||||
# Allows access from NFS export.
|
||||
- type: ExecuteCommand
|
||||
command: "chmod -R 777 {{.AgentWorkingDir}}"
|
||||
maxTimeInSeconds: 60
|
||||
maxTimeBetweenOutput: 60
|
||||
userMessageOnFailure: "Failed to set dir permissions"
|
||||
- type: MakeDirectory
|
||||
directory: "{{.AgentWorkingDir}}/vxworkshome"
|
||||
- type: ExecuteCommand
|
||||
command: "sudo chown 2001:100 {{.AgentWorkingDir}}/vxworkshome"
|
||||
maxTimeInSeconds: 60
|
||||
maxTimeBetweenOutput: 60
|
||||
userMessageOnFailure: "Failed to vxworks home ownership"
|
||||
- type: ExecuteCommand
|
||||
command: "mkfifo /tmp/guest.in /tmp/guest.out"
|
||||
maxTimeInSeconds: 60
|
||||
maxTimeBetweenOutput: 60
|
||||
userMessageOnFailure: "Failed to mkfifo"
|
||||
- type: ExecuteCommand
|
||||
command: "{{.Env.HOME}}/vxworks_qemu_launcher.sh"
|
||||
maxTimeInSeconds: 60
|
||||
maxTimeBetweenOutput: 60
|
||||
userMessageOnFailure: "Failed to start VxWorks emulator"
|
||||
- type: WriteFile
|
||||
filename: "{{.AgentWorkingDir}}/coin_vxworks_vars.sh"
|
||||
fileMode: 493
|
||||
fileContents: |
|
||||
#!/bin/bash
|
||||
sleep 10
|
||||
declare -A hosts
|
||||
hosts["qt-test-server"]="172.31.1.1"
|
||||
hosts["qt-test-server.qt-test-net"]="172.31.1.1"
|
||||
hosts["qt-test-server.test-net.qt.local"]="172.31.1.1"
|
||||
hosts["vsftpd.test-net.qt.local"]="172.31.1.1"
|
||||
hosts["apache2.test-net.qt.local"]="172.31.1.1"
|
||||
hosts["squid.test-net.qt.local"]="172.31.1.1"
|
||||
hosts["danted.test-net.qt.local"]="172.31.1.1"
|
||||
hosts["ftp-proxy.test-net.qt.local"]="172.31.1.1"
|
||||
hosts["echo.test-net.qt.local"]="172.31.1.1"
|
||||
hosts["cyrus.test-net.qt.local"]="172.31.1.1"
|
||||
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["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["HOME"]="/home/qt/work/vxworkshome"
|
||||
env_vars["QML_LOADERTHREAD_STACK_SIZE"]="131072"
|
||||
env_vars["QTEST_FUNCTION_TIMEOUT"]="600000"
|
||||
env_vars["QT_PLUGIN_PATH"]="/home/qt/work/install/target/plugins"
|
||||
env_vars["QT_QPA_PLATFORM_PLUGIN_PATH"]="/home/qt/work/install/target/plugins/platforms"
|
||||
|
||||
for i in "${!hosts[@]}"
|
||||
do
|
||||
echo "hostAdd \"$i\", \"${hosts[$i]}\"" > /tmp/guest.in
|
||||
sleep 1
|
||||
done
|
||||
|
||||
for i in "${!env_vars[@]}"
|
||||
do
|
||||
echo "cmd setenv \"$i\" \"${env_vars[$i]}\"" > /tmp/guest.in
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "cmd sysvar set -o ipdnsc.primaryns \"10.150.153.13\"" > /tmp/guest.in
|
||||
sleep 1
|
||||
|
||||
date=($(date "+%Y-%m-%d %H:%M:%S"))
|
||||
echo "cmd date ${date[0]}" > /tmp/guest.in
|
||||
sleep 1
|
||||
echo "cmd time ${date[1]}" > /tmp/guest.in
|
||||
|
||||
- type: ExecuteCommand
|
||||
command: "{{.AgentWorkingDir}}/coin_vxworks_vars.sh"
|
||||
maxTimeInSeconds: 600
|
||||
maxTimeBetweenOutput: 600
|
||||
userMessageOnFailure: "Failed to run coin_vxworks_vars.sh after having started the emulator"
|
||||
enable_if:
|
||||
condition: property
|
||||
property: target.osVersion
|
||||
equals_value: VxWorks
|
39
coin/instructions/vxworks_testrunner.yaml
Normal file
39
coin/instructions/vxworks_testrunner.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
type: Group
|
||||
instructions:
|
||||
- type: WriteFile
|
||||
filename: "{{.AgentWorkingDir}}/coin_vxworks_qemu_runner.sh"
|
||||
fileMode: 493
|
||||
fileContents: |
|
||||
#!/bin/bash
|
||||
quoted_args=`python3 -c 'import sys, shlex; print(shlex.join(sys.argv[2:]))' "$@"`
|
||||
|
||||
testdir="$(dirname $1)"
|
||||
testexecutable="$1"
|
||||
echo RUNNING via serial: "$quoted_args"
|
||||
echo "cmd rtp exec -p 200 -t 0x01000000 -u 300000 $testexecutable -- $quoted_args" > /home/qt/work/vx.sh
|
||||
echo "cmd echo \"qtest_in_vxworks_complete: $?\"" >> /home/qt/work/vx.sh
|
||||
#rtp exec Execute a process.
|
||||
# -p : specify the initial task priority
|
||||
# 200 is high, 255 max
|
||||
# -t : task options for the RTPs initial task
|
||||
# 0x01000000 turn on coprocessor
|
||||
# -u : specify the size of the process task stack
|
||||
# -- : mark the end of "rtp exec" options.
|
||||
|
||||
# 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.
|
||||
|
||||
echo "cmd cd $testdir" > /tmp/guest.in
|
||||
sleep 0.5
|
||||
echo "</home/qt/work/vx.sh" > /tmp/guest.in
|
||||
|
||||
while read -t 600 line; do
|
||||
echo "$line"
|
||||
if echo "$line" | /usr/bin/grep -q "qtest_in_vxworks_complete"
|
||||
then
|
||||
read -t 1 line</tmp/guest.out
|
||||
echo "$line"
|
||||
exitcode=$(echo "$line" | sed -nr 's/qtest_in_vxworks_complete: (-?[0-9]+)/\1/gp' | tr -d '\r')
|
||||
exit $exitcode
|
||||
fi
|
||||
done < /tmp/guest.out
|
Loading…
x
Reference in New Issue
Block a user