From af082deb40273c0019ceefa147bcf3d29be7aac2 Mon Sep 17 00:00:00 2001 From: Toni Saario Date: Thu, 23 Nov 2023 13:00:08 +0200 Subject: [PATCH] Enable tests for VxWorks target Updates VSB and VIP. Adds newer updated QEMU for VxWorks. Set to build and run tests on qtbase. Change-Id: I1dc97a48ff67dedd79de3659d2af2768616c61ca Reviewed-by: Matti Paaso --- ...make_platforms_qemu_vxworks_buildtest.yaml | 4 +-- .../cmake_platforms_qemu_vxworks_tests.yaml | 16 +++++++++ coin/platform_configs/nightly_vxworks.yaml | 11 ------- coin/platform_configs/qtbase.yaml | 2 ++ .../common/linux/install-vxworks-qemu.sh | 28 ++++++++++++++++ coin/provisioning/common/linux/vx_works.sh | 33 +++++++++++++------ .../common/linux/vxworks_qemu_launcher.sh | 8 ++--- .../60-install-vxworks-qemu.sh | 7 ++++ 8 files changed, 82 insertions(+), 27 deletions(-) create mode 100644 coin/platform_configs/cmake_platforms_qemu_vxworks_tests.yaml delete mode 100644 coin/platform_configs/nightly_vxworks.yaml create mode 100755 coin/provisioning/common/linux/install-vxworks-qemu.sh create mode 100755 coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/60-install-vxworks-qemu.sh diff --git a/coin/platform_configs/cmake_platforms_qemu_vxworks_buildtest.yaml b/coin/platform_configs/cmake_platforms_qemu_vxworks_buildtest.yaml index 9fe75020..c52c719f 100644 --- a/coin/platform_configs/cmake_platforms_qemu_vxworks_buildtest.yaml +++ b/coin/platform_configs/cmake_platforms_qemu_vxworks_buildtest.yaml @@ -8,8 +8,8 @@ Configurations: Compiler: 'Clang' Target compiler: 'Clang' Platform dependency: 'ubuntu-22.04' - Features: ['VMSize8', 'UseConfigure', 'DoNotRunTests', 'DoNotUploadTests'] + Features: ['UseConfigure', 'DoNotRunTests', 'DoNotUploadTests'] Environment variables: [ - 'TARGET_CONFIGURE_ARGS=-release -developer-build -force-debug-info -qpa eglfs -nomake examples', + 'TARGET_CONFIGURE_ARGS=-release -developer-build -force-debug-info -qpa offscreen -nomake examples', 'TARGET_CMAKE_ARGS=-DBUILD_SHARED_LIBS=OFF -DWARNINGS_ARE_ERRORS=OFF -DCMAKE_TOOLCHAIN_FILE="{{.Env.WIND_CC_SYSROOT}}/mk/rtp.toolchain.cmake" -DFEATURE_vulkan=OFF -DQT_QMAKE_TARGET_MKSPEC=vxworks-clang -DQT_HOST_PATH=/home/qt/work/install -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_STAGING_PREFIX:PATH=/home/qt/work/install/target' ] diff --git a/coin/platform_configs/cmake_platforms_qemu_vxworks_tests.yaml b/coin/platform_configs/cmake_platforms_qemu_vxworks_tests.yaml new file mode 100644 index 00000000..fd26b70e --- /dev/null +++ b/coin/platform_configs/cmake_platforms_qemu_vxworks_tests.yaml @@ -0,0 +1,16 @@ +Version: 2 +Configurations: +- + Id: 'vxworks-imx6-tests' + Template: 'qtci-linux-Ubuntu-22.04-x86_64-51' + Target os: 'VxWorks' + Target arch: 'ARMv7' + Compiler: 'Clang' + Target compiler: 'Clang' + Platform dependency: 'vxworks-imx6-buildtest' + Features: ['VMSize16', 'InsignificantTests', 'UseConfigure', 'TestOnly', 'BuildTestsInTest', 'DoNotUploadTests'] + Environment variables: [ + 'TARGET_CONFIGURE_ARGS=-release -developer-build -force-debug-info -qpa offscreen -nomake examples', + 'TARGET_CMAKE_ARGS=-DBUILD_SHARED_LIBS=OFF -DWARNINGS_ARE_ERRORS=OFF -DCMAKE_TOOLCHAIN_FILE="{{.Env.WIND_CC_SYSROOT}}/mk/rtp.toolchain.cmake" -DFEATURE_vulkan=OFF -DQT_QMAKE_TARGET_MKSPEC=vxworks-clang -DQT_HOST_PATH=/home/qt/work/install -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_STAGING_PREFIX:PATH=/home/qt/work/install/target', + 'VXWORKS_TEST_LIBS_PATH=/opt/fsl_imx6_2_0_6_2_VSB/usr/lib/common;/opt/fsl_imx6_2_0_6_2_VSB/usr/root/llvm/bin;/opt/fsl_imx6_2_0_6_2_VSB/usr/3pp/develop/usr/lib' + ] diff --git a/coin/platform_configs/nightly_vxworks.yaml b/coin/platform_configs/nightly_vxworks.yaml deleted file mode 100644 index afbf9dbb..00000000 --- a/coin/platform_configs/nightly_vxworks.yaml +++ /dev/null @@ -1,11 +0,0 @@ -Version: 2 -Module only: True -Include: [ - cmake_platforms.yaml: [ - "ubuntu-22.04" - ], - cmake_platforms_qemu_vxworks.yaml: [ - "vxworks-imx6" - ] -] -Configurations: [] diff --git a/coin/platform_configs/qtbase.yaml b/coin/platform_configs/qtbase.yaml index 2d986380..caccd741 100644 --- a/coin/platform_configs/qtbase.yaml +++ b/coin/platform_configs/qtbase.yaml @@ -8,6 +8,8 @@ Include: [ linux_android_tests_multi_abi.yaml, wasm_qtbase_tests.yaml, cmake_platforms_qemu_vxworks_buildtest.yaml, + cmake_platforms_qemu_vxworks.yaml, + cmake_platforms_qemu_vxworks_tests.yaml, qtlite.yaml, qtbase-linux-arm64-offscreen.yaml, qtbase-new-compiler-testing.yaml diff --git a/coin/provisioning/common/linux/install-vxworks-qemu.sh b/coin/provisioning/common/linux/install-vxworks-qemu.sh new file mode 100755 index 00000000..912955f8 --- /dev/null +++ b/coin/provisioning/common/linux/install-vxworks-qemu.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +set -ex + +# shellcheck source=../unix/InstallFromCompressedFileFromURL.sh +source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh" +# shellcheck source=../unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" + +QEMU_VER="8.2.3" +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/qemu/qemu-$QEMU_VER.tar.xz" +AltUrl="https://download.qemu.org/qemu-$QEMU_VER.tar.xz" +SHA1="1b29c8105cf8d15b9e7fb6f8e85170b6c54a1788" +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$SHA1" "/tmp" "$appPrefix" + +targetFolder=/tmp/qemu-${QEMU_VER} +mkdir -p "$targetFolder/build" +cd "$targetFolder/build" +../configure --target-list=arm-softmmu +make -j8 +sudo mkdir -p /usr/share/qemu/keymaps +sudo cp -r "$targetFolder/build/pc-bios/keymaps" "/usr/share/qemu/" +sudo mv "$targetFolder/build" "/opt/qemu-$QEMU_VER" +rm -rf $targetFolder + +SetEnvVar "VXWORKS_QEMU" "/opt/qemu-$QEMU_VER" diff --git a/coin/provisioning/common/linux/vx_works.sh b/coin/provisioning/common/linux/vx_works.sh index ed0bef0c..3b198137 100755 --- a/coin/provisioning/common/linux/vx_works.sh +++ b/coin/provisioning/common/linux/vx_works.sh @@ -14,38 +14,51 @@ source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" VXWORKS_VER="23_09" ######### VXworks libs ######### # Installs to /opt/vxworks -PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_no_source_patched_$VXWORKS_VER.tar.gz" +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_libs_2403.tar.gz" AltUrl="" -sha1="35a457999b310a6128e3bd7de3103c2235063071" -targetFolder="/opt/" +sha1="8152c527ca489b1e51f2954e6e88c6daa22d88f6" +targetFolder="/opt" InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$sha1" "$targetFolder" "" SetEnvVar "VXWORKS_HOME" "/opt/vxworks" -VXWORKS_BUILD_VER="20240326" +VXWORKS_BUILD_VER="20240522" ######### VXworks toolchain ######### # Installs to /opt/fsl_imx6_2_0_6_2_VSB -PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_vsb_${VXWORKS_BUILD_VER}_2.tar.gz" +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_vsb_${VXWORKS_BUILD_VER}.tar.gz" AltUrl="" -sha1="415359ac124e11198a3911c9c4b923269d8da83a" +sha1="b8fd1203aaa0976dbd68ddc94ce0af1b8f89e26f" targetFolder="/opt/" InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$sha1" "$targetFolder" "" SetEnvVar "WIND_CC_SYSROOT" "/opt/fsl_imx6_2_0_6_2_VSB" +VXWORKS_BUILD_VER="20240619" ######### VXworks VIP kernel ######### # Installs to /opt/fsl_imx6_2_0_6_2_VIP_QEMU PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_vip_${VXWORKS_BUILD_VER}.tar.gz" AltUrl="" -sha1="a6019012a8c7af760469959e2df89875f5ff4e9a" +sha1="d66aee4054638df50c8be003fecb010374524f14" targetFolder="/opt/" InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$sha1" "$targetFolder" "" +SetEnvVar "VXWORKS_SSH" "WindRiver@172.31.1.10" -SetEnvVar "VXWORKS_SSH" "WindRiver@10.0.2.4" +######### VXworks fonts and certs ######### +# Installs to /opt/fsl_imx6_2_0_6_2_VIP_QEMU +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_misc.tar.gz" +AltUrl="" +sha1="1bc529b90b35b0b249f219e47d5798225a9b68d8" +targetFolder="/opt/fsl_imx6_2_0_6_2_VSB/" +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$sha1" "$targetFolder" "" # Setup NFS exports that are needed by VxWorks qemu -sudo bash -c "echo '/home/qt/work 10.0.2.4/24(rw,sync,root_squash,no_subtree_check,anonuid=1000,anongid=1000)' >> /etc/exports" -sudo bash -c "echo '/opt/fsl_imx6_2_0_6_2_VSB 10.0.2.4/24(rw,sync,root_squash,no_subtree_check,anonuid=1000,anongid=1000)' >> /etc/exports" +sudo bash -c "echo '/home/qt/work 172.31.1.10/24(rw,sync,root_squash,no_subtree_check,anonuid=2001,anongid=100)' >> /etc/exports" +sudo bash -c "echo '/opt/fsl_imx6_2_0_6_2_VSB 172.31.1.10/24(rw,sync,root_squash,no_subtree_check,anonuid=2001,anongid=100)' >> /etc/exports" sudo exportfs -a +# Enable ipv4 routing from vxWorks to Qt DNS +sudo sed -i s/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g /etc/sysctl.conf +sudo iptables -I FORWARD 1 -j ACCEPT +sudo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE + # Copy start script in place cp "${BASH_SOURCE%/*}/../linux/vxworks_qemu_launcher.sh" "${HOME}" SetEnvVar "VXWORKS_EMULATOR" "${HOME}/vxworks_qemu_launcher.sh" diff --git a/coin/provisioning/common/linux/vxworks_qemu_launcher.sh b/coin/provisioning/common/linux/vxworks_qemu_launcher.sh index 39a68676..db057c69 100755 --- a/coin/provisioning/common/linux/vxworks_qemu_launcher.sh +++ b/coin/provisioning/common/linux/vxworks_qemu_launcher.sh @@ -6,24 +6,24 @@ if ! ip link show br0 >/dev/null 2>&1; then sudo brctl addbr br0 sudo brctl stp br0 off - sudo ifconfig br0 10.0.2.1 netmask 255.255.255.0 promisc up + sudo ifconfig br0 172.31.1.1 netmask 255.255.255.0 promisc up sudo tunctl -u qt -t tap0 sudo ifconfig tap0 promisc up sudo brctl addif br0 tap0 fi QEMU_LOG_PATH="/home/qt/work/vxworks_qemu_log.txt" -qemu-system-arm \ +$VXWORKS_QEMU/qemu-system-arm \ -machine sabrelite \ -smp 4 \ -m 1G \ -nographic \ -monitor none \ -serial null \ - -serial stdio \ + -serial pipe:/tmp/guest \ -kernel /opt/fsl_imx6_2_0_6_2_VIP_QEMU/default/uVxWorks \ -dtb /opt/fsl_imx6_2_0_6_2_VIP_QEMU/default/imx6q-sabrelite.dtb \ - -append "enet(0,0)host:vxWorks h=10.0.2.1 g=10.0.2.1 e=10.0.2.4 u=target pw=vxTarget s=/romfs/startup_script_arm.txt" \ + -append "enet(0,0)host:vxWorks h=172.31.1.1 g=172.31.1.1 e=172.31.1.10 u=target pw=vxTarget s=/romfs/startup_script_arm.txt" \ -nic "tap,ifname=tap0,script=no" >"${QEMU_LOG_PATH}" 2>&1 & for _ in $(seq 30) diff --git a/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/60-install-vxworks-qemu.sh b/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/60-install-vxworks-qemu.sh new file mode 100755 index 00000000..7758bf82 --- /dev/null +++ b/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/60-install-vxworks-qemu.sh @@ -0,0 +1,7 @@ +#!/bin/bash +#Copyright (C) 2023 The Qt Company Ltd +#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +BASEDIR=$(dirname "$0") +"$BASEDIR/../common/linux/install-vxworks-qemu.sh" +