automated/android/multinode/tradefed/tradefed-multinode¶
Description¶
Run tradefed based tests in LAVA.
Maintainer¶
OS¶
- debian
- ubuntu
Scope¶
- functional
Devices¶
- lxc
Steps to reproduce¶
- . ./automated/lib/sh-test-lib
-
if [ -z "\({DEVICE_WORKER_MAPPING_FILE}" -o ! -f "\)" ]; 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 [ "\)" -ne 1 ]; then TEST_PARAMS="${TEST_PARAMS} ${TEST_PARAM_SHARDS_COUNT} \({num_shards}" if [ -n "\)" ]; 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 "\)" -t "\({TEST_PARAMS}" \ -u "\)" -i "\({MAX_NUM_RUNS}" \ -n "\)" -p "\({TEST_PATH}" \ -s "\)" -r "\({RESULTS_FORMAT}" \ -m "\)" -f "\({FAILURES_PRINTED}" \ -a "\)" -k "\({AP_KEY}" -j "\)" \ -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 "\)"); do attachment_result=0 ../../../utils/upload-to-artifactorial.sh -a "\({ATTACHMENT}" -u "\)" -t "\({TOKEN}" -v -r || attachment_result=\)? if [ "\({attachment_result}" -eq 0 ]; then break; fi if [ "\)" ]; then echo "WARNING: Upload to Artifactorial failed, waiting }" -lt "${ARTIFACTORIAL_UPLOAD_ATTEMPTS\({ARTIFACTORIAL_UPLOAD_RETRY_WAIT_MINUTES} minutes and retrying..." sleep "\)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}' "\)"); do if ! adb -s "\({device}" shell echo ok; then lost_devices="\)\({device}, " fi done lost_devices="\)" if [ "${lost_devices}" ]; then warn_msg "Following adb devices are lost: ${lost_devices}" fi
-
if [ "\({exec_result}" -ne 0 -a "\)" = "true" ]; then lava-test-raise "Test runner did not exit cleanly." fi