Skip to content

Commit

Permalink
Add prototype appliance test definition for integration testing
Browse files Browse the repository at this point in the history
Signed-off-by: Stevan Radaković <[email protected]>
  • Loading branch information
stevanradakovic committed Dec 5, 2024
1 parent 978d12e commit 3714d31
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
15 changes: 15 additions & 0 deletions automated/linux/torizon/integration-tests.sh
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions automated/linux/torizon/integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
metadata:
name: integration-tests
format: "Lava-Test Test Definition 1.0"
description: "Run appliance integration tests in LAVA."
maintainer:
- [email protected]
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
6 changes: 4 additions & 2 deletions automated/utils/send-to-lava.sh
Original file line number Diff line number Diff line change
@@ -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##* }"
Expand Down

0 comments on commit 3714d31

Please sign in to comment.