diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2017-11-03 02:00:36 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2017-11-06 17:27:22 +0800 |
commit | d499435085699cd26a7b68ec5d14891e084f14ff (patch) | |
tree | bfb3fdd99da0824026e923f26144b74cad29e476 | |
parent | 98d74c6fac7285eab24021d5dd321d99a8c064fc (diff) |
android boottime: some improvements
1. support to analyze the first boot time information
2. move install of usbutils to others together
3. remove the cat of logfiles so that the job could be finished quickly
use sync to make sure all files stored on storage
4. set to install_deps skipped by default, so that we don't need to
specify when run manually
Change-Id: Ie95c4b7fef89c16a078d159e4dc1b6d364aea438
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-x | automated/android/boottime/boottime.sh | 7 | ||||
-rw-r--r-- | automated/android/boottime/boottime.yaml | 4 | ||||
-rwxr-xr-x | automated/android/boottime/device-script.sh | 25 |
3 files changed, 23 insertions, 13 deletions
diff --git a/automated/android/boottime/boottime.sh b/automated/android/boottime/boottime.sh index 1ddf3c5..93b6f4d 100755 --- a/automated/android/boottime/boottime.sh +++ b/automated/android/boottime/boottime.sh @@ -6,12 +6,13 @@ BOOT_TIMEOUT="300" OPERATION="COLLECT" COLLECT_NO="1" OUTPUT="$(pwd)/output" +SKIP_INSTALL='true' . ../../lib/sh-test-lib . ../../lib/android-test-lib usage() { - echo "Usage: $0 [-S <skip_install>] [-s <android_serial>] [-t <boot_timeout>] [-o <COLLECT|ANALYZE>] [-n <collect_no>]" 1>&2 + echo "Usage: $0 [-S skip_install <true|false>] [-s <android_serial>] [-t <boot_timeout>] [-o <COLLECT|ANALYZE>] [-n <collect_no>]" 1>&2 exit 1 } @@ -26,15 +27,13 @@ while getopts ":S:s:t:o:n:" o; do esac done -PKG_DEPS="usbutils" -install_deps "${PKG_DEPS}" initialize_adb # wait till the launcher displayed wait_homescreen "${BOOT_TIMEOUT}" create_out_dir "${OUTPUT}" -install_deps 'curl tar xz-utils' "${SKIP_INSTALL}" +install_deps 'curl tar xz-utils usbutils' "${SKIP_INSTALL}" adb_push "./device-script.sh" "/data/local/tmp/" info_msg "device-${ANDROID_SERIAL}: About to run boottime ${OPERATION} ${COLLECT_NO}..." diff --git a/automated/android/boottime/boottime.yaml b/automated/android/boottime/boottime.yaml index 14f7154..58f4a3d 100644 --- a/automated/android/boottime/boottime.yaml +++ b/automated/android/boottime/boottime.yaml @@ -18,6 +18,8 @@ metadata: - hi6220-hikey params: + # specify true or false to skip or not the installation of lxc packages + SKIP_INSTALL: "false" # Specify device serial no. when more than one device connected. ANDROID_SERIAL: "" # Specify timeout in seconds for wait_boot_completed. @@ -32,6 +34,6 @@ params: run: steps: - cd ./automated/android/boottime - - ./boottime.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" -o "${OPERATION}" -n "${COLLECT_NO}" + - ./boottime.sh -S "${SKIP_INSTALL}" -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" -o "${OPERATION}" -n "${COLLECT_NO}" - if [ "${OPERATION}" = "ANALYZE" ]; then ../../utils/upload-to-artifactorial.sh -a "output/boottime.tgz" -u "${URL}" -t "${TOKEN}"; fi - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/android/boottime/device-script.sh b/automated/android/boottime/device-script.sh index 46d5562..d2d74d7 100755 --- a/automated/android/boottime/device-script.sh +++ b/automated/android/boottime/device-script.sh @@ -402,22 +402,27 @@ 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:" + + # make sure to write all files to disk + sync + + echo "==============list of files under ${dir_boottime_data}/ starts from here:" ls -l ${dir_boottime_data}/* + echo "==============list of files under ${dir_boottime_data}/ ends from here:" elif [ "X${OPERATION}" = "XANALYZE" ]; then count=$2 + ## Check if there is any case that the surfaceflinger service ## was started several times - i=1 + if [ "${count}" -eq 0 ]; then + i=0 + else + i=1 + fi service_started_once=true no_boot_timeout_force_display=true while ${service_started_once}; do @@ -472,7 +477,11 @@ elif [ "X${OPERATION}" = "XANALYZE" ]; then fi if ${no_checking_problem}; then - i=1 + if [ "${count}" -eq 0 ]; then + i=0 + else + i=1 + fi G_RESULT_NOT_RECORD=TRUE G_RECORD_LOCAL_CSV=TRUE export G_RECORD_LOCAL_CSV G_RESULT_NOT_RECORD |