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

Subscribers

People subscribed via source and target branches