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

Subscribers

People subscribed via source and target branches