Merge lp:~pundiramit/lava-android-test/bctest into lp:lava-android-test

Proposed by Amit Pundir
Status: Merged
Merged at revision: 238
Proposed branch: lp:~pundiramit/lava-android-test/bctest
Merge into: lp:lava-android-test
Diff against target: 53 lines (+49/-0)
1 file modified
lava_android_test/test_definitions/bctest.py (+49/-0)
To merge this branch: bzr merge lp:~pundiramit/lava-android-test/bctest
Reviewer Review Type Date Requested Status
Yongqin Liu Approve
Review via email: mp+149857@code.launchpad.net

Description of the change

Adding binder test "bctest" available on Juice Android builds.

To post a comment you must log in.
Revision history for this message
Amit Pundir (pundiramit) wrote :

Please verify if I have used the right PATTERN to parse the results.

PATTERN = "(?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"

In case of success, STOUT is:
LAVA: (stdout) binder: ioctl PASS
LAVA: (stdout) binder_write: ioctl PASS

In case of failure, STDOUT is:
LAVA: (stdout) binder: ioctl FAIL (invalid argument)
LAVA: (stdout) binder_write: ioctl FAIL (invalid argument)

Revision history for this message
Antonio Terceiro (terceiro) wrote :

On Thu, Feb 21, 2013 at 03:17:21PM -0000, Amit Pundir wrote:
> Please verify if I have used the right PATTERN to parse the results.
>
> PATTERN = "(?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"
>
> In case of success, STOUT is:
> LAVA: (stdout) binder: ioctl PASS
> LAVA: (stdout) binder_write: ioctl PASS
>
> In case of failure, STDOUT is:
> LAVA: (stdout) binder: ioctl FAIL (invalid argument)
> LAVA: (stdout) binder_write: ioctl FAIL (invalid argument)

With this expression, test_case_id will be something like
'LAVA: (stdout) binder: ioctl'

Is that what you want? It seems to me that the 'LAVA: (stdout)'
is not useful to have

If you try

PATTERN = "LAVA: \(stdout\) (?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"

then you get those bits out (i.e. test_case_id will be 'binder: ioctl')

--
Antonio Terceiro
Software Engineer - Linaro
http://www.linaro.org

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> On Thu, Feb 21, 2013 at 03:17:21PM -0000, Amit Pundir wrote:
> > Please verify if I have used the right PATTERN to parse the results.
> >
> > PATTERN = "(?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"
> >
> > In case of success, STOUT is:
> > LAVA: (stdout) binder: ioctl PASS
> > LAVA: (stdout) binder_write: ioctl PASS
> >
> > In case of failure, STDOUT is:
> > LAVA: (stdout) binder: ioctl FAIL (invalid argument)
> > LAVA: (stdout) binder_write: ioctl FAIL (invalid argument)
>
> With this expression, test_case_id will be something like
> 'LAVA: (stdout) binder: ioctl'

I guess this output is gotten from lava-android-test command.
LAVA: (stdout) should be the output of lava-android-test framework.

the output of bctest is something like this I think:
binder: ioctl PASS
binder_write: ioctl PASS

So for this test it's ok for me.

Hi, Amit
but I want to know why you don't implement it with lava-test-shell?

And if you still want to use lava-android-test, then I suggest creating a file like:
http://bazaar.launchpad.net/~linaro-validation/lava-android-test/trunk/view/head:/lava_android_test/test_definitions/commands/example.py

> Is that what you want? It seems to me that the 'LAVA: (stdout)'
> is not useful to have
>
> If you try
>
> PATTERN = "LAVA: \(stdout\)
> (?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"
>
> then you get those bits out (i.e. test_case_id will be 'binder: ioctl')
>
> --
> Antonio Terceiro
> Software Engineer - Linaro
> http://www.linaro.org

Revision history for this message
Amit Pundir (pundiramit) wrote :

On 25 February 2013 20:01, Yongqin Liu <email address hidden> wrote:

> > On Thu, Feb 21, 2013 at 03:17:21PM -0000, Amit Pundir wrote:
> > > Please verify if I have used the right PATTERN to parse the results.
> > >
> > > PATTERN = "(?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"
> > >
> > > In case of success, STOUT is:
> > > LAVA: (stdout) binder: ioctl PASS
> > > LAVA: (stdout) binder_write: ioctl PASS
> > >
> > > In case of failure, STDOUT is:
> > > LAVA: (stdout) binder: ioctl FAIL (invalid argument)
> > > LAVA: (stdout) binder_write: ioctl FAIL (invalid argument)
> >
> > With this expression, test_case_id will be something like
> > 'LAVA: (stdout) binder: ioctl'
>
> I guess this output is gotten from lava-android-test command.
> LAVA: (stdout) should be the output of lava-android-test framework.
>
> the output of bctest is something like this I think:
> binder: ioctl PASS
> binder_write: ioctl PASS
>

Yes as mentioned by Yongqin, "LAVA: (stdout) " is an output from lava
framework and it get filtered out internally. Test result bundle will look
like:

...<snip>...
"test_results": [
        {
          "log_filename": "stdout.log",
          "log_lineno": 1,
          "test_case_id": "binder_ioctl",
          "result": "pass"
        },
        {
          "log_filename": "stdout.log",
          "log_lineno": 2,
          "test_case_id": "binder_write_ioctl",
          "result": "pass"
        }
      ],
...<snip>...

>
> So for this test it's ok for me.
>
> Hi, Amit
> but I want to know why you don't implement it with lava-test-shell?
>

I have also submitted a patch for bctest implementation with
lava-test-shell to Senthil.

>
> And if you still want to use lava-android-test, then I suggest creating a
> file like:
>
> http://bazaar.launchpad.net/~linaro-validation/lava-android-test/trunk/view/head:/lava_android_test/test_definitions/commands/example.py

If this is the way to go then I'll implement it this way. But I do not see
how can I use "DEFAULT_OPTIONS" feature in any of the examples there?

>
> > Is that what you want? It seems to me that the 'LAVA: (stdout)'
> > is not useful to have
> >
> > If you try
> >
> > PATTERN = "LAVA: \(stdout\)
> > (?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"
> >
> > then you get those bits out (i.e. test_case_id will be 'binder: ioctl')
> >
> > --
> > Antonio Terceiro
> > Software Engineer - Linaro
> > http://www.linaro.org
> --
>
> https://code.launchpad.net/~pundiramit/lava-android-test/bctest/+merge/149857
> You are the owner of lp:~pundiramit/lava-android-test/bctest.
>

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> On 25 February 2013 20:01, Yongqin Liu <email address hidden> wrote:
>
> > > On Thu, Feb 21, 2013 at 03:17:21PM -0000, Amit Pundir wrote:
> > > > Please verify if I have used the right PATTERN to parse the results.
> > > >
> > > > PATTERN = "(?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"
> > > >
> > > > In case of success, STOUT is:
> > > > LAVA: (stdout) binder: ioctl PASS
> > > > LAVA: (stdout) binder_write: ioctl PASS
> > > >
> > > > In case of failure, STDOUT is:
> > > > LAVA: (stdout) binder: ioctl FAIL (invalid argument)
> > > > LAVA: (stdout) binder_write: ioctl FAIL (invalid argument)
> > >
> > > With this expression, test_case_id will be something like
> > > 'LAVA: (stdout) binder: ioctl'
> >
> > I guess this output is gotten from lava-android-test command.
> > LAVA: (stdout) should be the output of lava-android-test framework.
> >
> > the output of bctest is something like this I think:
> > binder: ioctl PASS
> > binder_write: ioctl PASS
> >
>
> Yes as mentioned by Yongqin, "LAVA: (stdout) " is an output from lava
> framework and it get filtered out internally. Test result bundle will look
> like:
>
> ...<snip>...
> "test_results": [
> {
> "log_filename": "stdout.log",
> "log_lineno": 1,
> "test_case_id": "binder_ioctl",
> "result": "pass"
> },
> {
> "log_filename": "stdout.log",
> "log_lineno": 2,
> "test_case_id": "binder_write_ioctl",
> "result": "pass"
> }
> ],
> ...<snip>...
>
>
> >
> > So for this test it's ok for me.
> >
> > Hi, Amit
> > but I want to know why you don't implement it with lava-test-shell?
> >
>
> I have also submitted a patch for bctest implementation with
> lava-test-shell to Senthil.
>
>
> >
> > And if you still want to use lava-android-test, then I suggest creating a
> > file like:
> >
> > http://bazaar.launchpad.net/~linaro-validation/lava-android-
> test/trunk/view/head:/lava_android_test/test_definitions/commands/example.py
>
>
> If this is the way to go then I'll implement it this way. But I do not see
> how can I use "DEFAULT_OPTIONS" feature in any of the examples there?
For support the DEFAULT_OPTIONS in the commands, there need some more modification on other files.
Well, it's OK now, I approve this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'lava_android_test/test_definitions/bctest.py'
2--- lava_android_test/test_definitions/bctest.py 1970-01-01 00:00:00 +0000
3+++ lava_android_test/test_definitions/bctest.py 2013-02-21 15:13:24 +0000
4@@ -0,0 +1,49 @@
5+# Copyright (c) 2012 Linaro
6+
7+# Author: Linaro Android Team <linaro-android@lists.linaro.org>
8+#
9+# This file is part of LAVA Android Test.
10+#
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU General Public License as published by
14+# the Free Software Foundation, either version 3 of the License, or
15+# (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU General Public License for more details.
21+#
22+# You should have received a copy of the GNU General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+
25+"""
26+binder test "bctest" that is pre-intalled on Juice Android builds.
27+
28+**URL:** https://wiki.linaro.org/Internal/Projects/Juice
29+
30+**Default options:** "publish 1"
31+"""
32+
33+import lava_android_test.config
34+import lava_android_test.testdef
35+
36+test_name = 'bctest'
37+
38+DEFAULT_OPTIONS='publish 1'
39+
40+INSTALL_STEPS_ADB_PRE = []
41+ADB_SHELL_STEPS = ['bctest $(OPTIONS)']
42+PATTERN = "(?P<test_case_id>.*ioctl)\s(?P<result>(PASS|FAIL)?).*"
43+
44+inst = lava_android_test.testdef.AndroidTestInstaller(
45+ steps_adb_pre=INSTALL_STEPS_ADB_PRE)
46+run = lava_android_test.testdef.AndroidTestRunner(
47+ adbshell_steps=ADB_SHELL_STEPS)
48+parser = lava_android_test.testdef.AndroidTestParser(PATTERN)
49+testobj = lava_android_test.testdef.AndroidTest(testname=test_name,
50+ installer=inst,
51+ runner=run,
52+ parser=parser,
53+ default_options=DEFAULT_OPTIONS)

Subscribers

People subscribed via source and target branches