Merge lp:~deeptik/lava-test/openposix into lp:lava-test/0.0

Proposed by Deepti B. Kalakeri
Status: Merged
Merged at revision: 33
Proposed branch: lp:~deeptik/lava-test/openposix
Merge into: lp:lava-test/0.0
Diff against target: 71 lines (+67/-0)
1 file modified
abrek/test_definitions/posixtestsuite.py (+67/-0)
To merge this branch: bzr merge lp:~deeptik/lava-test/openposix
Reviewer Review Type Date Requested Status
Paul Larson (community) Approve
Deepti B. Kalakeri (community) Needs Resubmitting
Review via email: mp+36014@code.launchpad.net

Description of the change

This patch automates the installation, execution, and parsing of posix test suite. This patch has been tested on Manderick for installation/execution and parsing of results.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

Please add the boilerplate gpl3 + linaro copyright at the top of the file. You can just copy/paste out of another file.

18 +URL="http://sourceforge.net/projects/posixtest/files/posixtest/" \
19 + "posixtestsuite-%s/posixtestsuite-%s.tar.gz" % (VERSION, VERSION)
You may actually want to look at grabbing the LTP source rather than openposix. One thing I noticed is that openposix hasn't had a release since 2006, but several fixes have gone into the LTP version since then.

23 +PATTERN = "((?P<test_case_id>\A(\w+[/]+)+(\d+[-]\d+):) (?P<message>\D+:)" \
24 + " (?P<result>\D+))"
this results in build, link, execution, etc being the "message". Is that what you intend? You don't have to have a message, and it might make more sense for this to be combined with the test_case_id. Not sure. I'll leave it to your judgement here as to what you think makes sense, based on looking at posixtest results.

46 + results[key] = results[key].rstrip("\n")
47 + results[key] = results[key].rstrip(":")
48 + results[key] = results[key].rstrip()
All this should not be necessary, adjust your regexp so that extraneous characters are outside of the ()'s

51 + self.results['test_results'].append(results)
This is causing you to get double entries for each test result

50 + results['test_case_id'] = test_case_id.replace("/", ".")
For bonus points, this is something we're going to have a problem with in other tests as well. I was just looking at this last week in relation to another test. I think we may be better off here making some changes to the way results are gathered to check for things like this, and handle bad characters automatically. That way, fewer tests would have to extend the AbrekResultsParser class. Feel free to take a look at this if you like, otherwise we can come back and fix this test once it's done.

review: Needs Fixing
Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

> Please add the boilerplate gpl3 + linaro copyright at the top of the file.
> You can just copy/paste out of another file.
>

Ok I was not aware of this. I will do it.

> 18 +URL="http://sourceforge.net/projects/posixtest/files/posixtest/" \
> 19 + "posixtestsuite-%s/posixtestsuite-%s.tar.gz" % (VERSION, VERSION)
> You may actually want to look at grabbing the LTP source rather than
> openposix. One thing I noticed is that openposix hasn't had a release since
> 2006, but several fixes have gone into the LTP version since then.
>
Ok I will try the posix test suite available with the ltp.

> 23 +PATTERN = "((?P<test_case_id>\A(\w+[/]+)+(\d+[-]\d+):)
> (?P<message>\D+:)" \
> 24 + " (?P<result>\D+))"
> this results in build, link, execution, etc being the "message". Is that what
> you intend? You don't have to have a message, and it might make more sense
> for this to be combined with the test_case_id. Not sure. I'll leave it to
> your judgement here as to what you think makes sense, based on looking at
> posixtest results.

I ran the posix test suite available with the ltp today and the results are recorded in a different format than previously, so I will have to change the regex. I will also check if keeping the message will make sense.
>
> 46 + results[key] = results[key].rstrip("\n")
> 47 + results[key] = results[key].rstrip(":")
> 48 + results[key] = results[key].rstrip()
> All this should not be necessary, adjust your regexp so that extraneous
> characters are outside of the ()'s

Will try to include this in the regex.
>
> 51 + self.results['test_results'].append(results)
> This is causing you to get double entries for each test result
>
oops! I did not notice this. Thanks for catching this.

> 50 + results['test_case_id'] = test_case_id.replace("/", ".")
> For bonus points, this is something we're going to have a problem with in
> other tests as well. I was just looking at this last week in relation to
> another test. I think we may be better off here making some changes to the
> way results are gathered to check for things like this, and handle bad
> characters automatically. That way, fewer tests would have to extend the
> AbrekResultsParser class. Feel free to take a look at this if you like,
> otherwise we can come back and fix this test once it's done.

lp:~deeptik/lava-test/openposix updated
32. By Deepti B. Kalakeri

Script to automate installation, execution, and parsing of posix test suite

Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

This patch addresses the review comments and includes the following changes:

1) Added the boilerplate gpl3 + linaro copyright
2) Modified the patch to include the openposix testsuite that is part of ltp
3) Improved the Regular expression to take care of the new format of the logs that is generated by openposix present in ltp
4) Verified that the parsing does not report duplicate records.

review: Needs Resubmitting
Revision history for this message
Paul Larson (pwlars) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'abrek/test_definitions/posixtestsuite.py'
2--- abrek/test_definitions/posixtestsuite.py 1970-01-01 00:00:00 +0000
3+++ abrek/test_definitions/posixtestsuite.py 2010-09-22 12:52:45 +0000
4@@ -0,0 +1,67 @@
5+# Copyright (c) 2010 Linaro
6+#
7+# This program is free software: you can redistribute it and/or modify
8+# it under the terms of the GNU General Public License as published by
9+# the Free Software Foundation, either version 3 of the License, or
10+# (at your option) any later version.
11+#
12+# This program is distributed in the hope that it will be useful,
13+# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+# GNU General Public License for more details.
16+#
17+# You should have received a copy of the GNU General Public License
18+# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
20+"""
21+ This script automates the automate installation, execution, and
22+ results parsing for the OpenPosix test suite.
23+ The POSIX Test Suite is an open source test suite with the goal of
24+ performing conformance, functional, and stress testing of the IEEE
25+ 1003.1-2001 System Interfaces specification However the automation here
26+ does not support the stress test runs.
27+
28+"""
29+import re
30+import abrek.testdef
31+
32+VERSION="20100831"
33+URL= "http://downloads.sourceforge.net/project/ltp/LTP Source/ltp-%s/"\
34+ "ltp-full-%s.bz2" % (VERSION, VERSION)
35+MD5="6982c72429a62f3917c13b2d529ad1ce"
36+INSTALLSTEPS = ['tar -xjf ltp-full-20100831.bz2']
37+RUNSTEPS = ['cd ltp-full-20100831/testcases/open_posix_testsuite/ && make']
38+
39+PATTERN = "((?P<test_case_id>\A(\w+[/]+)+\w+[-]*\w*[-]*\w*) .*? (?P<result>\w+))"
40+FIXUPS = {
41+ "FAILED" : "fail",
42+ "INTERRUPTED" : "skip",
43+ "PASSED" : "pass",
44+ "UNRESOLVED" : "unknown",
45+ "UNSUPPORTED" : "skip",
46+ "UNTESTED" : "skip",
47+ "SKIPPING" : "skip"
48+ }
49+
50+
51+class PosixParser(abrek.testdef.AbrekTestParser):
52+ def parse(self):
53+ filename = "testoutput.log"
54+ pat = re.compile(self.pattern)
55+ with open(filename, 'r') as fd:
56+ for line in fd.readlines():
57+ match = pat.match(line)
58+ if match:
59+ results = match.groupdict()
60+ test_case_id = results['test_case_id']
61+ results['test_case_id'] = test_case_id.replace("/", ".")
62+ self.results['test_results'].append(results)
63+ if self.fixupdict:
64+ self.fixresults(self.fixupdict)
65+
66+posix_inst = abrek.testdef.AbrekTestInstaller(INSTALLSTEPS, url=URL, md5=MD5)
67+posix_run = abrek.testdef.AbrekTestRunner(RUNSTEPS)
68+posixparser = PosixParser(PATTERN, fixupdict = FIXUPS)
69+testobj = abrek.testdef.AbrekTest(testname="posixtestsuite", version=VERSION,
70+ installer=posix_inst, runner=posix_run,
71+ parser=posixparser)

Subscribers

People subscribed via source and target branches