From 3714d31864af36b18b2bcbc44f8882e9347bb79d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stevan=20Radakovi=C4=87?= Date: Tue, 3 Dec 2024 13:00:16 +0100 Subject: [PATCH] Add prototype appliance test definition for integration testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stevan Radaković --- automated/linux/torizon/integration-tests.sh | 15 ++++++++++++ .../linux/torizon/integration-tests.yaml | 23 +++++++++++++++++++ automated/utils/send-to-lava.sh | 6 +++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 automated/linux/torizon/integration-tests.sh create mode 100644 automated/linux/torizon/integration-tests.yaml diff --git a/automated/linux/torizon/integration-tests.sh b/automated/linux/torizon/integration-tests.sh new file mode 100755 index 000000000..50a7371f5 --- /dev/null +++ b/automated/linux/torizon/integration-tests.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +. ../../lib/sh-test-lib + +gitlab_token="" +# source the secrets file to get the gitlab_token env var +. ../../../../../../secrets > /dev/null 2>&1 +install_deps "git curl python3-pip" +curl -X GET http://localhost:8000/api/v01/ + +get_test_program "https://gitlab-ci-token:${gitlab_token}@gitlab.com/LinaroLtd/lava/appliance/baklava-integration.git" "baklava-integration" "main" + +pip3 install -r requirements.txt + +robot --pythonpath . --variable remote:True test/ > ../output.txt diff --git a/automated/linux/torizon/integration-tests.yaml b/automated/linux/torizon/integration-tests.yaml new file mode 100644 index 000000000..65ae7f004 --- /dev/null +++ b/automated/linux/torizon/integration-tests.yaml @@ -0,0 +1,23 @@ +metadata: + name: integration-tests + format: "Lava-Test Test Definition 1.0" + description: "Run appliance integration tests in LAVA." + maintainer: + - stevan.radakovic@linaro.org + os: + - debian + - ubuntu + devices: + - qemu + scope: + - functional + +params: + SKIP_INSTALL: "false" + +run: + steps: + - cd ./automated/linux/torizon/ + - ./integration-tests.sh + - echo "test1" + - ../../utils/send-to-lava.sh ./output.txt diff --git a/automated/utils/send-to-lava.sh b/automated/utils/send-to-lava.sh index 36d678e62..d5247d9a6 100755 --- a/automated/utils/send-to-lava.sh +++ b/automated/utils/send-to-lava.sh @@ -1,14 +1,16 @@ #!/bin/sh - +set -x RESULT_FILE="$1" command -v lava-test-case > /dev/null 2>&1 lava_test_case="$?" command -v lava-test-set > /dev/null 2>&1 lava_test_set="$?" - +echo "${RESULT_FILE}" +ls -lah if [ -f "${RESULT_FILE}" ]; then while read -r line; do + echo "${line}" if echo "${line}" | grep -iq -E ".* +(pass|fail|skip|unknown)$"; then test="${line%% *}" result="${line##* }"