aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2017-09-27 18:05:10 +0800
committerChase Qi <chase.qi@linaro.org>2017-09-28 19:42:20 +0800
commit595f5090ca2a1397955deee3ef8f5480bdb0ef01 (patch)
tree37416ddef90c8765e61bc41a74b816ea9aa173fe
parent5f374f6b67e08cb349891e86d5a8188b5633e79b (diff)
andorid automated boottime: some improvements
1. print more message for debug help to investigate why the analyse part is failed. some times the files collected lost when try to analyze like here: https://staging.validation.linaro.org/scheduler/job/191519#L13962 seems some problem there with the logcat_all_1.log file 2. add _avg suffix for the statistic result which we are interested in 3. ignore the case when grep keyword from logcat or dmesg 4. call disablesuspend.sh on device side to wait the launcher display log printed in logcat message Change-Id: I8006995397d407d7188a2137e8f4190bea86b4e0 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-xautomated/android/boottime/boottime.sh7
-rw-r--r--automated/android/boottime/boottime.yaml2
-rwxr-xr-xautomated/android/boottime/device-script.sh22
-rwxr-xr-xautomated/lib/android-test-lib14
4 files changed, 38 insertions, 7 deletions
diff --git a/automated/android/boottime/boottime.sh b/automated/android/boottime/boottime.sh
index 2d271c77..1ddf3c54 100755
--- a/automated/android/boottime/boottime.sh
+++ b/automated/android/boottime/boottime.sh
@@ -26,8 +26,13 @@ while getopts ":S:s:t:o:n:" o; do
esac
done
+PKG_DEPS="usbutils"
+install_deps "${PKG_DEPS}"
+
initialize_adb
-wait_boot_completed "${BOOT_TIMEOUT}"
+# wait till the launcher displayed
+wait_homescreen "${BOOT_TIMEOUT}"
+
create_out_dir "${OUTPUT}"
install_deps 'curl tar xz-utils' "${SKIP_INSTALL}"
diff --git a/automated/android/boottime/boottime.yaml b/automated/android/boottime/boottime.yaml
index 51bc5dfc..14f7154d 100644
--- a/automated/android/boottime/boottime.yaml
+++ b/automated/android/boottime/boottime.yaml
@@ -27,7 +27,7 @@ params:
COLLECT_NO: "1"
# Specify url and token for file uploading.
URL: "https://archive.validation.linaro.org/artifacts/team/qa/"
- TOKEN: "4373c97b474497dbd12373689d7d492e"
+ TOKEN: ""
run:
steps:
diff --git a/automated/android/boottime/device-script.sh b/automated/android/boottime/device-script.sh
index 90e17363..337889d8 100755
--- a/automated/android/boottime/device-script.sh
+++ b/automated/android/boottime/device-script.sh
@@ -262,7 +262,7 @@ getTime(){
return
fi
- key_line=$(grep "${key}" "${LOG_DMESG}")
+ key_line=$(grep -i "${key}" "${LOG_DMESG}")
if [ -n "${key_line}" ]; then
timestamp=$(echo "${key_line}"|awk '{print $2}' | awk -F "]" '{print $1}')
echo "${timestamp}"
@@ -277,7 +277,7 @@ getTimeStampFromLogcat(){
return
fi
- key_line=$(grep "${key}" "${LOG_LOGCAT_ALL}")
+ key_line=$(grep -i "${key}" "${LOG_LOGCAT_ALL}")
if [ -n "${key_line}" ]; then
timestamp_sec=$(echo "${key_line}"|awk '{print $2}' | awk -F ":" '{print $3}')
timestamp_min=$(echo "${key_line}"|awk '{print $2}' | awk -F ":" '{print $2}')
@@ -395,10 +395,17 @@ if [ "X${OPERATION}" = "XCOLLECT" ]; then
# shellcheck disable=SC2035
logcat -d -v time *:V > "${dir_boottime_data}/logcat_all_${COLLECT_NO}.log"
output_test_result "BOOTTIME_LOGCAT_ALL_COLLECT" "pass"
+ echo "==============content of the file ${dir_boottime_data}/logcat_all_${COLLECT_NO}.log start from here:"
+ cat "${dir_boottime_data}/logcat_all_${COLLECT_NO}.log"
+ echo "==============content of the file ${dir_boottime_data}/logcat_all_${COLLECT_NO}.log end here:"
logcat -d -b events -v time > "${dir_boottime_data}/logcat_events_${COLLECT_NO}.log"
output_test_result "BOOTTIME_LOGCAT_EVENTS_COLLECT" "pass"
dmesg > "${dir_boottime_data}/dmesg_${COLLECT_NO}.log"
output_test_result "BOOTTIME_DMESG_COLLECT" "pass"
+ echo "==============content of the file ${dir_boottime_data}/dmesg_${COLLECT_NO}.log start from here:"
+ cat "${dir_boottime_data}/dmesg_${COLLECT_NO}.log"
+ echo "==============content of the file ${dir_boottime_data}/dmesg_${COLLECT_NO}.log end here:"
+ ls -l ${dir_boottime_data}/*
elif [ "X${OPERATION}" = "XANALYZE" ]; then
count=$2
## Check if there is any case that the surfaceflinger service
@@ -416,6 +423,10 @@ elif [ "X${OPERATION}" = "XANALYZE" ]; then
if [ "${android_boottime_lines}" -ne 1 ]; then
echo "There are ${android_boottime_lines} existences of 'Boot is finished' in file: ${LOG_LOGCAT_ALL}"
echo "Please check the status first"
+ echo "==============content of the file ${LOG_LOGCAT_ALL} start from here:"
+ cat ${LOG_LOGCAT_ALL}
+ echo "==============content of the file ${LOG_LOGCAT_ALL} end from here:"
+
service_started_once=false
fi
@@ -430,8 +441,11 @@ elif [ "X${OPERATION}" = "XANALYZE" ]; then
## check the service of bootanim
bootanim_lines=$(grep -c "init: Service 'bootanim'.* exited with status" "${LOG_DMESG}")
if [ "${bootanim_lines}" -ne 1 ]; then
- echo "bootanim service seems to be started more than once in file: ${LOG_DMESG}"
+ echo "bootanim service seems to be started ${bootanim_lines} times in file: ${LOG_DMESG}"
echo "Please check the status first"
+ echo "==============content of the file ${LOG_DMESG} start from here:"
+ cat ${LOG_DMESG}
+ echo "==============content of the file ${LOG_DMESG} end from here:"
service_started_once=false
fi
i=$((i+1))
@@ -477,7 +491,7 @@ elif [ "X${OPERATION}" = "XANALYZE" ]; then
key=$(echo "$line"|cut -d, -f1)
measurement=$(echo "$line"|cut -d, -f2)
units=$(echo "$line"|cut -d, -f3)
- output_test_result "${key}" "pass" "${measurement}" "${units}"
+ output_test_result "${key}_avg" "pass" "${measurement}" "${units}"
done < "${F_STATISTIC_DATA_CSV}"
fi
diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib
index 16db841d..3c5e829d 100755
--- a/automated/lib/android-test-lib
+++ b/automated/lib/android-test-lib
@@ -93,9 +93,21 @@ wait_boot_completed() {
wait_homescreen() {
[ "$#" -ne 1 ] && error_msg "Usage: wait_homescreen timeout_in_seconds"
+
+ # call disablesuspend.sh if it exists
+ # on some builds, the launcher package might not be com.android.launcher,
+ # in this case we expect the build to have this disablesuspend.sh script
+ # which is used to check the display of homescreen.
+ # if there is not such disablesuspend.sh script, then use the default check
+ if adb_shell_which disablesuspend.sh; then
+ if adb shell /system/bin/disablesuspend.sh; then
+ info_msg "Target booted to homescreen successfully."
+ return
+ fi
+ fi
+
timeout="$1"
end=$(( $(date +%s) + timeout ))
-
homescreen_displayed=false
while [ "$(date +%s)" -lt "$end" ]; do
if adb logcat -sd ActivityManager:I | grep "Displayed com.android.launcher"; then