Skip to content

automated/android/noninteractive-tradefed/tradefed

Description

Run tradefed based tests in LAVA.

Maintainer

  • milosz.wasilewski@linaro.org
  • chase.qi@linaro.org

OS

  • debian
  • ubuntu

Scope

  • functional

Devices

  • lxc

Steps to reproduce

  • cd ./automated/android/noninteractive-tradefed
  • . ./setup.sh
  • echo "after ./setup.sh"
  • userdel testuser -r -f || true
  • useradd -G plugdev -m testuser && echo "testuser created successfully"
  • chown testuser:testuser .
  • if echo "${TEST_REBOOT_EXPECTED}" |grep -i "true" ; then ./monitor_fastboot.sh & fi
  • ./monitor_adb.sh &
  • sudo -u testuser ./tradefed.sh -o "${TIMEOUT}" -c "${TEST_URL}" -t "${TEST_PARAMS}" -p "${TEST_PATH}" -r "${RESULTS_FORMAT}" -n "${ANDROID_SERIAL}" -f "${FAILURES_PRINTED}" -a "${AP_SSID}" -k "${AP_KEY}" || if [ $? -eq 100 ]; then error_fatal "The network seems not available, as the ping command failed"; else true; fi
  • cp -r ./${TEST_PATH}/results ./output/ || true
  • cp -r ./${TEST_PATH}/logs ./output/ || true
  • if ls /tmp/tradefed; then cp -r /tmp/tradefed ./output || true; fi
  • sudo dmesg > ./output/dmesg-host.txt || true
  • if ! tar caf tradefed-output-$(date +%Y%m%d%H%M%S).tar.xz ./output; then error_fatal "tradefed - failed to collect results and log files [$ANDROID_SERIAL]"; fi
  • ATTACHMENT=$(ls tradefed-output-*.tar.xz)
  • if [ -n "${SQUAD_UPLOAD_URL}" ]; then ../../utils/upload-to-squad.sh -a "${ATTACHMENT}" -u "${SQUAD_UPLOAD_URL}"; fi
  • if [ -z "${SQUAD_UPLOAD_URL}" ]; then ../../utils/upload-to-artifactorial.sh -a "${ATTACHMENT}" -u "${URL}" -t "${TOKEN}"; fi
  • ../../utils/send-to-lava.sh ./output/result.txt
  • userdel testuser -f -r || true
  • if ! adb shell echo ok; then ./debug-fastboot.sh; error_fatal "tradefed - adb device lost[$ANDROID_SERIAL]"; fi
  • if echo "${TEST_REBOOT_EXPECTED}" |grep -i "true" ; then killall monitor_fastboot.sh; fi
  • killall monitor_adb.sh