Skip to content

Commit

Permalink
automated/linux: Add oe-test-runtime definition
Browse files Browse the repository at this point in the history
Provides a helper to run oe-test runtime suite using the LAVA LXC.

Change-Id: I372196ad92cbc8f7b66ca6102e68aa152976069c
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
  • Loading branch information
Aníbal Limón committed Oct 29, 2018
1 parent ff49d31 commit 4691b67
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
51 changes: 51 additions & 0 deletions automated/linux/oe-test/oe-test-runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/sh -ex
# shellcheck disable=SC1090

TEST_DIR=$(dirname "$(realpath "$0")")

SKIP_INSTALL="false"
OE_TEST_URL=""
TARGET_IP="lava-target-ip"
LXC_IP="lava-lxc-ip"
IMAGE_NAME="rpb-console-image-test"

usage() {
echo "Usage: $0 [-s <true|false>] <-u <oe-test-url>> [-t <target_ip>] [-l <lxc_ip>] [-n <image_name>]" 1>&2
exit 1
}

while getopts ":s:u:t:l:n:" opt; do
case "${opt}" in
s) SKIP_INSTALL="${OPTARG}" ;;
u) OE_TEST_URL="${OPTARG}" ;;
t) TARGET_IP="${OPTARG}" ;;
l) LXC_IP="${OPTARG}" ;;
n) IMAGE_NAME="${OPTARG}" ;;
*) usage ;;
esac
done

. "${TEST_DIR}/../../lib/sh-test-lib"

if [ -z "${OE_TEST_URL}" ]; then
echo "No OE_TEST_URL specified"
exit 1
fi

if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
info_msg "Dependencies install skipped"
else
install_deps "python3 iputils-ping openssh-client"
fi

if [ "${TARGET_IP}" = "lava-target-ip" ]; then
TARGET_IP="$(lava-target-ip)"
fi
if [ "${LXC_IP}" = "lava-lxc-ip" ]; then
LXC_IP="$(lava-echo-ipv4 eth0)"
fi

wget ${OE_TEST_URL}
tar -xvf $(basename ${OE_TEST_URL})
cd ${IMAGE_NAME}
./oe-test runtime --target-ip ${TARGET_IP} --server-ip ${LXC_IP} 2>&1
33 changes: 33 additions & 0 deletions automated/linux/oe-test/oe-test-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
metadata:
name: oe-test-runtime
format: "Lava-Test-Shell Test Definition 1.0"
description: "Run OE test runtime suite"
maintainer:
- anibal.limon@linaro.org
os:
- openembedded
scope:
- functional
devices:
- dragonboard410c
- dragonboard820c

params:
SKIP_INSTALL: "false"
OE_TEST_URL: ""
TARGET_IP: "lava-target-ip"
LXC_IP: "lava-lxc-ip"
IMAGE_NAME: "rpb-console-image-test"

run:
steps:
- cd ./automated/linux/oe-test
- ./oe-test-runtime.sh -s "${SKIP_INSTALL}" -u "${OE_TEST_URL}" -t "${TARGET_IP}" -l "${LXC_IP}" -n "${IMAGE_NAME}"

parse:
pattern: "RESULTS - (?P<test_case_id>.*) - Testcase \\d+: (?P<result>PASSED|FAILED|SKIPPED|ERROR)"
fixupdict:
PASSED: pass
FAILED: fail
SKIPPED: skip
ERROR: fail

0 comments on commit 4691b67

Please sign in to comment.