diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2014-11-19 17:06:51 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2014-11-19 17:06:51 +0800 |
commit | e5678c1ebc4289de427b672ce1392eed520c67ac (patch) | |
tree | 320ab6f67d8ff4738e5796401c659fa8de68461e | |
parent | bb142bef3ee428eb8b4517ed95c406dd18e39bb9 (diff) |
android boottime test: simple test for collecting boot time
add this simple test to colloect the android boot time
from logcat.
Change-Id: I56f3cb2696d636d7606005eb075501e077146db4
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | android/boottime.yaml | 22 | ||||
-rw-r--r-- | android/scripts/boottime.sh | 34 |
2 files changed, 56 insertions, 0 deletions
diff --git a/android/boottime.yaml b/android/boottime.yaml new file mode 100644 index 0000000..15e86f4 --- /dev/null +++ b/android/boottime.yaml @@ -0,0 +1,22 @@ +metadata: + name: android_boottime + format: "Lava-Test-Shell Test Definition 1.0" + description: "Collect android boot time from logcat, should be run after boot completed" + maintainer: + - yongqin.liu@linaro.org + os: + - android + scope: + - functional + devices: + - juno + +params: + BLACK_LIST: "/data/juno_monkey_blacklist" + EVENT_COUNT: "30000" + +run: + steps: + - ./android/scripts/boottime.sh +parse: + pattern: "(?P<test_case_id>boot_time):\\s(?P<result>(pass|fail)\\s(?P<measurement>\\d+)\\s(?P<units>ms)" diff --git a/android/scripts/boottime.sh b/android/scripts/boottime.sh new file mode 100644 index 0000000..675aa0f --- /dev/null +++ b/android/scripts/boottime.sh @@ -0,0 +1,34 @@ +#!/system/bin/sh +# +# boot time test. +# +# Copyright (C) 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Author: Yongqin Liu <yongqin.liu@linaro.org> +# +# Use the following information in logcat to record the android boot time +# I/SurfaceFlinger( 683): Boot is finished (91104 ms) + +time_info=$(logcat -d -s SurfaceFlinger:I|grep -q "Boot is finished") +if [ -z "${time_info}" ]; then + echo "boot_time: fail xx ms" + exit 1 +fi +time_value=$(echo "${time_info}"|cut -d\( -f3) +time_value=$(echo ${time_value}|cut -d\ -f1) +echo "boot_time: pass ${time_value} ms" +exit 0 |