Merge lp:~pwlars/lava-test/ltp into lp:lava-test/0.0

Proposed by Paul Larson
Status: Merged
Merged at revision: 28
Proposed branch: lp:~pwlars/lava-test/ltp
Merge into: lp:lava-test/0.0
Diff against target: 72 lines (+56/-1)
2 files modified
abrek/test_definitions/ltp.py (+55/-0)
abrek/utils.py (+1/-1)
To merge this branch: bzr merge lp:~pwlars/lava-test/ltp
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+35495@code.launchpad.net

Description of the change

Add support for LTP in Abrek

To post a comment you must log in.
lp:~pwlars/lava-test/ltp updated
30. By Paul Larson

Forgot to remove that, oops :)

Revision history for this message
James Westby (james-w) wrote :

Hi,

This looks ok, assuming you have the LTP parts correct.

Thanks,

James

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

On Wed, 2010-09-15 at 20:50 +0000, James Westby wrote:
> Review: Approve
> Hi,
>
> This looks ok, assuming you have the LTP parts correct.
Yep, tested on my beagleboard last night
Thanks,
Paul Larson

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'abrek/test_definitions/ltp.py'
2--- abrek/test_definitions/ltp.py 1970-01-01 00:00:00 +0000
3+++ abrek/test_definitions/ltp.py 2010-09-15 03:48:46 +0000
4@@ -0,0 +1,55 @@
5+import re
6+
7+import abrek.testdef
8+
9+VERSION="20100831"
10+URL='http://downloads.sourceforge.net/project/ltp/LTP Source/ltp-%s/ltp-full-%s.bz2' % (VERSION, VERSION)
11+MD5="6982c72429a62f3917c13b2d529ad1ce"
12+DEPS = ['bzip2', 'flex', 'bison', 'make']
13+
14+SCRIPT = """
15+tar -xjf ltp-full-20100831.bz2
16+mkdir build
17+cd ltp-full-20100831
18+./configure --prefix=$(readlink -f ../build)
19+make all
20+SKIP_IDCHECK=1 make install
21+"""
22+
23+INSTALLSTEPS = ["echo '%s' > installltp.sh" % SCRIPT,
24+ 'chmod +x installltp.sh',
25+ './installltp.sh']
26+RUNSTEPS = ['cd build && sudo ./runltp -f syscalls -p -q']
27+PATTERN = "^(?P<test_case_id>\S+) (?P<subid>\d+) (?P<result>\w+) : (?P<message>\S+)"
28+FIXUPS = {"TBROK":"fail",
29+ "TCONF":"skip",
30+ "TFAIL":"fail",
31+ "TINFO":"unknown",
32+ "TPASS":"pass",
33+ "TWARN":"unknown"}
34+
35+
36+class LTPParser(abrek.testdef.AbrekTestParser):
37+ def parse(self):
38+ filename = "testoutput.log"
39+ pat = re.compile(self.pattern)
40+ with open(filename, 'r') as fd:
41+ for line in fd.readlines():
42+ match = pat.search(line)
43+ if match:
44+ results = match.groupdict()
45+ results['test_case_id'] += "." + results.pop('subid')
46+ self.results['test_results'].append(results)
47+ if self.fixupdict:
48+ self.fixresults(self.fixupdict)
49+ if self.appendall:
50+ self.appendtoall(self.appendall)
51+
52+
53+ltpinst = abrek.testdef.AbrekTestInstaller(INSTALLSTEPS, deps=DEPS, url=URL,
54+ md5=MD5)
55+ltprun = abrek.testdef.AbrekTestRunner(RUNSTEPS)
56+ltpparser = LTPParser(PATTERN, fixupdict = FIXUPS)
57+testobj = abrek.testdef.AbrekTest(testname="ltp", version=VERSION,
58+ installer=ltpinst, runner=ltprun,
59+ parser=ltpparser)
60
61=== modified file 'abrek/utils.py'
62--- abrek/utils.py 2010-08-18 15:33:32 +0000
63+++ abrek/utils.py 2010-09-15 03:48:46 +0000
64@@ -27,7 +27,7 @@
65 filename = os.path.join(path,filename)
66 fd = open(filename, "w")
67 try:
68- response = urllib2.urlopen(url)
69+ response = urllib2.urlopen(urllib2.quote(url, safe=":/"))
70 fd = open(filename, 'wb')
71 shutil.copyfileobj(response,fd,0x10000)
72 fd.close()

Subscribers

People subscribed via source and target branches