Skip to content

Commit

Permalink
automated: linux: add aklite-apps test
Browse files Browse the repository at this point in the history
Test exercises aklite-apps utility from LmP. This utility allows to run
docker-compose apps without registering to FoundriesFactory.

Signed-off-by: Milosz Wasilewski <[email protected]>
  • Loading branch information
mwasilew committed Jan 23, 2024
1 parent 8a62e7c commit 8dc26f5
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
57 changes: 57 additions & 0 deletions automated/linux/aklite-apps/aklite-apps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash -e
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2021 Foundries.io Ltd.

# shellcheck disable=SC1091
. ../../lib/sh-test-lib
OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
export RESULT_FILE
APPS=""
DEFAULT_APPS=""
LOOP_APPS=""
APPS_ARG=""

usage() {
echo "\
Usage: $0 -a <app1,app2> -d <app1,app2>
-a <app1,app2>
Comma separated list of apps to start
-d <app1,app2>
Comma separated list of default apps to start
Conflicts with -a
"
}

while getopts "a:d:h" opts; do
case "$opts" in
a) APPS="${OPTARG}";;
d) DEFAULT_APPS="${OPTARG}";;
h|*) usage ; exit 1 ;;
esac
done


! check_root && error_msg "You need to be root to run this script."
create_out_dir "${OUTPUT}"

if [ -n "${APPS}" ]; then
APPS_ARG=" --apps ${APPS}"
LOOP_APPS="${APPS}"
elif [ -n "${DEFAULT_APPS}" ]; then
LOOP_APPS="${DEFAULT_APPS}"
fi

# shellcheck disable=SC2086
aklite-apps run ${APPS_ARG}
if [ -n "${LOOP_APPS}" ]; then
IFS=","
for app in ${LOOP_APPS}
do
docker ps | grep "${app}"
check_return "${app}-running"
done
else
report-skip "aklite-apps"
fi
27 changes: 27 additions & 0 deletions automated/linux/aklite-apps/aklite-apps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2021 Foundries.io
metadata:
format: Lava-Test Test Definition 1.0
name: aklite-apps
description: "Run apps without registration"

maintainer:
- [email protected]
os:
- openembedded
scope:
- functional

devices:
- imx8mm
- bcm2711-rpi-4-b

params:
APPS: ""
DEFAULT_APPS: ""

run:
steps:
- cd ./automated/linux/aklite-apps
- ./aklite-apps.sh -a "${APPS}" -d "${DEFAULT_APPS}"
- ../../utils/send-to-lava.sh ./output/result.txt

0 comments on commit 8dc26f5

Please sign in to comment.