From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>,
Cedric Hombourger <cedric.hombourger@siemens.com>
Subject: [PATCH 2/9] testsuite: Provide a new kas-based test container and wrapper script
Date: Mon, 23 Mar 2026 09:30:32 +0100 [thread overview]
Message-ID: <c8706d0bf1c6b023dcc63af39b12c1649100b8c4.1774254639.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1774254639.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
This reworks the current docker-isar container to test-container.
Besides its new path and revisioning scheme, this container comes with
its own entrypoint script. The script still builds on top of kas'
container-entrypoint but avoids calling kas itself, thus entering a
bitbake env in shell mode.
When invoked via "kas-container shell", the new entrypoint builds up an
environment to run the avocado testsuite against the Isar repo that is
passed in, but that without modifying it. All testsuite results are
directed to the build/testsuite folder, including all modifications
which are kept in an overlay. This ensure a clean execution context for
the testsuite.
If the container is started without arguments, in continues to act as a
basis for gitlab-ci job executions.
The kas version used as baseline for test-container is now derived from
the one used for interactive building as well. This avoid surprises due
to the different versions.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
scripts/run-tests.sh | 18 ++++
testsuite/dockerdata/Dockerfile | 8 +-
testsuite/dockerdata/README.md | 12 ++-
testsuite/dockerdata/build.sh | 14 +++
.../dockerdata/test-container-entrypoint | 95 +++++++++++++++++++
testsuite/dockerdata/version | 1 +
6 files changed, 142 insertions(+), 6 deletions(-)
create mode 100755 scripts/run-tests.sh
create mode 100755 testsuite/dockerdata/build.sh
create mode 100755 testsuite/dockerdata/test-container-entrypoint
create mode 100644 testsuite/dockerdata/version
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
new file mode 100755
index 00000000..bce10d70
--- /dev/null
+++ b/scripts/run-tests.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Script to run testsuite inside the official test-container
+#
+# Copyright (c) Siemens AG, 2026
+# SPDX-License-Identifier: MIT
+
+ISAR_DIR=$(readlink -f $(dirname $0)/..)
+
+TEST_CONTAINER_VERSION=$(cat ${ISAR_DIR}/testsuite/dockerdata/version)
+
+# The way to do this after kas 5.2:
+# export KAS_CONTAINER_IMAGE="${CONTAINER_BASENAME:-ghcr.io/ilbers/isar}/test-container:$TEST_CONTAINER_VERSION"
+#
+# For now:
+export KAS_CONTAINER_IMAGE_DISTRO="container:$TEST_CONTAINER_VERSION"
+export KAS_CONTAINER_IMAGE=${CONTAINER_BASENAME:-ghcr.io/ilbers/isar}/test
+
+${ISAR_DIR}/kas/kas-container --isar --repo-ro shell -c "$*"
diff --git a/testsuite/dockerdata/Dockerfile b/testsuite/dockerdata/Dockerfile
index 2a77798a..7b9cdaf6 100644
--- a/testsuite/dockerdata/Dockerfile
+++ b/testsuite/dockerdata/Dockerfile
@@ -1,4 +1,6 @@
-FROM ghcr.io/siemens/kas/kas-isar:<version>
+ARG KAS_VERSION=0
+
+FROM ghcr.io/siemens/kas/kas-isar:${KAS_VERSION}
ARG TARGETPLATFORM
ARG DEBIAN_FRONTEND=noninteractive
@@ -10,3 +12,7 @@ RUN sudo pip3 --proxy=$https_proxy install --break-system-packages avocado-frame
sudo apt-get install -y -f --no-install-recommends python3-apt && \
sudo apt-get clean && \
sudo rm -rf $(pip3 cache dir) /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+COPY testsuite/dockerdata/test-container-entrypoint /
+
+ENTRYPOINT ["/test-container-entrypoint"]
diff --git a/testsuite/dockerdata/README.md b/testsuite/dockerdata/README.md
index e6b76d25..54a78187 100644
--- a/testsuite/dockerdata/README.md
+++ b/testsuite/dockerdata/README.md
@@ -1,9 +1,12 @@
# Creating image
+- Make sure `testsuite/dockerdata/version` is bumped for new images, also
+ after updating `kas/kas-container`.
+
+- Run:
+
```
-export version="4.4"
-cd <isar_dir>/testsuite/dockerdata
-sed "s/:<version>/:${version}/" Dockerfile | docker build -t ghcr.io/ilbers/docker-isar:${version} -
+testsuite/dockerdata/build.sh
```
# Pushing the image to docker hub
@@ -13,8 +16,7 @@ sed "s/:<version>/:${version}/" Dockerfile | docker build -t ghcr.io/ilbers/dock
- Use it for uploading docker image:
```
-export version="4.4"
-docker push ghcr.io/ilbers/docker-isar:${version}
+docker push ghcr.io/ilbers/isar/test-container:$(cat testsuite/dockerdata/version)
```
- Make the uploaded package public
diff --git a/testsuite/dockerdata/build.sh b/testsuite/dockerdata/build.sh
new file mode 100755
index 00000000..7880d19f
--- /dev/null
+++ b/testsuite/dockerdata/build.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Build kas-based test-container
+#
+# Copyright (c) Siemens AG, 2026
+# SPDX-License-Identifier: MIT
+
+ISAR_DIR=$(readlink -f $(dirname $0)/../..)
+
+eval $(grep "^KAS_CONTAINER_SCRIPT_VERSION=" ${ISAR_DIR}/kas/kas-container)
+TEST_CONTAINER_VERSION=$(cat ${ISAR_DIR}/testsuite/dockerdata/version)
+
+docker build --file ${ISAR_DIR}/testsuite/dockerdata/Dockerfile \
+ --build-arg KAS_VERSION=$KAS_CONTAINER_SCRIPT_VERSION \
+ --tag ${CONTAINER_BASENAME:-ghcr.io/ilbers/isar}/test-container:$TEST_CONTAINER_VERSION ${ISAR_DIR}
diff --git a/testsuite/dockerdata/test-container-entrypoint b/testsuite/dockerdata/test-container-entrypoint
new file mode 100755
index 00000000..16f74124
--- /dev/null
+++ b/testsuite/dockerdata/test-container-entrypoint
@@ -0,0 +1,95 @@
+#!/bin/sh
+# Alternative entrypoint for the kas-based test-container
+#
+# Copyright (c) Siemens AG, 2026
+# SPDX-License-Identifier: MIT
+
+if [ $# -eq 0 ]; then
+ exec /container-entrypoint
+fi
+
+set -e
+
+# skip "shell [-c]"
+if [ $# -gt 1 ]; then
+ shift 2
+else
+ shift 1
+fi
+
+export args="--max-parallel-tasks=1 --disable-sysinfo"
+for arg in $*; do
+ case "$arg" in
+ --clean)
+ rm -rf /work/build/testsuite
+ ;;
+ --debug)
+ export showopt="--show=app,test"
+ ;;
+ --shell)
+ export start_shell=1
+ ;;
+ --help)
+ cat <<EOF
+Usage: run-tests.sh [params] ...
+
+Supported parameters:
+ --clean Purge results of previous test runs before starting.
+ --debug Use '--show=app,test' log settings for avocado.
+ --shell Drop into shell rather than starting tests.
+ --help Show this help message.
+
+Any other parameters are passed to "avocado run". Its usage is:
+
+EOF
+ avocado run --help
+ exit 0
+ ;;
+ *)
+ args="$args $arg"
+ ;;
+ esac
+done
+
+case "$args" in
+*testsuite/citest.py*)
+ ;;
+*)
+ args="$args testsuite/citest.py"
+ ;;
+esac
+
+mkdir /isar
+
+# Reuse the existing entrypoint script, exploiting that entry without
+# parameters drops us into a shell, rather then calling kas.
+echo exit | /container-entrypoint
+
+gosu builder sh -c '
+set -e
+
+base_dir=/work/build/testsuite
+
+mkdir -p ${base_dir}/overlay/upper
+mkdir -p ${base_dir}/overlay/work
+sudo mount -t overlay overlay -o lowerdir=/repo,upperdir=${base_dir}/overlay/upper,workdir=${base_dir}/overlay/work /isar
+sudo mount -o bind ${base_dir} /isar/build
+
+mkdir -p "${HOME}"/.config/avocado
+cat <<EOF > "${HOME}"/.config/avocado/avocado.conf
+[datadir.paths]
+base_dir = ${base_dir}
+test_dir = ${base_dir}/tests
+data_dir = ${base_dir}/data
+logs_dir = ${base_dir}/job-results
+EOF
+
+cd /isar
+
+if [ "${start_shell}" = 1 ]; then
+ bash
+else
+ set -x
+ avocado ${showopt} run ${args}
+fi
+'
diff --git a/testsuite/dockerdata/version b/testsuite/dockerdata/version
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/testsuite/dockerdata/version
@@ -0,0 +1 @@
+1
--
2.47.3
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/c8706d0bf1c6b023dcc63af39b12c1649100b8c4.1774254639.git.jan.kiszka%40siemens.com.
next prev parent reply other threads:[~2026-03-23 8:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 8:30 [PATCH 0/9] Improve testsuite executability, basic GitHub CI 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` [PATCH 1/9] Update kas-container to 5.2 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` 'Jan Kiszka' via isar-users [this message]
2026-03-23 8:30 ` [PATCH 3/9] testsuite: Install avocado-framework-plugin-varianter-yaml-to-mux in test-container 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` [PATCH 4/9] testsuite: Add squid to test-container 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` [PATCH 5/9] ci: Add github workflow for building and deploying test-container 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` [PATCH 6/9] ci: Switch gitlab-ci to new test-container 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` [PATCH 7/9] CONTRIBUTING: Switch to new run-tests.sh 'Jan Kiszka' via isar-users
2026-03-26 17:01 ` Zhihang Wei
2026-03-26 18:41 ` 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` [PATCH 8/9] testsuite: Drop KFAIL from trixie tests 'Jan Kiszka' via isar-users
2026-03-23 8:30 ` [PATCH 9/9] ci: Add github test job to github workflow 'Jan Kiszka' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8706d0bf1c6b023dcc63af39b12c1649100b8c4.1774254639.git.jan.kiszka@siemens.com \
--to=isar-users@googlegroups.com \
--cc=cedric.hombourger@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox