diff options
author | Daniel Díaz <daniel.diaz@linaro.org> | 2017-03-09 08:39:35 -0600 |
---|---|---|
committer | Daniel Díaz <daniel.diaz@linaro.org> | 2017-03-16 04:12:37 -0600 |
commit | 8fa58dc00765a2766d66099b4ed0588ed7400488 (patch) | |
tree | 6f707866ca0e5eb07cbea4d30a9de96068183a5e | |
parent | c08aa8fc47473072448596bc8e86eb3271dc60f5 (diff) |
automated: add bionic-libc tests
Change-Id: I3dcac7741c0f9aaeb76a9d0eadbc21d5cbf98cfe
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
3 files changed, 78 insertions, 0 deletions
diff --git a/automated/android/bionic-libc-tests/bionic-libc-tests.sh b/automated/android/bionic-libc-tests/bionic-libc-tests.sh new file mode 100755 index 0000000..55c7762 --- /dev/null +++ b/automated/android/bionic-libc-tests/bionic-libc-tests.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +HOST_OUTPUT="$(pwd)/output" +DEVICE_OUTPUT="/data/local/tmp/result.txt" +export RESULT_FILE +TIMEOUT=300 + +usage() { + echo "Usage: $0" 1>&2 + exit 1 +} + +if [ $# -gt 0 ]; then + usage +fi + +# shellcheck disable=SC1091 +. ../../lib/sh-test-lib +. ../../lib/android-test-lib + +# Test run. +create_out_dir "${HOST_OUTPUT}" + +initialize_adb +wait_boot_completed "${TIMEOUT}" +adb_push "./device-script.sh" "/data/local/tmp/" + +info_msg "About to run bionic-libc-tests on device ${SN}" +adb -s "${SN}" shell /data/local/tmp/device-script.sh 2>&1 \ + | tee "${HOST_OUTPUT}"/device-run.log + +adb_pull "${DEVICE_OUTPUT}" "${HOST_OUTPUT}" diff --git a/automated/android/bionic-libc-tests/bionic-libc-tests.yaml b/automated/android/bionic-libc-tests/bionic-libc-tests.yaml new file mode 100644 index 0000000..335076a --- /dev/null +++ b/automated/android/bionic-libc-tests/bionic-libc-tests.yaml @@ -0,0 +1,22 @@ +metadata: + name: bionic-libc-tests + format: "Lava-Test-Shell Test Definition 1.0" + description: "Execute all available bionic-libc-tests and fetch data." + maintainer: + - daniel.diaz@linaro.org + os: + - android + devices: + - juno + - hi6220-hikey + - x15 + scope: + - performance + environment: + - lava-test-shell + +run: + steps: + - cd ./automated/linux/bionic-libc-tests/ + - ./bionic-libc-tests.sh + - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/android/bionic-libc-tests/device-script.sh b/automated/android/bionic-libc-tests/device-script.sh new file mode 100755 index 0000000..9401119 --- /dev/null +++ b/automated/android/bionic-libc-tests/device-script.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +OUTPUT_FILE="/data/local/tmp/result.txt" + +TESTS= +TESTS="${TESTS} test_dlclose_destruction test_dlopen_null test_executable_destructor" +TESTS="${TESTS} test_getaddrinfo test_getgrouplist test_gethostbyname test_gethostname" +TESTS="${TESTS} test_mutex test_netinet_icmp test_pthread_cond test_pthread_mutex" +TESTS="${TESTS} test_pthread_once test_pthread_rwlock test_relocs test_setjmp" +TESTS="${TESTS} test_seteuid test_static_cpp_mutex test_static_executable_destructor" +TESTS="${TESTS} test_static_init test_sysconf test_udp" + +for TEST in $TESTS; do + if [ ! -f "/system/bin/${TEST}" ]; then + continue + fi + $TEST + EXIT_STATUS=$? + if [ $EXIT_STATUS -ne 0 ]; then + echo "$TEST fail" >> ${OUTPUT_FILE} + else + echo "$TEST pass" >> ${OUTPUT_FILE} + fi +done |