Merge lp:~kejun-zhou/lava-android-test/usbhardware into lp:lava-android-test

Proposed by Kejun ZHOU
Status: Superseded
Proposed branch: lp:~kejun-zhou/lava-android-test/usbhardware
Merge into: lp:lava-android-test
Diff against target: 80 lines (+62/-0)
3 files modified
MANIFEST.in (+2/-0)
lava_android_test/test_definitions/usbhardware.py (+47/-0)
lava_android_test/test_definitions/usbhardware/usbhardware.sh (+13/-0)
To merge this branch: bzr merge lp:~kejun-zhou/lava-android-test/usbhardware
Reviewer Review Type Date Requested Status
Yongqin Liu Pending
Review via email: mp+106953@code.launchpad.net

This proposal supersedes a proposal from 2012-05-02.

This proposal has been superseded by a proposal from 2012-05-24.

Description of the change

This test checks the value of "/sys/class/android_usb/android0/state" on Android system to show whether the USB port being used or not.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote : Posted in a previous version of this proposal

looks like you should just delete line 42:
+#PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+\.\d+)"

line 63: + echo "state=unexist"
should that be "echo usbhardware=fail" ?

Revision history for this message
Yongqin Liu (liuyq0307) wrote : Posted in a previous version of this proposal

1. lava_android_test/test_definitions/usbhardware/usbhardware.sh seems not work on android.
   when run it reports "[: /sys/class/android_usb/android0/state: unexpected operator/operand"
2. Panda board has normal usb ports and mini usb port two types

review: Needs Fixing

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2012-03-28 06:41:07 +0000
+++ MANIFEST.in 2012-05-23 07:39:27 +0000
@@ -7,3 +7,5 @@
7include lava_android_test/test_definitions/cts/*7include lava_android_test/test_definitions/cts/*
8include lava_android_test/test_definitions/glmark2/*8include lava_android_test/test_definitions/glmark2/*
9include lava_android_test/test_definitions/gatortest/*9include lava_android_test/test_definitions/gatortest/*
10include lava_android_test/test_definitions/usbhardware/*
11include lava_android_test/test_definitions/pm-qa/*
1012
=== added directory 'lava_android_test/test_definitions/usbhardware'
=== added file 'lava_android_test/test_definitions/usbhardware.py'
--- lava_android_test/test_definitions/usbhardware.py 1970-01-01 00:00:00 +0000
+++ lava_android_test/test_definitions/usbhardware.py 2012-05-23 07:39:27 +0000
@@ -0,0 +1,47 @@
1# Copyright (c) 2011 Linaro
2
3# Author: Linaro Validation Team <linaro-dev@lists.linaro.org>
4#
5# This file is part of LAVA Android Test.
6#
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20import os
21import lava_android_test.testdef
22from lava_android_test.config import get_config
23
24test_name = 'usbhardware'
25config = get_config()
26curdir = os.path.realpath(os.path.dirname(__file__))
27test_sh_name = 'usbhardware.sh'
28test_sh_path = os.path.join(curdir, test_name, test_sh_name)
29test_sh_android_path = os.path.join(config.installdir_android,
30 test_name, test_sh_name)
31
32INSTALL_STEPS_ADB_PRE = ['push %s %s ' % (test_sh_path,
33 test_sh_android_path),
34 'shell chmod 777 %s' % test_sh_android_path]
35
36ADB_SHELL_STEPS = [test_sh_android_path]
37PATTERN = "^\s*(?P<test_case_id>\w+)=(?P<result>\w+)\s*$"
38
39inst = lava_android_test.testdef.AndroidTestInstaller(
40 steps_adb_pre=INSTALL_STEPS_ADB_PRE)
41run = lava_android_test.testdef.AndroidTestRunner(
42 adbshell_steps=ADB_SHELL_STEPS)
43parser = lava_android_test.testdef.AndroidTestParser(PATTERN)
44testobj = lava_android_test.testdef.AndroidTest(testname=test_name,
45 installer=inst,
46 runner=run,
47 parser=parser)
048
=== added file 'lava_android_test/test_definitions/usbhardware/usbhardware.sh'
--- lava_android_test/test_definitions/usbhardware/usbhardware.sh 1970-01-01 00:00:00 +0000
+++ lava_android_test/test_definitions/usbhardware/usbhardware.sh 2012-05-23 07:39:27 +0000
@@ -0,0 +1,13 @@
1#!/system/bin/sh
2
3test_func(){
4 if [ ! -f /sys/class/android_usb/android0/state ]; then
5 echo "usbhardware=fail"
6 exit
7 fi
8
9 cat /sys/class/android_usb/android0/state
10 echo "usbhardware=pass"
11}
12
13test_func

Subscribers

People subscribed via source and target branches