From e83cc426cbca5a7aefd7ade27b5043aca34b8281 Mon Sep 17 00:00:00 2001 From: Pawel Szymaszek Date: Mon, 17 Nov 2025 13:11:59 +0100 Subject: [PATCH 1/5] automated: linux: torizon: integration: replace hardcoded lava_test_dir Introduced code for dynamic finding of lava test directory Signed-off-by: Pawel Szymaszek --- automated/linux/torizon/integration-tests.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/automated/linux/torizon/integration-tests.sh b/automated/linux/torizon/integration-tests.sh index 5a02e7443..95ca8f83d 100755 --- a/automated/linux/torizon/integration-tests.sh +++ b/automated/linux/torizon/integration-tests.sh @@ -5,7 +5,19 @@ set -x . ../../lib/sh-test-lib # source the secrets file to get the gitlab_token env var -. ../../../../../../secrets > /dev/null 2>&1 +lava_test_dir="$( + dir="$(pwd)" + while [ "$dir" != "/" ]; do + find "$dir" -maxdepth 1 -type d -regex '.*/lava-[0-9]+' 2>/dev/null + dir=$(dirname "$dir") + done | + sort -t- -k2,2n | + tail -1 +)" +if test -f "${lava_test_dir}/secrets"; then +. "${lava_test_dir}/secrets" +fi + # Determine the appropriate packages for the architecture ARCH=$(uname -m) From 7893192764a8b9221358975bc70504c63e1aaee5 Mon Sep 17 00:00:00 2001 From: Pawel Szymaszek Date: Mon, 17 Nov 2025 13:16:37 +0100 Subject: [PATCH 2/5] automated: linux: torizon: integration: replace if/else for arch detection Use detect_api with case syntax for cleaner approach of finding right architecture for further testing Signed-off-by: Pawel Szymaszek --- automated/linux/torizon/integration-tests.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/automated/linux/torizon/integration-tests.sh b/automated/linux/torizon/integration-tests.sh index 95ca8f83d..8c98a296a 100755 --- a/automated/linux/torizon/integration-tests.sh +++ b/automated/linux/torizon/integration-tests.sh @@ -20,20 +20,24 @@ fi # Determine the appropriate packages for the architecture -ARCH=$(uname -m) SPIRE_VERSION="0.3.4" -if [ "$ARCH" = "x86_64" ]; then +detect_abi +# shellcheck disable=SC2154 +case "${abi}" in + x86_64) DRIVER="geckodriver-v0.36.0-linux64.tar.gz" SPIRE="staging-spire_${SPIRE_VERSION}_linux_amd64.deb" - -elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then + ;; + arm64|aarch64) DRIVER="geckodriver-v0.36.0-linux-aarch64.tar.gz" SPIRE="staging-spire_${SPIRE_VERSION}_linux_arm64.deb" -else - echo "Unknown architecture: $ARCH" + ;; + *) + echo "Unknown architecture: ${abi}" exit 1 -fi + ;; +esac # Download and install spire package curl -sSLO "https://github.com/Linaro/SPIRE-CLI-S-/releases/download/$SPIRE_VERSION/$SPIRE" From 9828631baa5cbc82beae221c02cb94ac2cc6d299 Mon Sep 17 00:00:00 2001 From: Pawel Szymaszek Date: Mon, 17 Nov 2025 13:20:07 +0100 Subject: [PATCH 3/5] automated: linux: torizon: integration: use tagged release for SPIRE, GECKODRIVER, UV Refactor code for using tagged version of required packages: - spire - uv - geckodriver Signed-off-by: Pawel Szymaszek --- automated/linux/torizon/integration-tests.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/automated/linux/torizon/integration-tests.sh b/automated/linux/torizon/integration-tests.sh index 8c98a296a..5047bdd46 100755 --- a/automated/linux/torizon/integration-tests.sh +++ b/automated/linux/torizon/integration-tests.sh @@ -18,20 +18,21 @@ if test -f "${lava_test_dir}/secrets"; then . "${lava_test_dir}/secrets" fi - # Determine the appropriate packages for the architecture SPIRE_VERSION="0.3.4" +GECKO_VERSION="v0.36.0" +UV_VERSION="0.9.4" detect_abi # shellcheck disable=SC2154 case "${abi}" in x86_64) - DRIVER="geckodriver-v0.36.0-linux64.tar.gz" - SPIRE="staging-spire_${SPIRE_VERSION}_linux_amd64.deb" + GECKODRIVER_ARCH="linux64" + SPIRE_ARCH="linux_amd64" ;; arm64|aarch64) - DRIVER="geckodriver-v0.36.0-linux-aarch64.tar.gz" - SPIRE="staging-spire_${SPIRE_VERSION}_linux_arm64.deb" + GECKODRIVER="linux-aarch64" + SPIRE_ARCH="linux_arm64" ;; *) echo "Unknown architecture: ${abi}" @@ -39,18 +40,21 @@ case "${abi}" in ;; esac +GECKODRIVER="geckodriver-${GECKO_VERSION}-${GECKODRIVER_ARCH}.tar.gz" +SPIRE="staging-spire_${SPIRE_VERSION}_${SPIRE_ARCH}.deb" + # Download and install spire package curl -sSLO "https://github.com/Linaro/SPIRE-CLI-S-/releases/download/$SPIRE_VERSION/$SPIRE" dpkg -i "$SPIRE" # Download and install gecko driver -curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.36.0/$DRIVER" -tar -xf "$DRIVER" +curl -LO "https://github.com/mozilla/geckodriver/releases/download/${GECKO_VERSION}/$GECKODRIVER" +tar -xf "$GECKODRIVER" mv geckodriver /usr/local/bin chown root:root /usr/local/bin/geckodriver # Download and install uv -curl -LsSf https://astral.sh/uv/install.sh | sh +curl -LsSf "https://astral.sh/uv/${UV_VERSION}/install.sh" | sh . "$HOME"/.local/bin/env # clone baklava-integration repo and install required pip pkgs From 859e46dc0ae23256fb0b966b1e960422cedcfd8c Mon Sep 17 00:00:00 2001 From: Pawel Szymaszek Date: Mon, 17 Nov 2025 13:22:58 +0100 Subject: [PATCH 4/5] automated: linux: torizon: integration: set UTILS_PATH variable Replace path repetitions with UTILS_PATH var for cleaner look Signed-off-by: Pawel Szymaszek --- automated/linux/torizon/integration-tests.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automated/linux/torizon/integration-tests.sh b/automated/linux/torizon/integration-tests.sh index 5047bdd46..541de3a78 100755 --- a/automated/linux/torizon/integration-tests.sh +++ b/automated/linux/torizon/integration-tests.sh @@ -4,6 +4,8 @@ set -x . ../../lib/sh-test-lib +UTILS_PATH=$(cd ../../utils && pwd) + # source the secrets file to get the gitlab_token env var lava_test_dir="$( dir="$(pwd)" @@ -66,7 +68,7 @@ export SPIRE_PAT_TOKEN LAVA_TOKEN LAVA_PASSWORD SQUAD_UPLOAD_URL SQUAD_ARCHIVE_S # run tests with uv uv run robot --pythonpath . --exclude gitlab_pipeline --variable remote:"$IS_REMOTE" --outputdir=.. --listener test/keyword_listener.py test/ -../../../utils/upload-to-squad.sh -a ../output.xml -u "$SQUAD_UPLOAD_URL" -uv run --project ../../../utils/ uv run ../../../utils/parse-robot-framework.py -r ../output.xml +"${UTILS_PATH}"/upload-to-squad.sh -a ../output.xml -u "$SQUAD_UPLOAD_URL" +uv run --project "${UTILS_PATH}"/ uv run "${UTILS_PATH}"/parse-robot-framework.py -r ../output.xml exit 0 From f65dd87f6d1fc70f0d9a4dcab7256d964ee21155 Mon Sep 17 00:00:00 2001 From: Pawel Szymaszek Date: Mon, 17 Nov 2025 13:42:19 +0100 Subject: [PATCH 5/5] automated: linux: torizon: integration: fetch git repository branch with variable Delete redundant git checkout cmd and fetch selected branch directly with usage of BRANCH_NAME variable Signed-off-by: Pawel Szymaszek --- automated/linux/torizon/integration-tests.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/automated/linux/torizon/integration-tests.sh b/automated/linux/torizon/integration-tests.sh index 541de3a78..15d06f461 100755 --- a/automated/linux/torizon/integration-tests.sh +++ b/automated/linux/torizon/integration-tests.sh @@ -60,8 +60,7 @@ curl -LsSf "https://astral.sh/uv/${UV_VERSION}/install.sh" | sh . "$HOME"/.local/bin/env # clone baklava-integration repo and install required pip pkgs -get_test_program "https://gitlab-ci-token:${GITLAB_TOKEN}@gitlab.com/LinaroLtd/lava/appliance/baklava-integration/docker-tests.git" "docker-tests" "main" -git checkout "$BRANCH_NAME" +get_test_program "https://gitlab-ci-token:${GITLAB_TOKEN}@gitlab.com/LinaroLtd/lava/appliance/baklava-integration/docker-tests.git" "docker-tests" "$BRANCH_NAME" export SPIRE_PAT_TOKEN LAVA_TOKEN LAVA_PASSWORD SQUAD_UPLOAD_URL SQUAD_ARCHIVE_SUBMIT_TOKEN