diff options
author | Naresh Kamboju <naresh.kamboju@linaro.org> | 2016-11-05 15:10:51 +0530 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-11-07 15:58:38 +0000 |
commit | 4f7c7393b54afc17007b04f34129434e3d3e5e5d (patch) | |
tree | 29fde8046c6ebc7d2d500f77a0d17bee8c1de107 | |
parent | 08f5153fcb6c48abc7614a768ecadfd0f19f8588 (diff) |
linux: openssh debian test
Change-Id: I63d8a44c0bf004da0547e1cb0b87d5afaa60a4fc
Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
-rwxr-xr-x | automated/linux/openssh/openssh-debian.sh | 45 | ||||
-rw-r--r-- | automated/linux/openssh/openssh-debian.yaml | 31 |
2 files changed, 76 insertions, 0 deletions
diff --git a/automated/linux/openssh/openssh-debian.sh b/automated/linux/openssh/openssh-debian.sh new file mode 100755 index 0000000..597f6bf --- /dev/null +++ b/automated/linux/openssh/openssh-debian.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +. ../../lib/sh-test-lib +OUTPUT="$(pwd)/output" +RESULT_FILE="${OUTPUT}/result.txt" +RESULT_LOG="${OUTPUT}/result_log.txt" +TEST_LOG="${OUTPUT}/test_log.txt" + +parse_output() { + egrep "^failed|^ok" "${TEST_LOG}" 2>&1 | tee -a "${RESULT_LOG}" + sed -i -e 's/ok/pass/g' "${RESULT_LOG}" + sed -i -e 's/failed/fail/g' "${RESULT_LOG}" + awk '{for (i=2; i<NF; i++) printf $i "-"; print $NF " " $1}' "${RESULT_LOG}" 2>&1 | tee -a "${RESULT_FILE}" +} + +while getopts "s:" o; do + case "$o" in + s) SKIP_INSTALL="${OPTARG}" ;; + *) usage ;; + esac +done + +# Test run. +! check_root && error_msg "This script must be run as root" +[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)" +mkdir -p "${OUTPUT}" + +pkgs="build-essential" +install_deps "${pkgs}" "${SKIP_INSTALL}" + + +info_msg "About to run openssh test..." +info_msg "Output directory: ${OUTPUT}" + +apt-get update +apt-get source openssh +VERSION=$(dpkg -l | grep openssh-client |awk '{print $3}'|cut -d- -f 1 | cut -d: -f2) +# shellcheck disable=SC2164 +cd openssh-"${VERSION}" +./configure +make +make install +make tests 2>&1 | tee -a "${TEST_LOG}" + +parse_output diff --git a/automated/linux/openssh/openssh-debian.yaml b/automated/linux/openssh/openssh-debian.yaml new file mode 100644 index 0000000..ea77da9 --- /dev/null +++ b/automated/linux/openssh/openssh-debian.yaml @@ -0,0 +1,31 @@ +metadata: + name: openssh-debian + format: "Manual Test Definition 1.0" + description: "Normal OpenSSH development produces a very small, secure, + and easy to maintain version for the OpenBSD project. + The OpenSSH Portability Team takes that pure version and adds + portability code so that OpenSSH can run on many other operating systems + More details in wiki: http://www.openssh.com/portable.html" + maintainer: + - naresh.kamboju@linaro.org + os: + - debian + - ubuntu + scope: + - functional + devices: + - d02 + - d03 + - d05 + - overdrive + environment: + - lava-test-shell + +params: + SKIP_INSTALL: "False" + +run: + steps: + - cd ./automated/linux/openssh + - ./openssh-debian.sh -s "${SKIP_INSTALL}" + - ../../utils/send-to-lava.sh ./output/result.txt |