diff options
Diffstat (limited to 'automated')
-rwxr-xr-x | automated/android/meminfo/meminfo.sh | 59 | ||||
-rw-r--r-- | automated/android/meminfo/meminfo.yaml | 26 | ||||
-rwxr-xr-x | automated/android/piglit-gles2/device-script.sh | 49 | ||||
-rwxr-xr-x | automated/android/piglit-gles2/piglit-gles2.sh | 24 | ||||
-rw-r--r-- | automated/android/piglit-gles2/piglit-gles2.yaml | 27 | ||||
-rwxr-xr-x | automated/android/piglit-gles3/device-script.sh | 70 | ||||
-rwxr-xr-x | automated/android/piglit-gles3/piglit-gles3.sh | 24 | ||||
-rw-r--r-- | automated/android/piglit-gles3/piglit-gles3.yaml | 27 | ||||
-rwxr-xr-x | automated/android/piglit-glslparser/device-script.sh | 65 | ||||
-rwxr-xr-x | automated/android/piglit-glslparser/piglit-glslparser.sh | 24 | ||||
-rw-r--r-- | automated/android/piglit-glslparser/piglit-glslparser.yaml | 28 | ||||
-rwxr-xr-x | automated/android/ping/ping.sh | 40 | ||||
-rw-r--r-- | automated/android/ping/ping.yaml | 28 | ||||
-rwxr-xr-x | automated/utils/test-runner.py | 1 |
14 files changed, 492 insertions, 0 deletions
diff --git a/automated/android/meminfo/meminfo.sh b/automated/android/meminfo/meminfo.sh new file mode 100755 index 0000000..1eac390 --- /dev/null +++ b/automated/android/meminfo/meminfo.sh @@ -0,0 +1,59 @@ +#!/bin/sh -e +# shellcheck disable=SC1091 + +OUTPUT="$(pwd)/output" +RESULT_FILE="${OUTPUT}/result.txt" +ANDROID_SERIAL="" +BOOT_TIMEOUT="300" + +. ../../lib/sh-test-lib +. ../../lib/android-test-lib + +parse_common_args "$@" +initialize_adb +wait_boot_completed "${BOOT_TIMEOUT}" +create_out_dir "${OUTPUT}" + +info_msg "device-${ANDROID_SERIAL}: About to check meminfo..." +adb shell 'cat /proc/meminfo 2>&1' | tee "${OUTPUT}/proc-meminfo" +adb shell 'dumpsys meminfo 2>&1' | tee "${OUTPUT}/dumpsys-meminfo" + +## Parse proc-meminfo +info_msg "Parsing results from proc-meminfo" +logfile="${OUTPUT}/proc-meminfo" +# Capacity info. +grep -E ".+: +[0-9]+ kB" "${logfile}" \ + | sed 's/://g' \ + | awk '{printf("%s pass %s kb\n", $1, $2)}' \ + | tee -a "${RESULT_FILE}" + +# HugePages info. +grep "HugePages_" "${logfile}" \ + | sed 's/://g' \ + | awk '{printf("%s pass %s\n", $1, $2)}' \ + | tee -a "${RESULT_FILE}" + +## Parse dumpsys-meminfo +# Total, Free, Used and Lost RAM. +info_msg "Parsing results from dumpsys-meminfo" +logfile="${OUTPUT}/dumpsys-meminfo" +grep -E "RAM: .+K" "${logfile}" \ + | sed 's/://g' \ + | awk '{printf("%s-%s pass %s K\n", $1, $2, substr($3, 1, length($3)-1))}' \ + | tee -a "${RESULT_FILE}" + +# Detailed info on free RAM. +line=$(grep "Free RAM:" "${logfile}") +measurement=$(echo "${line}" | awk '{print substr($5, 1, length($5)-1)}') +add_metric "Free-RAM-cached-pss" "pass" "${measurement}" "K" +measurement=$(echo "${line}" | awk '{print substr($9, 1, length($9)-1)}') +add_metric "Free-RAM-cached-kernel" "pass" "${measurement}" "K" +measurement=$(echo "${line}" | awk '{print substr($13, 1, length($13)-1)}') +add_metric "Free-RAM-free" "pass" "${measurement}" "K" + +# Detailed info on Used RAM. +line=$(grep "Used RAM:" "${logfile}") +measurement=$(echo "${line}" | awk '{print substr($5, 1, length($5)-1)}') +add_metric "Used-RAM-used-pss" "pass" "${measurement}" "K" +measurement=$(echo "${line}" | awk '{print substr($9, 1, length($9)-1)}') +add_metric "Used-RAM-kernel" "pass" "${measurement}" "K" diff --git a/automated/android/meminfo/meminfo.yaml b/automated/android/meminfo/meminfo.yaml new file mode 100644 index 0000000..69fd484 --- /dev/null +++ b/automated/android/meminfo/meminfo.yaml @@ -0,0 +1,26 @@ +metadata: + name: meminfo + format: "Lava-Test-Shell Test Definition 1.0" + description: "Collect the information in /proc/meminfo after boot." + maintainer: + - yongqin.liu@linaro.org + - chase.qi@linaro.org + os: + - android + scope: + - functional + devices: + - juno + - hi6220-hikey + +params: + # Specify device serial no. when more than one device connected. + ANDROID_SERIAL: "" + # Specify timeout in seconds for wait_boot_completed. + BOOT_TIMEOUT: "300" + +run: + steps: + - cd ./automated/android/meminfo + - ./meminfo.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" + - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/android/piglit-gles2/device-script.sh b/automated/android/piglit-gles2/device-script.sh new file mode 100755 index 0000000..db1544d --- /dev/null +++ b/automated/android/piglit-gles2/device-script.sh @@ -0,0 +1,49 @@ +#!/system/bin/sh +# +# piglit gles2.0 test. +# +# Copyright (C) 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. +# +# owner: yongqin.liu@linaro.org +# +############################################################################### + +PIGLIT_PLATFORM=android +export PIGLIT_PLATFORM + +PSTRING='PIGLIT: {"result": "pass"' +SSTRING='PIGLIT: {"result": "skip"' +FSTRING='PIGLIT: {"result": "fail"' + +gles2_bin_dir="/system/xbin/piglit/piglit-spec-gles2" + +normal_test(){ + cmd="${gles2_bin_dir}/$1" + test_name="${1}" + RESULT=$(${cmd} -auto) + case $RESULT in + *"$PSTRING"*) echo "${test_name}: pass";; + *"$SSTRING"*) echo "${test_name}: skip";; + *"$FSTRING"*) echo "${test_name}: fail";; + *) echo "${test_name}: fail";; + esac +} + +normal_test "glsl-fs-pointcoord_gles2" +normal_test "minmax_gles2" +normal_test "multiple-shader-objects_gles2" diff --git a/automated/android/piglit-gles2/piglit-gles2.sh b/automated/android/piglit-gles2/piglit-gles2.sh new file mode 100755 index 0000000..b924dd6 --- /dev/null +++ b/automated/android/piglit-gles2/piglit-gles2.sh @@ -0,0 +1,24 @@ +#!/bin/sh -e +# shellcheck disable=SC1091 + +OUTPUT="$(pwd)/output" +RESULT_FILE="${OUTPUT}/result.txt" +LOGFILE="${OUTPUT}/piglit-gles2.log" +ANDROID_SERIAL="" +BOOT_TIMEOUT="300" + +. ../../lib/sh-test-lib +. ../../lib/android-test-lib + +parse_common_args "$@" +initialize_adb +wait_boot_completed "${BOOT_TIMEOUT}" +create_out_dir "${OUTPUT}" + +adb_push "./device-script.sh" "/data/local/tmp/piglit-gles2/" +info_msg "device-${ANDROID_SERIAL}: About to run piglit-gles2..." +adb shell "/data/local/tmp/piglit-gles2/device-script.sh" | tee "${LOGFILE}" + +grep -E ".*: (pass|fail|skip)" "${LOGFILE}" \ + | sed 's/://g' \ + | awk '{printf("%s %s\n", $1, $2)}' >> "${RESULT_FILE}" diff --git a/automated/android/piglit-gles2/piglit-gles2.yaml b/automated/android/piglit-gles2/piglit-gles2.yaml new file mode 100644 index 0000000..83ffa2a --- /dev/null +++ b/automated/android/piglit-gles2/piglit-gles2.yaml @@ -0,0 +1,27 @@ +metadata: + name: piglit-gles2 + format: "Lava-Test-Shell Test Definition 1.0" + description: "Piglit is a collection of automated tests for OpenGL + implementations. piglit_gles2.0 runs OpenGL ES 2.0 tests." + maintainer: + - yongqin.liu@linaro.org + - chase.qi@linaro.org + os: + - android + scope: + - functional + devices: + - juno + - hi6220-hikey + +params: + # Specify device serial no. when more than one device connected. + ANDROID_SERIAL: "" + # Specify timeout in seconds for wait_boot_completed + BOOT_TIMEOUT: "300" + +run: + steps: + - cd ./automated/android/piglit-gles2 + - ./piglit-gles2.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" + - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/android/piglit-gles3/device-script.sh b/automated/android/piglit-gles3/device-script.sh new file mode 100755 index 0000000..e655d57 --- /dev/null +++ b/automated/android/piglit-gles3/device-script.sh @@ -0,0 +1,70 @@ +#!/system/bin/sh +# +# piglit gles3.0 test. +# +# Copyright (C) 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. +# +# owner: yongqin.liu@linaro.org +# +############################################################################### + +PIGLIT_PLATFORM=android +export PIGLIT_PLATFORM + +PSTRING='PIGLIT: {"result": "pass"' +SSTRING='PIGLIT: {"result": "skip"' +FSTRING='PIGLIT: {"result": "fail"' + +gles3_bin_dir=/system/xbin/piglit/piglit-spec-gles3 + +normal_test(){ + cmd="${gles3_bin_dir}/$1" + test_name="${1}" + RESULT=$(${cmd} -auto) + case $RESULT in + *"$PSTRING"*) echo "${test_name}: pass";; + *"$SSTRING"*) echo "${test_name}: skip";; + *"$FSTRING"*) echo "${test_name}: fail";; + *) echo "${test_name}: fail";; + esac +} + +test_oes_compressed_etc2_texture_miptree_gles3(){ + PIGLIT_SOURCE_DIR="/data/piglit" + export PIGLIT_SOURCE_DIR + cmd="${gles3_bin_dir}/oes_compressed_etc2_texture-miptree_gles3" + test_base_name="oes_compressed_etc2_texture-miptree_gles3" + formats="rgb8 srgb8 rgba8 srgb8-alpha8 r11 rg11 rgb8-punchthrough-alpha1 srgb8-punchthrough-alpha1" + for format in ${formats}; do + RESULT=$("${cmd}" "${format}" -auto) + + test_name="${test_base_name}_${format}" + case $RESULT in + *"$PSTRING"*) echo "${test_name}: pass";; + *"$SSTRING"*) echo "${test_name}: skip";; + *"$FSTRING"*) echo "${test_name}: fail";; + *) echo "${test_name}: fail";; + esac + + done + +} +normal_test "drawarrays-vertexid_gles3" +normal_test "minmax_gles3" +normal_test "texture-immutable-levels_gles3" +test_oes_compressed_etc2_texture_miptree_gles3 diff --git a/automated/android/piglit-gles3/piglit-gles3.sh b/automated/android/piglit-gles3/piglit-gles3.sh new file mode 100755 index 0000000..f9d3b69 --- /dev/null +++ b/automated/android/piglit-gles3/piglit-gles3.sh @@ -0,0 +1,24 @@ +#!/bin/sh -e +# shellcheck disable=SC1091 + +OUTPUT="$(pwd)/output" +RESULT_FILE="${OUTPUT}/result.txt" +LOGFILE="${OUTPUT}/piglit-gles3.log" +ANDROID_SERIAL="" +BOOT_TIMEOUT="300" + +. ../../lib/sh-test-lib +. ../../lib/android-test-lib + +parse_common_args "$@" +initialize_adb +wait_boot_completed "${BOOT_TIMEOUT}" +create_out_dir "${OUTPUT}" + +adb_push "./device-script.sh" "/data/local/tmp/piglit-gles3/" +info_msg "device-${ANDROID_SERIAL}: About to run piglit-gles3..." +adb shell "/data/local/tmp/piglit-gles3/device-script.sh 2>&1" | tee "${LOGFILE}" + +grep -E ".*: (pass|fail|skip)" "${LOGFILE}" \ + | sed 's/://g' \ + | awk '{printf("%s %s\n", $1, $2)}' >> "${RESULT_FILE}" diff --git a/automated/android/piglit-gles3/piglit-gles3.yaml b/automated/android/piglit-gles3/piglit-gles3.yaml new file mode 100644 index 0000000..43cc437 --- /dev/null +++ b/automated/android/piglit-gles3/piglit-gles3.yaml @@ -0,0 +1,27 @@ +metadata: + name: piglit-gles3 + format: "Lava-Test-Shell Test Definition 1.0" + description: "Piglit is a collection of automated tests for OpenGL + implementations. piglit_gles3.0 runs OpenGL ES 3.0 tests." + maintainer: + - yongqin.liu@linaro.org + - chase.qi@linaro.org + os: + - android + scope: + - functional + devices: + - juno + - hi6220-hikey + +params: + # Specify device serial no. when more than one device connected. + ANDROID_SERIAL: "" + # Specify timeout in seconds for wait_boot_completed + BOOT_TIMEOUT: "300" + +run: + steps: + - cd ./automated/android/piglit-gles3 + - ./piglit-gles3.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" + - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/android/piglit-glslparser/device-script.sh b/automated/android/piglit-glslparser/device-script.sh new file mode 100755 index 0000000..c61ef5a --- /dev/null +++ b/automated/android/piglit-glslparser/device-script.sh @@ -0,0 +1,65 @@ +#!/system/bin/sh +# +# piglit glslparser test. +# +# Copyright (C) 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. +# +# owner: yongqin.liu@linaro.org +# +############################################################################### + +# find and loop over the vert and frag tests found +# looks recursively down the directory tree +PIGLIT_PLATFORM=android +export PIGLIT_PLATFORM +bin_path="/system/xbin/piglit/glslparsertest/glslparsertest" +data_dir="/data/piglit/glslparser/" +/system/bin/busybox find ${data_dir} -name "*.frag" -or -name "*.vert" | while read -r file +do + RESULTFOUND=$(grep expect_result "${file}") + case $RESULTFOUND in + *fail*) RESULTEXPECTED="fail";; + *pass*) RESULTEXPECTED="pass";; + *) RESULTEXPECTED="pass";; + esac + + check_link=$(grep check_link "${file}") + case "${check_link}" in + *true*) check_link="--check-link";; + *) check_link="";; + esac + + required_version=$(grep 'glsl_version:' "${file}") + case "${check_link}" in + *3.00*) required_version="3.00";; + *) required_version="1.00";; + esac + + RESULT=$("${bin_path}" "${check_link}" "${file}" "$RESULTEXPECTED" "${required_version}") + + PSTRING='PIGLIT: {"result": "pass"' + SSTRING='PIGLIT: {"result": "skip"' + FSTRING='PIGLIT: {"result": "fail"' + + case $RESULT in + *"$PSTRING"*) echo "glslparser ${file}: pass";; + *"$SSTRING"*) echo "glslparser ${file}: skip";; + *"$FSTRING"*) echo "glslparser ${file}: fail";; + *) echo "glslparser ${file}: fail";; + esac +done diff --git a/automated/android/piglit-glslparser/piglit-glslparser.sh b/automated/android/piglit-glslparser/piglit-glslparser.sh new file mode 100755 index 0000000..1244927 --- /dev/null +++ b/automated/android/piglit-glslparser/piglit-glslparser.sh @@ -0,0 +1,24 @@ +#!/bin/sh -e +# shellcheck disable=SC1091 + +OUTPUT="$(pwd)/output" +RESULT_FILE="${OUTPUT}/result.txt" +LOGFILE="${OUTPUT}/piglit-glslparser.log" +ANDROID_SERIAL="" +BOOT_TIMEOUT="300" + +. ../../lib/sh-test-lib +. ../../lib/android-test-lib + +parse_common_args "$@" +initialize_adb +wait_boot_completed "${BOOT_TIMEOUT}" +create_out_dir "${OUTPUT}" + +adb_push "./device-script.sh" "/data/local/tmp/piglit-glslparser/" +info_msg "device-${ANDROID_SERIAL}: About to run piglit-glslparser..." +adb shell "echo /data/local/tmp/piglit-glslparser/device-script.sh 2>&1 | su" | tee "${LOGFILE}" + +grep -E "glslparser /data/piglit/glslparser/.+: (pass|fail|skip)" "${LOGFILE}" \ + | sed 's/://g' \ + | awk '{printf("%s %s\n", $2, $3)}' >> "${RESULT_FILE}" diff --git a/automated/android/piglit-glslparser/piglit-glslparser.yaml b/automated/android/piglit-glslparser/piglit-glslparser.yaml new file mode 100644 index 0000000..c5bad20 --- /dev/null +++ b/automated/android/piglit-glslparser/piglit-glslparser.yaml @@ -0,0 +1,28 @@ +metadata: + name: piglit-glslparser + format: "Lava-Test-Shell Test Definition 1.0" + description: "piglit glslparser test for android. The GLSL Parser provides + a front end for parsing and operating on OpenGL Shading + Language code. " + maintainer: + - yongqin.liu@linaro.org + - chase.qi@linaro.org + os: + - android + scope: + - functional + devices: + - juno + - hi6220-hikey + +params: + # Specify device serial no. when more than one device connected. + ANDROID_SERIAL: "" + # Specify timeout in seconds for wait_boot_completed + BOOT_TIMEOUT: "300" + +run: + steps: + - cd ./automated/android/piglit-glslparser + - ./piglit-glslparser.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" + - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/android/ping/ping.sh b/automated/android/ping/ping.sh new file mode 100755 index 0000000..d98b150 --- /dev/null +++ b/automated/android/ping/ping.sh @@ -0,0 +1,40 @@ +#!/bin/sh -e +# shellcheck disable=SC1091 + +OUTPUT="$(pwd)/output" +LOGFILE="${OUTPUT}/ping.log" +RESULT_FILE="${OUTPUT}/result.txt" +export RESULT_FILE +ANDROID_SERIAL="" +BOOT_TIMEOUT="300" +SERVER="www.google.com" + +usage() { + echo "Usage: $0 [-s <android_serial>] [-t <boot_timeout>] [-S <server>]" 1>&2 + exit 1 +} + +while getopts ":s:t:S:" o; do + case "$o" in + s) ANDROID_SERIAL="${OPTARG}" ;; + t) BOOT_TIMEOUT="${OPTARG}" ;; + S) SERVER="${OPTARG}" ;; + *) usage ;; + esac +done + +. ../../lib/sh-test-lib +. ../../lib/android-test-lib + +initialize_adb +wait_boot_completed "${BOOT_TIMEOUT}" +create_out_dir "${OUTPUT}" + +info_msg "device-${ANDROID_SERIAL}: About to ping ${SERVER}..." +adb shell 'ping -c 10 '"${SERVER}"'; echo exitcode: $?' | tee "${LOGFILE}" + +if grep -q "exitcode: 0" "${LOGFILE}"; then + report_pass "ping" +else + report_fail "ping" +fi diff --git a/automated/android/ping/ping.yaml b/automated/android/ping/ping.yaml new file mode 100644 index 0000000..fd9d11d --- /dev/null +++ b/automated/android/ping/ping.yaml @@ -0,0 +1,28 @@ +metadata: + name: ping + format: "Lava-Test Test Definition 1.0" + description: "ping test" + maintainer: + - yongqin.liu@linaro.org + - chase.qi@linaro.org + os: + - android + scope: + - performance + devices: + - juno + - hi6220-hikey + +params: + # Specify device serial no. when more than one device connected. + ANDROID_SERIAL: "" + # Specify timeout in seconds for wait_boot_completed. + BOOT_TIMEOUT: "300" + # Specify the server to ping. + SERVER: "www.google.com" + +run: + steps: + - cd ./automated/android/ping + - ./ping.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" -S "${SERVER}" + - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/utils/test-runner.py b/automated/utils/test-runner.py index d057cad..6bea92b 100755 --- a/automated/utils/test-runner.py +++ b/automated/utils/test-runner.py @@ -181,6 +181,7 @@ class TestDefinition(object): f.write(line) f.write('set -e\n') + f.write('set -x\n') f.write('export TESTRUN_ID=%s\n' % self.testdef['metadata']['name']) if self.args.target is None: f.write('cd %s\n' % (self.test['test_path'])) |