diff mbox

[Branch,~linaro-validation/lava-test/trunk] Rev 141: Added Snowball LTP test cases

Message ID 20120404140111.20346.63220.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki April 4, 2012, 2:01 p.m. UTC
Merge authors:
  Le Chi Thu le.chi.thu@linaro.org <le.chi.thu@linaro.org>
Related merge proposals:
  https://code.launchpad.net/~le-chi-thu/lava-test/add-ltp-snowball-tests/+merge/100766
  proposed by: Le Chi Thu (le-chi-thu)
  review: Approve - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 141 [merge]
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: trunk
timestamp: Wed 2012-04-04 15:59:45 +0200
message:
  Added Snowball LTP test cases
added:
  lava_test/test_definitions/ltp-snowball-tests.py
modified:
  doc/tests.rst
  lava_test/core/providers.py


--
lp:lava-test
https://code.launchpad.net/~linaro-validation/lava-test/trunk

You are subscribed to branch lp:lava-test.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-test/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'doc/tests.rst'
--- doc/tests.rst	2012-03-22 13:45:31 +0000
+++ doc/tests.rst	2012-04-04 08:36:39 +0000
@@ -17,6 +17,7 @@ 
  * `insanity`_
  * `leb-basic-graphics`_
  * `ltp`_
+ * `ltp-snowball-tests`_
  * `lttng`_
  * `peacekeeper`_
  * `perf`_
@@ -74,6 +75,10 @@ 
 +++
 .. automodule:: lava_test.test_definitions.ltp
 
+ltp-snowball-tests
++++
+.. automodule:: lava_test.test_definitions.ltp-snowball-tests
+
 lttng
 +++++
 .. automodule:: lava_test.test_definitions.lttng

=== 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 08:36:39 +0000
@@ -38,6 +38,7 @@ 
         'gtkperf',
         'leb_basic_graphics',
         'ltp',
+        'ltp-snowball-tests',
         'lttng',
         'peacekeeper',
         'perf',

=== 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:19:07 +0000
@@ -0,0 +1,80 @@ 
+# Copyright (c) 2010-2012 Linaro
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""
+Snowball specific kernel tests using LTP test framework.
+
+**URL:** http://www.igloocommunity.org/gitweb/?p=testing/snowball-ltp-tests.git;a=summary
+
+**Default options:** dma
+"""
+
+import re
+
+from lava_test.core.installers import TestInstaller
+from lava_test.core.parsers import TestParser
+from lava_test.core.runners import TestRunner
+from lava_test.core.tests import Test
+
+INSTALLSTEPS = ['git clone git://igloocommunity.org/git/testing/snowball-ltp-tests.git',
+                'cd snowball-ltp-tests; make tests; make install']
+
+DEPS = ['git-core', 'make', 'build-essential']
+
+RUNSTEPS = ['cd snowball-ltp-tests/build/opt/ltp && sudo ./runltp -q -p -f $(OPTIONS)']
+
+DEFAULT_OPTIONS = "dma"
+
+PATTERN = (
+    "^(?P<test_case_id>\S+)"
+    "\s*(?P<subid>\d+)"
+    "\s*(?P<result>\w+)"
+    "\s*:\s*(?P<message>.+)")
+FIXUPS = {
+    "TBROK": "fail",
+    "TCONF": "skip",
+    "TFAIL": "fail",
+    "TINFO": "unknown",
+    "TPASS": "pass",
+    "TWARN": "unknown"}
+
+class LTPParser(TestParser):
+
+    def parse(self, artifacts):
+        filename = artifacts.stdout_pathname
+        pat = re.compile(self.pattern)
+        with open(filename, 'r') as fd:
+            for line in fd.readlines():
+                match = pat.search(line)
+                if match:
+                    results = match.groupdict()
+                    subid = results.pop('subid')
+                    #The .0 results in ltp are all TINFO, filtering them
+                    #should help eliminate meaningless, duplicate results
+                    if subid == '0':
+                        continue
+                    results['test_case_id'] += "." + subid
+                    self.results['test_results'].append(
+                        self.analyze_test_result(results))
+
+installer = TestInstaller(INSTALLSTEPS, deps=DEPS)
+runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
+parser = LTPParser(PATTERN, fixupdict=FIXUPS)
+
+testobj = Test(
+    test_id="ltp-snowball-tests",
+    installer=installer,
+    runner=runner,
+    parser=parser)