forked from Linaro/test-definitions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automated: linux: add aklite-apps test
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
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |