Skip to content

automated/android/multinode/tradefed/tradefed-multinode

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

  • . ./automated/lib/sh-test-lib
  • if [ -z "${DEVICE_WORKER_MAPPING_FILE}" -o ! -f "${DEVICE_WORKER_MAPPING_FILE}" ]; then lava-test-raise "Parameter DEVICE_WORKER_MAPPING_FILE must be defined and point to an existing file." fi

  • lava-install-packages --no-install-recommends aapt curl default-jre-headless python3-pexpect usbutils wget xz-utils zip

  • cd ./automated/android/multinode/tradefed
  • if [ "${TEST_PARAMS_AUTO_SHARDS}" = "true" ]; then num_shards="$(lava-role list | grep -v '^$' | wc -l)" info_msg "Determined number of shards based on MultiNode role counts: ${num_shards}" if [ "${num_shards}" -ne 1 ]; then TEST_PARAMS="${TEST_PARAMS} ${TEST_PARAM_SHARDS_COUNT} ${num_shards}" if [ -n "${TEST_RETRY_PARAMS}" ]; then TEST_RETRY_PARAMS="${TEST_RETRY_PARAMS} ${TEST_PARAM_SHARDS_COUNT} ${num_shards}" fi fi fi

  • exec_result=0 ./tradefed-multinode.sh \ -o "${TIMEOUT_SECS}" -c "${TEST_URL}" -t "${TEST_PARAMS}" \ -u "${TEST_RETRY_PARAMS}" -i "${MAX_NUM_RUNS}" \ -n "${RUNS_IF_UNCHANGED}" -p "${TEST_PATH}" \ -s "${STATE_CHECK_FREQUENCY_SECS}" -r "${RESULTS_FORMAT}" \ -m "${DEVICE_WORKER_MAPPING_FILE}" -f "${FAILURES_PRINTED}" \ -a "${AP_SSID}" -k "${AP_KEY}" -j "${JAVA_OPTIONS}" \ -b "${USERDATA_IMAGE_FILE}" || exec_result=$?

  • 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
  • tar caf tradefed-output-$(date +%Y%m%d%H%M%S).tar.xz ./output
  • ATTACHMENT=$(ls tradefed-output-*.tar.xz)
  • for i in $(seq "${ARTIFACTORIAL_UPLOAD_ATTEMPTS}"); do attachment_result=0 ../../../utils/upload-to-artifactorial.sh -a "${ATTACHMENT}" -u "${URL}" -t "${TOKEN}" -v -r || attachment_result=$? if [ "${attachment_result}" -eq 0 ]; then break; fi if [ "${i}" -lt "${ARTIFACTORIAL_UPLOAD_ATTEMPTS}" ]; then echo "WARNING: Upload to Artifactorial failed, waiting ${ARTIFACTORIAL_UPLOAD_RETRY_WAIT_MINUTES} minutes and retrying..." sleep "${ARTIFACTORIAL_UPLOAD_RETRY_WAIT_MINUTES}m" else echo "WARNING: Upload to Artifactorial failed too often, not retrying anymore." fi done

  • ../../../utils/send-to-lava.sh ./output/result.txt || true

  • lost_devices="" for device in $(awk -F';' 'length {print $1}' "${DEVICE_WORKER_MAPPING_FILE}"); do if ! adb -s "${device}" shell echo ok; then lost_devices="${lost_devices}${device}, " fi done lost_devices="${lost_devices%??}" if [ "${lost_devices}" ]; then warn_msg "Following adb devices are lost: ${lost_devices}" fi

  • if [ "${exec_result}" -ne 0 -a "${RAISE_ON_FAILURE}" = "true" ]; then lava-test-raise "Test runner did not exit cleanly." fi