Merge lp:~le-chi-thu/lava-test/add-ltp-snowball-tests into lp:lava-test/0.0

Proposed by Le Chi Thu
Status: Merged
Merged at revision: 141
Proposed branch: lp:~le-chi-thu/lava-test/add-ltp-snowball-tests
Merge into: lp:lava-test/0.0
Diff against target: 119 lines (+86/-0)
3 files modified
doc/tests.rst (+5/-0)
lava_test/core/providers.py (+1/-0)
lava_test/test_definitions/ltp-snowball-tests.py (+80/-0)
To merge this branch: bzr merge lp:~le-chi-thu/lava-test/add-ltp-snowball-tests
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+100766@code.launchpad.net

Description of the change

Added Snowball LTP test cases.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looks good, nice work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/tests.rst'
--- doc/tests.rst 2012-03-22 13:45:31 +0000
+++ doc/tests.rst 2012-04-04 10:41:22 +0000
@@ -17,6 +17,7 @@
17 * `insanity`_17 * `insanity`_
18 * `leb-basic-graphics`_18 * `leb-basic-graphics`_
19 * `ltp`_19 * `ltp`_
20 * `ltp-snowball-tests`_
20 * `lttng`_21 * `lttng`_
21 * `peacekeeper`_22 * `peacekeeper`_
22 * `perf`_23 * `perf`_
@@ -74,6 +75,10 @@
74+++75+++
75.. automodule:: lava_test.test_definitions.ltp76.. automodule:: lava_test.test_definitions.ltp
7677
78ltp-snowball-tests
79+++
80.. automodule:: lava_test.test_definitions.ltp-snowball-tests
81
77lttng82lttng
78+++++83+++++
79.. automodule:: lava_test.test_definitions.lttng84.. automodule:: lava_test.test_definitions.lttng
8085
=== modified file 'lava_test/core/providers.py'
--- lava_test/core/providers.py 2012-03-22 13:45:31 +0000
+++ lava_test/core/providers.py 2012-04-04 10:41:22 +0000
@@ -38,6 +38,7 @@
38 'gtkperf',38 'gtkperf',
39 'leb_basic_graphics',39 'leb_basic_graphics',
40 'ltp',40 'ltp',
41 'ltp-snowball-tests',
41 'lttng',42 'lttng',
42 'peacekeeper',43 'peacekeeper',
43 'perf',44 'perf',
4445
=== added file 'lava_test/test_definitions/ltp-snowball-tests.py'
--- lava_test/test_definitions/ltp-snowball-tests.py 1970-01-01 00:00:00 +0000
+++ lava_test/test_definitions/ltp-snowball-tests.py 2012-04-04 10:41:22 +0000
@@ -0,0 +1,80 @@
1# Copyright (c) 2010-2012 Linaro
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation, either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16"""
17Snowball specific kernel tests using LTP test framework.
18
19**URL:** http://www.igloocommunity.org/gitweb/?p=testing/snowball-ltp-tests.git;a=summary
20
21**Default options:** dma
22"""
23
24import re
25
26from lava_test.core.installers import TestInstaller
27from lava_test.core.parsers import TestParser
28from lava_test.core.runners import TestRunner
29from lava_test.core.tests import Test
30
31INSTALLSTEPS = ['git clone git://igloocommunity.org/git/testing/snowball-ltp-tests.git',
32 'cd snowball-ltp-tests; make tests; make install']
33
34DEPS = ['git-core', 'make', 'build-essential']
35
36RUNSTEPS = ['cd snowball-ltp-tests/build/opt/ltp && sudo ./runltp -q -p -f $(OPTIONS)']
37
38DEFAULT_OPTIONS = "dma"
39
40PATTERN = (
41 "^(?P<test_case_id>\S+)"
42 "\s*(?P<subid>\d+)"
43 "\s*(?P<result>\w+)"
44 "\s*:\s*(?P<message>.+)")
45FIXUPS = {
46 "TBROK": "fail",
47 "TCONF": "skip",
48 "TFAIL": "fail",
49 "TINFO": "unknown",
50 "TPASS": "pass",
51 "TWARN": "unknown"}
52
53class LTPParser(TestParser):
54
55 def parse(self, artifacts):
56 filename = artifacts.stdout_pathname
57 pat = re.compile(self.pattern)
58 with open(filename, 'r') as fd:
59 for line in fd.readlines():
60 match = pat.search(line)
61 if match:
62 results = match.groupdict()
63 subid = results.pop('subid')
64 #The .0 results in ltp are all TINFO, filtering them
65 #should help eliminate meaningless, duplicate results
66 if subid == '0':
67 continue
68 results['test_case_id'] += "." + subid
69 self.results['test_results'].append(
70 self.analyze_test_result(results))
71
72installer = TestInstaller(INSTALLSTEPS, deps=DEPS)
73runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
74parser = LTPParser(PATTERN, fixupdict=FIXUPS)
75
76testobj = Test(
77 test_id="ltp-snowball-tests",
78 installer=installer,
79 runner=runner,
80 parser=parser)

Subscribers

People subscribed via source and target branches