[v4,17/17] run-tests: add support for isar-rootless mode

Message ID 20260601113505.2898877-18-felix.moessbauer@siemens.com
State New
Headers show
Series add support to build isar unprivileged | expand

Commit Message

Felix Moessbauer June 1, 2026, 11:35 a.m. UTC
If the testsuite is started in rootless mode (-p rootless=1), then start
the container in rootless mode as well. By that, we can seamlessly
switch between rootfull and rootless mode when testing.

Note, that this requires a recent enough kas-container version (>5.3).

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 scripts/run-tests.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index bce10d70..ed373af7 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -15,4 +15,9 @@  TEST_CONTAINER_VERSION=$(cat ${ISAR_DIR}/testsuite/dockerdata/version)
 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 "$*"
+ISAR_FLAG="--isar"
+case "$*" in
+    *"-p rootless=1"*) ISAR_FLAG="--isar-rootless" ;;
+esac
+
+${ISAR_DIR}/kas/kas-container ${ISAR_FLAG} --repo-ro shell -c "$*"