diff options
author | mwasilew <milosz.wasilewski@linaro.org> | 2020-12-07 08:17:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 08:17:57 +0000 |
commit | 82c1032c71743682c4fa3b5cb0e2e95f16e3ad84 (patch) | |
tree | e37984910949813a410bac5d668eff04d8a11f4b | |
parent | 458ed9c48d6fdcb1ebd203bee24eee62b2906f2c (diff) | |
parent | 9241275bc21f1b5d0738a887d61f45cc0054ceae (diff) |
Merge pull request #253 from liuyq/debug-fastboot
noninteractive-tradefed: collect more information to debug fastboot c…
-rwxr-xr-x | automated/android/noninteractive-tradefed/debug-fastboot.sh | 49 | ||||
-rw-r--r-- | automated/android/noninteractive-tradefed/tradefed.yaml | 3 |
2 files changed, 51 insertions, 1 deletions
diff --git a/automated/android/noninteractive-tradefed/debug-fastboot.sh b/automated/android/noninteractive-tradefed/debug-fastboot.sh new file mode 100755 index 0000000..2e90679 --- /dev/null +++ b/automated/android/noninteractive-tradefed/debug-fastboot.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# check the user that run this script +id +echo "----fastboot devices list from /sys/bus/usb/devices start----" +fastboot_devices="" +devpaths="" +#ls /sys/bus/usb/drivers/usb/*/serial | while read -r device; do +#ls /sys/bus/usb/devices/*/serial | while read -r device; do +find -L /sys/bus/usb/devices/ -maxdepth 2 -type f -name serial | while read -r device; do + basedir=$(dirname "${device}") + realpath_basedir=$(realpath "${basedir}") + basedir_name=$(basename "${basedir}") + #interface_dir="/sys/bus/usb/devices/${basedir_name}/${basedir_name}:1.*" + #ls -1d /sys/bus/usb/devices/${basedir_name}/${basedir_name}:1.* 2>/dev/null| while read -r interface; do + find -L "/sys/bus/usb/devices/${basedir_name}" -maxdepth 1 -mindepth 1 -type d -name "${basedir_name}:1.*" | while read -r interface; do + bInterfaceClass=$(cat "${interface}/bInterfaceClass") + bInterfaceSubClass=$(cat "${interface}/bInterfaceSubClass") + bInterfaceProtocol=$(cat "${interface}/bInterfaceProtocol") + if [ "X${bInterfaceClass}" = "Xff" ] && \ + [ "X${bInterfaceSubClass}" = "X42" ] && \ + [ "X${bInterfaceProtocol}" = "X03" ]; then + + devnum=$(cat "${interface}/devnum") + busnum=$(cat "${interface}/busnum") + serial=$(cat "${device}") + if [ ! -f "${interface}/interface" ]; then + echo "${serial} no-interface-fastboot ${device}" + + fastboot_devices="${fastboot_devices} ${realpath_basedir}" + + busnum=$(printf "%03d" "${busnum}") + devnum=$(printf "%03d" "${devnum}") + devpath="/dev/bus/usb/${busnum}/${devnum}" + devpaths="${devpaths} ${devpath}" + else + echo "${serial} interface-$(cat "${interface}/interface") ${device}" + fi + fi + done +done +echo "----fastboot devices list from /sys/bus/usb/devices end----" +echo "----fastboot devices list from fastboot devices command start----" +fastboot devices +echo "----fastboot devices list from fastboot devices command end----" +# check the owner and group of the android devices +echo "----list usb devices owner and group start----" +ls -l /dev/bus/usb/*/* +echo "----list usb devices owner and group end----" diff --git a/automated/android/noninteractive-tradefed/tradefed.yaml b/automated/android/noninteractive-tradefed/tradefed.yaml index e707298..bb9a590 100644 --- a/automated/android/noninteractive-tradefed/tradefed.yaml +++ b/automated/android/noninteractive-tradefed/tradefed.yaml @@ -59,6 +59,7 @@ run: - cp -r ./${TEST_PATH}/logs ./output/ || true # Include logs dumped from TF shell 'd l' command. - if ls /tmp/tradefed*; then cp -r /tmp/tradefed* ./output || true; fi + - dmesg > ./output/dmesg-host.txt - tar caf tradefed-output-$(date +%Y%m%d%H%M%S).tar.xz ./output - ATTACHMENT=$(ls tradefed-output-*.tar.xz) - ../../utils/upload-to-artifactorial.sh -a "${ATTACHMENT}" -u "${URL}" -t "${TOKEN}" @@ -66,6 +67,6 @@ run: - ../../utils/send-to-lava.sh ./output/result.txt - userdel testuser -f -r || true # When adb device lost, end test job to mark it as 'incomplete'. - - if ! adb shell echo ok; then error_fatal "tradefed - adb device lost[$ANDROID_SERIAL]"; fi + - 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 |