summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2017-11-16 02:41:15 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2017-11-16 02:41:15 +0800
commit4489e1988bc39d765e46576ced8c4839c7547b4a (patch)
tree9d18ee85720ef5a45f68ec0256431069e726a012
parent9c509b311fe3570dc1611455309a1c8c42ef7212 (diff)
tradefed: add debug information
Change-Id: Id051def1d069c6377449d7093d23070f74c4bedf Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-xautomated/android/tradefed/tradefed-runner.py3
-rwxr-xr-xautomated/android/tradefed/tradefed.sh8
-rw-r--r--automated/android/tradefed/tradefed.yaml8
3 files changed, 16 insertions, 3 deletions
diff --git a/automated/android/tradefed/tradefed-runner.py b/automated/android/tradefed/tradefed-runner.py
index b0c5d77..ebf9b26 100755
--- a/automated/android/tradefed/tradefed-runner.py
+++ b/automated/android/tradefed/tradefed-runner.py
@@ -164,6 +164,9 @@ while child.isalive():
adb_command = "adb shell echo OK"
adb_check = subprocess.Popen(shlex.split(adb_command))
if adb_check.wait() != 0:
+ logger.debug('adb connection lost! Trying to dump logs of all invocations...')
+ child.sendline('d l')
+ time.sleep(30)
subprocess.call(['sh', '-c', '. ../../lib/sh-test-lib && . ../../lib/android-test-lib && adb_debug_info'])
logger.debug('"adb devices" output')
subprocess.call(['adb', 'devices'])
diff --git a/automated/android/tradefed/tradefed.sh b/automated/android/tradefed/tradefed.sh
index 31f64e7..60cabbd 100755
--- a/automated/android/tradefed/tradefed.sh
+++ b/automated/android/tradefed/tradefed.sh
@@ -54,14 +54,22 @@ java -version
# Download CTS/VTS test package or copy it from local disk.
if echo "${TEST_URL}" | grep "^http" ; then
+ df -h
+ ls -l ./*
wget -S --progress=dot:giga "${TEST_URL}"
else
cp "${TEST_URL}" ./
fi
+echo "before run basename"
file_name=$(basename "${TEST_URL}")
+
+echo "before run unzip"
+pwd
+ls -l ./*
unzip -q "${file_name}"
rm -f "${file_name}"
+echo "after run unzip"
if [ -d "${TEST_PATH}/results" ]; then
mv "${TEST_PATH}/results" "${TEST_PATH}/results_$(date +%Y%m%d%H%M%S)"
fi
diff --git a/automated/android/tradefed/tradefed.yaml b/automated/android/tradefed/tradefed.yaml
index 235078c..d9db822 100644
--- a/automated/android/tradefed/tradefed.yaml
+++ b/automated/android/tradefed/tradefed.yaml
@@ -37,16 +37,18 @@ run:
- . ./setup.sh
- echo "after ./setup.sh"
# delete the test user to clean environment
- - sudo userdel testuser -r -f || true
+ - userdel testuser -r -f || true
# create test use to run the cts/vts tests
- - sudo useradd -m testuser && echo "testuser created successfully"
+ - useradd -m testuser && echo "testuser created successfully"
- sudo -u testuser ./tradefed.sh -o "${TIMEOUT}" -c "${TEST_URL}" -t "${TEST_PARAMS}" -p "${TEST_PATH}" -r "${RESULTS_FORMAT}" -n "${ANDROID_SERIAL}"
# Upload test log and result files to artifactorial.
- cp -r ./${TEST_PATH}/results ./output/ || true
- 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
- 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}"
# Send test result to LAVA.
- ../../utils/send-to-lava.sh ./output/result.txt
- - sudo userdel testuser -f -r || true
+ - userdel testuser -f -r || true