Merge lp:~le-chi-thu/lava-test/override-test-options into lp:lava-test/0.0

Proposed by Le Chi Thu
Status: Merged
Merged at revision: 102
Proposed branch: lp:~le-chi-thu/lava-test/override-test-options
Merge into: lp:lava-test/0.0
Diff against target: 518 lines (+88/-55)
20 files modified
lava_test/api/delegates.py (+4/-2)
lava_test/commands.py (+10/-1)
lava_test/core/runners.py (+14/-5)
lava_test/core/tests.py (+5/-3)
lava_test/test_definitions/bootchart.py (+3/-2)
lava_test/test_definitions/firefox.py (+3/-3)
lava_test/test_definitions/glmemperf.py (+3/-3)
lava_test/test_definitions/gmpbench.py (+3/-2)
lava_test/test_definitions/gtkperf.py (+3/-3)
lava_test/test_definitions/ltp.py (+3/-2)
lava_test/test_definitions/peacekeeper.py (+3/-2)
lava_test/test_definitions/peacekeeper/peacekeeper_runner.py (+7/-3)
lava_test/test_definitions/posixtestsuite.py (+3/-2)
lava_test/test_definitions/pwrmgmt.py (+3/-3)
lava_test/test_definitions/pybench.py (+5/-7)
lava_test/test_definitions/smem.py (+4/-3)
lava_test/test_definitions/stream.py (+3/-2)
lava_test/test_definitions/tiobench.py (+3/-3)
lava_test/test_definitions/x11perf.py (+3/-2)
lava_test/test_definitions/xrestop.py (+3/-2)
To merge this branch: bzr merge lp:~le-chi-thu/lava-test/override-test-options
Reviewer Review Type Date Requested Status
Paul Larson (community) Approve
Le Chi Thu (community) Needs Resubmitting
Review via email: mp+79251@code.launchpad.net

Description of the change

Implemented the blueprint https://blueprints.launchpad.net/lava-test/+spec/linaro-platforms-o-override-test-options

See the updated test definition peacekeeper.py how to use this feature.

from the peacekeeper.py :

RUNSTEPS = ['python peacekeeper_runner.py $(OPTIONS)']

The $(OPTIONS) in the run steps will be replaced with 'firefox' when issuing the command "lava-test run peacekeeper firefox"

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

This will require modifications to all of those tests of course, not just peacekeeper... so I'm assuming this is just an example and not meant to be ready yet right? Also, there will of course need to be a dispatcher change to make use of this.

32 + parser.add_argument("test_options",
33 + help="Override the default test options by this test options. \n"
34 + "Example : lava-test run peacekeeper firefox")
35 +
I think we should specify a -/-- option name for this rather than taking all the extra args off the command line. It makes it more clear with passing other options to the lava-test run command.

Also, we could use either that option with no arguments if it makes sense, or add another option for displaying the default commandline use with that test.

review: Needs Fixing
102. By Le Chi Thu <email address hidden> <email address hidden>

Make testoptions as option parameter in run command.

Revision history for this message
Le Chi Thu (le-chi-thu) wrote :

I updated the lava-test override-test-options. It is still the same syntax as before but the test options is an optional parameter.

lava-test run [-h] [-q] [-Q] [-S] [-H] [--trusted-time] [-o FILE] [-A] test_id [test_options]

review: Needs Resubmitting
Revision history for this message
Spring Zhang (qzhang) wrote :

182 +if result_url.find("http") == -1:
is it started with "http"?

+ "Example of multiple options : lava-test run foo_test 'arg1 arg2")
lost a single-quote

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

> I updated the lava-test override-test-options. It is still the same syntax as
> before but the test options is an optional parameter.
>
> lava-test run [-h] [-q] [-Q] [-S] [-H] [--trusted-time] [-o FILE] [-A] test_id
> [test_options]

Indeed, it should be optional, however please see my previous comments. I think if we used something like --test-options "-a foo -b bar" instead, it would be better. Rational is explained in previous comment.

103. By Le Chi Thu <email address hidden> <email address hidden>

make the test_options an option instead of argument.

104. By Le Chi Thu <email address hidden> <email address hidden>

made the test_options as a option to the run command

105. By Le Chi Thu <email address hidden> <email address hidden>

Renamed --test_options to --test-options

Revision history for this message
Le Chi Thu (le-chi-thu) wrote :

Now it is an option instead of a argument.

 lava-test run [-h] [-q] [-Q] [-S] [-H] [--trusted-time] [-o FILE] [-A]
                     [-t TEST_OPTIONS]
                     test_id

positional arguments:
  test_id Test or test suite identifier

optional arguments:
  -h, --help show this help message and exit
  -q, --quiet Be less verbose about undertaken actions
  -Q, --quiet-subcommands
                        Hide the output of all sub-commands (including tests)
  -t TEST_OPTIONS, --test-options TEST_OPTIONS
                        Override the default test options. The $(OPTIONS) in
                        the run steps will be replaced by the options.See
                        peacekeeper.py as example how to use this feature.To
                        provide multiple options, use quote character.Example
                        : lava-test run peacekeeper -t firefox. Example of
                        multiple options : lava-test run foo_test -t 'arg1
                        arg2'

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

The change still needs to be made to allow all tests to allow options sent to them, not just peacekeeper.

106. By Le Chi Thu <email address hidden> <email address hidden>

Updated all test definitions with

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

I haven't tested all of them, but I spot checked a few and they seemed to run ok. I also fixed the unit tests. The change in number of args to ...
67 - def _run_lava_test_steps(self, artifacts, observer):
68 + def _run_lava_test_steps(self, artifacts, observer, test_options):
...broke things a bit.

Also, it seems that there's still no way to see information on the test from the command line about what the default args will be. I'd really like to have that and it should be pretty simple. I'd like to move this along though, so I'll just add a bug for it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lava_test/api/delegates.py'
--- lava_test/api/delegates.py 2011-09-27 20:07:52 +0000
+++ lava_test/api/delegates.py 2011-10-20 12:16:24 +0000
@@ -65,7 +65,7 @@
65 """65 """
6666
67 @abstractmethod67 @abstractmethod
68 def run(self, artifacts, observer):68 def run(self, artifacts, observer, test_options):
69 """69 """
70 Run the test and create artifacts (typically log files).70 Run the test and create artifacts (typically log files).
7171
@@ -78,7 +78,9 @@
78 :param observer:78 :param observer:
79 Observer object that makes it possible to monitor the actions79 Observer object that makes it possible to monitor the actions
80 performed by the test runner.80 performed by the test runner.
81 :type observer: :class:`~lava_test.api.observers.ITestRunnerObserver` 81 :type observer: :class:`~lava_test.api.observers.ITestRunnerObserver`
82 :param test_options:
83 A string with space separated options to pass to the test.
8284
83 :return true if any test step return none-zero return code85 :return true if any test step return none-zero return code
84 .. versionadded:: 0.286 .. versionadded:: 0.2
8587
=== modified file 'lava_test/commands.py'
--- lava_test/commands.py 2011-10-05 21:57:34 +0000
+++ lava_test/commands.py 2011-10-20 12:16:24 +0000
@@ -221,11 +221,20 @@
221 " is not affected as it never stores any"221 " is not affected as it never stores any"
222 " attachments."))222 " attachments."))
223223
224 parser.add_argument("-t", "--test-options",
225 default=None,
226 help="Override the default test options. "
227 "The $(OPTIONS) in the run steps will be replaced by the options."
228 "See peacekeeper.py as example how to use this feature."
229 "To provide multiple options, use quote character."
230 "Example : lava-test run peacekeeper -t firefox. "
231 "Example of multiple options : lava-test run foo_test -t 'arg1 arg2'")
232
224 def invoke_with_test(self, test):233 def invoke_with_test(self, test):
225 if not test.is_installed:234 if not test.is_installed:
226 raise LavaCommandError("The specified test is not installed")235 raise LavaCommandError("The specified test is not installed")
227 try:236 try:
228 artifacts, run_fail = test.run(self)237 artifacts, run_fail = test.run(self, test_options=self.args.test_options)
229 except subprocess.CalledProcessError as ex:238 except subprocess.CalledProcessError as ex:
230 if ex.returncode is None:239 if ex.returncode is None:
231 raise LavaCommandError("Command %r was aborted" % ex.cmd)240 raise LavaCommandError("Command %r was aborted" % ex.cmd)
232241
=== modified file 'lava_test/core/runners.py'
--- lava_test/core/runners.py 2011-10-05 21:57:34 +0000
+++ lava_test/core/runners.py 2011-10-20 12:16:24 +0000
@@ -32,14 +32,14 @@
32 :ivar steps:32 :ivar steps:
33 list of shell commands to execute33 list of shell commands to execute
34 """34 """
35 def __init__(self, steps=None):35 def __init__(self, steps=None, default_options=None):
36 self.steps = steps or []36 self.steps = steps or []
37 self.testoutput = [] # XXX: is this still used?37 self.default_options = default_options
3838
39 def __repr__(self):39 def __repr__(self):
40 return "<%s steps=%r>" % (self.__class__.__name__, self.steps)40 return "<%s steps=%r>" % (self.__class__.__name__, self.steps)
4141
42 def _run_lava_test_steps(self, artifacts, observer):42 def _run_lava_test_steps(self, artifacts, observer, test_options):
43 stdout = open(artifacts.stdout_pathname, 'at')43 stdout = open(artifacts.stdout_pathname, 'at')
44 stderr = open(artifacts.stderr_pathname, 'at')44 stderr = open(artifacts.stderr_pathname, 'at')
45 delegate = DisplayDelegate(stdout, stderr, observer)45 delegate = DisplayDelegate(stdout, stderr, observer)
@@ -47,6 +47,15 @@
47 run_failed = False47 run_failed = False
48 try:48 try:
49 for cmd in self.steps:49 for cmd in self.steps:
50 # should override the test options in the step ?
51 if cmd.find("$(OPTIONS)") > 0:
52 # check if test options is provided or use default options
53 if not test_options and self.default_options == None:
54 raise RuntimeError("Test options is missing. No default value is provided.")
55 if not test_options:
56 test_options = self.default_options
57 cmd = cmd.replace("$(OPTIONS)",test_options)
58
50 if observer: observer.about_to_run_shell_command(cmd)59 if observer: observer.about_to_run_shell_command(cmd)
51 returncode = extcmd.call(cmd, shell=True)60 returncode = extcmd.call(cmd, shell=True)
52 if observer: observer.did_run_shell_command(cmd, returncode)61 if observer: observer.did_run_shell_command(cmd, returncode)
@@ -56,7 +65,7 @@
56 stderr.close()65 stderr.close()
57 return run_failed66 return run_failed
5867
59 def run(self, artifacts, observer=None):68 def run(self, artifacts, observer=None, test_options = None):
60 """69 """
61 Run the test program by executing steps in sequence.70 Run the test program by executing steps in sequence.
6271
@@ -65,6 +74,6 @@
65 :meth:`~lava_test.api.delegates.TestRunner.run`74 :meth:`~lava_test.api.delegates.TestRunner.run`
66 """75 """
67 self.starttime = datetime.datetime.utcnow()76 self.starttime = datetime.datetime.utcnow()
68 run_failed = self._run_lava_test_steps(artifacts, observer)77 run_failed = self._run_lava_test_steps(artifacts, observer, test_options)
69 self.endtime = datetime.datetime.utcnow()78 self.endtime = datetime.datetime.utcnow()
70 return run_failed79 return run_failed
7180
=== modified file 'lava_test/core/tests.py'
--- lava_test/core/tests.py 2011-10-05 21:57:34 +0000
+++ lava_test/core/tests.py 2011-10-20 12:16:24 +0000
@@ -52,13 +52,15 @@
52 """52 """
5353
54 def __init__(self, test_id, test_version=None,54 def __init__(self, test_id, test_version=None,
55 installer=None, runner=None, parser=None):55 installer=None, runner=None, parser=None, default_options=None):
56 self._test_id = test_id56 self._test_id = test_id
57 self._test_version = test_version57 self._test_version = test_version
58 # Delegate objects58 # Delegate objects
59 self.installer = installer59 self.installer = installer
60 self.runner = runner60 self.runner = runner
61 self.parser = parser61 self.parser = parser
62 self.default_options = default_options
63
62 # Config instance64 # Config instance
63 self._config = get_config()65 self._config = get_config()
6466
@@ -117,7 +119,7 @@
117 if os.path.exists(self.install_dir):119 if os.path.exists(self.install_dir):
118 shutil.rmtree(self.install_dir)120 shutil.rmtree(self.install_dir)
119121
120 def run(self, observer=None):122 def run(self, observer=None, test_options=None):
121 if not self.runner:123 if not self.runner:
122 raise RuntimeError(124 raise RuntimeError(
123 "no test runner defined for '%s'" % self.test_id)125 "no test runner defined for '%s'" % self.test_id)
@@ -126,7 +128,7 @@
126 logging.debug(128 logging.debug(
127 "Invoking %r.run_and_store_artifacts(...)",129 "Invoking %r.run_and_store_artifacts(...)",
128 self.runner, observer)130 self.runner, observer)
129 run_fail = self.runner.run(artifacts, observer)131 run_fail = self.runner.run(artifacts, observer, test_options)
130132
131 return artifacts, run_fail133 return artifacts, run_fail
132134
133135
=== modified file 'lava_test/test_definitions/bootchart.py'
--- lava_test/test_definitions/bootchart.py 2011-09-23 08:10:25 +0000
+++ lava_test/test_definitions/bootchart.py 2011-10-20 12:16:24 +0000
@@ -18,13 +18,14 @@
18from lava_test.core.runners import TestRunner18from lava_test.core.runners import TestRunner
19from lava_test.core.tests import Test19from lava_test.core.tests import Test
2020
21DEFAULT_OPTIONS = ""
21INSTALLSTEPS = ['bzr branch lp:~linaro-foundations/lava-test/bootchartscript']22INSTALLSTEPS = ['bzr branch lp:~linaro-foundations/lava-test/bootchartscript']
22DEPS = ['bootchart', 'pybootchartgui', 'bzr']23DEPS = ['bootchart', 'pybootchartgui', 'bzr']
23RUNSTEPS = ['./bootchartscript/bootchartscript.sh']24RUNSTEPS = ['./bootchartscript/bootchartscript.sh $(OPTIONS)']
24PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+\.\d+)"25PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+\.\d+)"
2526
26bootchartinst = TestInstaller(INSTALLSTEPS, deps=DEPS)27bootchartinst = TestInstaller(INSTALLSTEPS, deps=DEPS)
27bootchartrun = TestRunner(RUNSTEPS)28bootchartrun = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
28bootchartparser = TestParser(PATTERN,29bootchartparser = TestParser(PATTERN,
29 appendall={'units':'sec', 'result':'pass'})30 appendall={'units':'sec', 'result':'pass'})
30testobj = Test(test_id="bootchart", installer=bootchartinst,31testobj = Test(test_id="bootchart", installer=bootchartinst,
3132
=== modified file 'lava_test/test_definitions/firefox.py'
--- lava_test/test_definitions/firefox.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/firefox.py 2011-10-20 12:16:24 +0000
@@ -19,14 +19,14 @@
19from lava_test.core.runners import TestRunner19from lava_test.core.runners import TestRunner
20from lava_test.core.tests import Test20from lava_test.core.tests import Test
2121
2222DEFAULT_OPTIONS = ""
23INSTALLSTEPS = ['git clone git://github.com/janimo/firefox-startup-timing.git']23INSTALLSTEPS = ['git clone git://github.com/janimo/firefox-startup-timing.git']
24DEPS = ['firefox', 'git-core', 'gcalctool']24DEPS = ['firefox', 'git-core', 'gcalctool']
25RUNSTEPS = ['cd firefox-startup-timing; ./firefox_startup_timing.sh']25RUNSTEPS = ['cd firefox-startup-timing; ./firefox_startup_timing.sh $(OPTIONS)']
26PATTERN = "^(?P<test_case_id>\w+):(?P<measurement>\d+)"26PATTERN = "^(?P<test_case_id>\w+):(?P<measurement>\d+)"
2727
28firefoxinst = TestInstaller(INSTALLSTEPS, deps=DEPS)28firefoxinst = TestInstaller(INSTALLSTEPS, deps=DEPS)
29firefoxrun = TestRunner(RUNSTEPS)29firefoxrun = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
30firefoxparser = TestParser(PATTERN,30firefoxparser = TestParser(PATTERN,
31 appendall={'units':'ms', 'result':'pass'})31 appendall={'units':'ms', 'result':'pass'})
32testobj = Test(test_id="firefox", installer=firefoxinst,32testobj = Test(test_id="firefox", installer=firefoxinst,
3333
=== modified file 'lava_test/test_definitions/glmemperf.py'
--- lava_test/test_definitions/glmemperf.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/glmemperf.py 2011-10-20 12:16:24 +0000
@@ -19,12 +19,12 @@
19from lava_test.core.runners import TestRunner19from lava_test.core.runners import TestRunner
20from lava_test.core.tests import Test20from lava_test.core.tests import Test
2121
2222DEFAULT_OPTIONS = "-e shmimage"
23RUNSTEPS = ["glmemperf -e shmimage"]23RUNSTEPS = ["glmemperf $(OPTIONS)"]
24PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+) fps"24PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+) fps"
2525
26inst = TestInstaller(deps=["glmemperf"])26inst = TestInstaller(deps=["glmemperf"])
27run = TestRunner(RUNSTEPS)27run = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
28parse = TestParser(PATTERN,28parse = TestParser(PATTERN,
29 appendall={'units':'fps',29 appendall={'units':'fps',
30 'result':'pass'})30 'result':'pass'})
3131
=== modified file 'lava_test/test_definitions/gmpbench.py'
--- lava_test/test_definitions/gmpbench.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/gmpbench.py 2011-10-20 12:16:24 +0000
@@ -33,17 +33,18 @@
33URL_gexpr="http://www.gmplib.org/gexpr.c"33URL_gexpr="http://www.gmplib.org/gexpr.c"
34DEPS = ['gcc', 'libgmp3-dev', 'wget', 'bzip2']34DEPS = ['gcc', 'libgmp3-dev', 'wget', 'bzip2']
3535
36DEFAULT_OPTIONS = ""
36INSTALLSTEPS = ['tar -xjf gmpbench-0.2.tar.bz2',37INSTALLSTEPS = ['tar -xjf gmpbench-0.2.tar.bz2',
37 'wget -c %s' %(URL_gexpr),38 'wget -c %s' %(URL_gexpr),
38 'mv gexpr.c gmpbench-0.2',39 'mv gexpr.c gmpbench-0.2',
39 'cd gmpbench-0.2 && gcc -o gexpr gexpr.c -static -lm']40 'cd gmpbench-0.2 && gcc -o gexpr gexpr.c -static -lm']
40RUNSTEPS = ['cd gmpbench-0.2 && PATH=$PATH:. ./runbench ']41RUNSTEPS = ['cd gmpbench-0.2 && PATH=$PATH:. ./runbench $(OPTIONS)']
41PATTERN = "\s*(?P<test_case_id>GMPbench\.*\w*\.*\w*):?\s*"\42PATTERN = "\s*(?P<test_case_id>GMPbench\.*\w*\.*\w*):?\s*"\
42 "(?P<measurement>\d+.\d+)"43 "(?P<measurement>\d+.\d+)"
4344
44gmpbenchinst = TestInstaller(INSTALLSTEPS, deps=DEPS,45gmpbenchinst = TestInstaller(INSTALLSTEPS, deps=DEPS,
45 url=URL)46 url=URL)
46gmpbenchrun = TestRunner(RUNSTEPS)47gmpbenchrun = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
47gmpbenchparser = TestParser(PATTERN,48gmpbenchparser = TestParser(PATTERN,
48 appendall={'units':'operations/s', 'result':'pass'})49 appendall={'units':'operations/s', 'result':'pass'})
49testobj = Test(test_id="gmpbench", installer=gmpbenchinst,50testobj = Test(test_id="gmpbench", installer=gmpbenchinst,
5051
=== modified file 'lava_test/test_definitions/gtkperf.py'
--- lava_test/test_definitions/gtkperf.py 2011-09-23 08:56:22 +0000
+++ lava_test/test_definitions/gtkperf.py 2011-10-20 12:16:24 +0000
@@ -22,9 +22,9 @@
2222
2323
24# Run tests automatically, 500 repetitions each24# Run tests automatically, 500 repetitions each
25gtkperf_options = "-a -c 500"25DEFAULT_OPTIONS = "-a -c 500"
2626
27RUNSTEPS = ["LANG=C gtkperf %s" % gtkperf_options]27RUNSTEPS = ["LANG=C gtkperf $(OPTIONS)"]
2828
29class GtkTestParser(TestParser):29class GtkTestParser(TestParser):
30 def parse(self, artifacts):30 def parse(self, artifacts):
@@ -58,7 +58,7 @@
5858
59parse = GtkTestParser(appendall={'units':'seconds', 'result':'pass'})59parse = GtkTestParser(appendall={'units':'seconds', 'result':'pass'})
60inst = TestInstaller(deps=["gtkperf"])60inst = TestInstaller(deps=["gtkperf"])
61run = TestRunner(RUNSTEPS)61run = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
6262
63testobj = Test(test_id="gtkperf", installer=inst,63testobj = Test(test_id="gtkperf", installer=inst,
64 runner=run, parser=parse)64 runner=run, parser=parse)
6565
=== modified file 'lava_test/test_definitions/ltp.py'
--- lava_test/test_definitions/ltp.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/ltp.py 2011-10-20 12:16:24 +0000
@@ -35,11 +35,12 @@
35make all35make all
36SKIP_IDCHECK=1 make install36SKIP_IDCHECK=1 make install
37"""37"""
38DEFAULT_OPTIONS = "-f syscalls -p -q"
3839
39INSTALLSTEPS = ["echo '%s' > installltp.sh" % SCRIPT,40INSTALLSTEPS = ["echo '%s' > installltp.sh" % SCRIPT,
40 'chmod +x installltp.sh',41 'chmod +x installltp.sh',
41 './installltp.sh']42 './installltp.sh']
42RUNSTEPS = ['cd build && sudo ./runltp -f syscalls -p -q']43RUNSTEPS = ['cd build && sudo ./runltp $(OPTIONS)']
43PATTERN = "^(?P<test_case_id>\S+) (?P<subid>\d+) (?P<result>\w+) : (?P<message>.+)"44PATTERN = "^(?P<test_case_id>\S+) (?P<subid>\d+) (?P<result>\w+) : (?P<message>.+)"
44FIXUPS = {"TBROK":"fail",45FIXUPS = {"TBROK":"fail",
45 "TCONF":"skip",46 "TCONF":"skip",
@@ -74,7 +75,7 @@
7475
75ltpinst = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL,76ltpinst = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL,
76 md5=MD5)77 md5=MD5)
77ltprun = TestRunner(RUNSTEPS)78ltprun = TestRunner(RUNSTEPS,default_options = DEFAULT_OPTIONS)
78ltpparser = LTPParser(PATTERN, fixupdict = FIXUPS)79ltpparser = LTPParser(PATTERN, fixupdict = FIXUPS)
79testobj = Test(test_id="ltp", test_version=VERSION,80testobj = Test(test_id="ltp", test_version=VERSION,
80 installer=ltpinst, runner=ltprun,81 installer=ltpinst, runner=ltprun,
8182
=== modified file 'lava_test/test_definitions/peacekeeper.py'
--- lava_test/test_definitions/peacekeeper.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/peacekeeper.py 2011-10-20 12:16:24 +0000
@@ -30,12 +30,13 @@
3030
31curdir = os.path.realpath(os.path.dirname(__file__))31curdir = os.path.realpath(os.path.dirname(__file__))
3232
33DEFAULT_OPTIONS = "firefox"
33INSTALLSTEPS = ['cp -rf %s/peacekeeper/* .'%curdir]34INSTALLSTEPS = ['cp -rf %s/peacekeeper/* .'%curdir]
34RUNSTEPS = ['python peacekeeper_runner.py firefox']35RUNSTEPS = ['python peacekeeper_runner.py $(OPTIONS)']
35DEPS = ['python-ldtp','firefox']36DEPS = ['python-ldtp','firefox']
3637
37my_installer = TestInstaller(INSTALLSTEPS, deps=DEPS)38my_installer = TestInstaller(INSTALLSTEPS, deps=DEPS)
38my_runner = TestRunner(RUNSTEPS)39my_runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
3940
40PATTERN = "^(?P<result>\w+): Score = (?P<measurement>\d+)"41PATTERN = "^(?P<result>\w+): Score = (?P<measurement>\d+)"
4142
4243
=== modified file 'lava_test/test_definitions/peacekeeper/peacekeeper_runner.py'
--- lava_test/test_definitions/peacekeeper/peacekeeper_runner.py 2011-06-08 12:38:38 +0000
+++ lava_test/test_definitions/peacekeeper/peacekeeper_runner.py 2011-10-20 12:16:24 +0000
@@ -25,7 +25,6 @@
25}25}
2626
27site = "http://service.futuremark.com/peacekeeper/run.action"27site = "http://service.futuremark.com/peacekeeper/run.action"
28#site = "http://service.futuremark.com/peacekeeper/results.action?key=5sdG"
2928
30try:29try:
31 browser = browser_data[sys.argv[1]]30 browser = browser_data[sys.argv[1]]
@@ -53,8 +52,13 @@
5352
54closewindow(browser["title"])53closewindow(browser["title"])
5554
56print result_url55print "result_url = %s" %result_url
5756
57# if the url not start with http ? append http to it.
58
59if result_url.find("http") != 0:
60 result_url = "http://" + result_url
61
58if wait_loop > 0:62if wait_loop > 0:
59 fd = urlopen(result_url)63 fd = urlopen(result_url)
60 data = fd.read()64 data = fd.read()
6165
=== modified file 'lava_test/test_definitions/posixtestsuite.py'
--- lava_test/test_definitions/posixtestsuite.py 2011-09-23 08:56:22 +0000
+++ lava_test/test_definitions/posixtestsuite.py 2011-10-20 12:16:24 +0000
@@ -34,9 +34,10 @@
34URL= "http://downloads.sourceforge.net/project/ltp/LTP Source/ltp-%s/"\34URL= "http://downloads.sourceforge.net/project/ltp/LTP Source/ltp-%s/"\
35 "ltp-full-%s.bz2" % (VERSION, VERSION)35 "ltp-full-%s.bz2" % (VERSION, VERSION)
36MD5="6982c72429a62f3917c13b2d529ad1ce"36MD5="6982c72429a62f3917c13b2d529ad1ce"
37DEFAULT_OPTIONS = ""
37INSTALLSTEPS = ['tar -xjf ltp-full-20100831.bz2']38INSTALLSTEPS = ['tar -xjf ltp-full-20100831.bz2']
38DEPS = ['gcc', 'bzip2']39DEPS = ['gcc', 'bzip2']
39RUNSTEPS = ['cd ltp-full-20100831/testcases/open_posix_testsuite/ && make']40RUNSTEPS = ['cd ltp-full-20100831/testcases/open_posix_testsuite/ && make $(OPTIONS)']
4041
41PATTERN = "((?P<test_case_id>\A(\w+[/]+)+\w+[-]*\w*[-]*\w*) .*? (?P<result>\w+))"42PATTERN = "((?P<test_case_id>\A(\w+[/]+)+\w+[-]*\w*[-]*\w*) .*? (?P<result>\w+))"
42FIXUPS = {43FIXUPS = {
@@ -69,7 +70,7 @@
6970
70posix_inst = TestInstaller(INSTALLSTEPS, deps=DEPS,71posix_inst = TestInstaller(INSTALLSTEPS, deps=DEPS,
71 url=URL, md5=MD5)72 url=URL, md5=MD5)
72posix_run = TestRunner(RUNSTEPS)73posix_run = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
73posixparser = PosixParser(PATTERN, fixupdict = FIXUPS)74posixparser = PosixParser(PATTERN, fixupdict = FIXUPS)
74testobj = Test(test_id="posixtestsuite", test_version=VERSION,75testobj = Test(test_id="posixtestsuite", test_version=VERSION,
75 installer=posix_inst, runner=posix_run,76 installer=posix_inst, runner=posix_run,
7677
=== modified file 'lava_test/test_definitions/pwrmgmt.py'
--- lava_test/test_definitions/pwrmgmt.py 2011-10-05 22:10:55 +0000
+++ lava_test/test_definitions/pwrmgmt.py 2011-10-20 12:16:24 +0000
@@ -19,15 +19,15 @@
19from lava_test.core.runners import TestRunner19from lava_test.core.runners import TestRunner
20from lava_test.core.tests import Test20from lava_test.core.tests import Test
2121
2222DEFAULT_OPTIONS = ""
2323
24INSTALLSTEPS = ['git clone git://git.linaro.org/tools/pm-qa.git',24INSTALLSTEPS = ['git clone git://git.linaro.org/tools/pm-qa.git',
25 'cd pm-qa && make clean && make all']25 'cd pm-qa && make clean && make all']
26RUNSTEPS = ['cd pm-qa && make check']26RUNSTEPS = ['cd pm-qa && make check $(OPTIONS)']
27DEPS = ['git-core', 'make', 'linux-libc-dev', 'util-linux']27DEPS = ['git-core', 'make', 'linux-libc-dev', 'util-linux']
2828
29pwrmgmtinst = TestInstaller(INSTALLSTEPS, deps=DEPS)29pwrmgmtinst = TestInstaller(INSTALLSTEPS, deps=DEPS)
30pwrmgmtrun = TestRunner(RUNSTEPS)30pwrmgmtrun = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS)
3131
32# test case name is before ":" , the test log is between ":" and "...",32# test case name is before ":" , the test log is between ":" and "...",
33# the result is after "..."33# the result is after "..."
3434
=== modified file 'lava_test/test_definitions/pybench.py'
--- lava_test/test_definitions/pybench.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/pybench.py 2011-10-20 12:16:24 +0000
@@ -29,13 +29,13 @@
2929
30VERSION='r27'30VERSION='r27'
31URL="http://svn.python.org/projects/python/tags/%s/Tools/pybench/" %(VERSION)31URL="http://svn.python.org/projects/python/tags/%s/Tools/pybench/" %(VERSION)
3232DEFAULT_OPTIONS = ""
33INSTALLSTEPS = ["svn export %s" %(URL)]33INSTALLSTEPS = ["svn export %s" %(URL)]
34RUNSTEPS = ['python pybench/pybench.py']34RUNSTEPS = ['python pybench/pybench.py $(OPTIONS)']
35DEPS = ['subversion']35DEPS = ['subversion']
3636
37my_installer = TestInstaller(INSTALLSTEPS, deps=DEPS)37my_installer = TestInstaller(INSTALLSTEPS, deps=DEPS)
38my_runner = TestRunner(RUNSTEPS)38my_runner = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
3939
40# test case name is first column and measurement is average column40# test case name is first column and measurement is average column
41#41#
@@ -45,9 +45,7 @@
4545
46PATTERN = "^\s+(?P<test_case_id>\w+):\s+(\d+)ms\s+(?P<measurement>\d+)ms"46PATTERN = "^\s+(?P<test_case_id>\w+):\s+(\d+)ms\s+(?P<measurement>\d+)ms"
4747
48my_parser = TestParser(PATTERN,48my_parser = TestParser(PATTERN, appendall={'units':'ms','result':'pass'})
49 appendall={'units':'ms',
50 'result':'pass'})
5149
52testobj = Test(test_id="pybench", installer=my_installer,50testobj = Test(test_id="pybench", installer=my_installer,
53 runner=my_runner, parser=my_parser)51 runner=my_runner, parser=my_parser)
5452
=== modified file 'lava_test/test_definitions/smem.py'
--- lava_test/test_definitions/smem.py 2011-09-23 08:10:25 +0000
+++ lava_test/test_definitions/smem.py 2011-10-20 12:16:24 +0000
@@ -18,13 +18,14 @@
18from lava_test.core.runners import TestRunner18from lava_test.core.runners import TestRunner
19from lava_test.core.tests import Test19from lava_test.core.tests import Test
2020
2121DEFAULT_OPTIONS = ""
22RUNSTEPS = ['smem -w | tail -n 3']22RUNSTEPS = ['smem -w $(OPTIONS) | tail -n 3']
23PATTERN = "^(?P<test_case_id>(\w+\s)+)\s\s+(?P<measurement>\d+)"23PATTERN = "^(?P<test_case_id>(\w+\s)+)\s\s+(?P<measurement>\d+)"
24DEPS = ['smem']24DEPS = ['smem']
2525
26
26smeminst = TestInstaller(deps=DEPS)27smeminst = TestInstaller(deps=DEPS)
27smemrun = TestRunner(RUNSTEPS)28smemrun = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
28smemparser = TestParser(PATTERN,29smemparser = TestParser(PATTERN,
29 appendall={'units':'KB', 'result':'pass'})30 appendall={'units':'KB', 'result':'pass'})
30testobj = Test(test_id="smem", installer=smeminst,31testobj = Test(test_id="smem", installer=smeminst,
3132
=== modified file 'lava_test/test_definitions/stream.py'
--- lava_test/test_definitions/stream.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/stream.py 2011-10-20 12:16:24 +0000
@@ -21,11 +21,12 @@
21URL="http://www.cs.virginia.edu/stream/FTP/Code/stream.c"21URL="http://www.cs.virginia.edu/stream/FTP/Code/stream.c"
22INSTALLSTEPS = ['cc stream.c -O2 -fopenmp -o stream']22INSTALLSTEPS = ['cc stream.c -O2 -fopenmp -o stream']
23DEPS = ['gcc', 'build-essential']23DEPS = ['gcc', 'build-essential']
24RUNSTEPS = ['./stream']24DEFAULT_OPTIONS = ""
25RUNSTEPS = ['./stream $(OPTIONS)']
25PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+\.\d+)"26PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+\.\d+)"
2627
27streaminst = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL)28streaminst = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL)
28streamrun = TestRunner(RUNSTEPS)29streamrun = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
29streamparser = TestParser(PATTERN,30streamparser = TestParser(PATTERN,
30 appendall={'units':'MB/s', 'result':'pass'})31 appendall={'units':'MB/s', 'result':'pass'})
31testobj = Test(test_id="stream", installer=streaminst,32testobj = Test(test_id="stream", installer=streaminst,
3233
=== modified file 'lava_test/test_definitions/tiobench.py'
--- lava_test/test_definitions/tiobench.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/tiobench.py 2011-10-20 12:16:24 +0000
@@ -31,11 +31,11 @@
31VERSION="0.3.3"31VERSION="0.3.3"
32URL="http://prdownloads.sourceforge.net/tiobench/tiobench-%s.tar.gz" %(VERSION)32URL="http://prdownloads.sourceforge.net/tiobench/tiobench-%s.tar.gz" %(VERSION)
33MD5="bf485bf820e693c79e6bd2a38702a128"33MD5="bf485bf820e693c79e6bd2a38702a128"
34DEFAULT_OPTIONS = "--block=4096 --block=8192 --threads=2 --numruns=2"
34INSTALLSTEPS = ['tar -zxvf tiobench-%s.tar.gz' % VERSION,35INSTALLSTEPS = ['tar -zxvf tiobench-%s.tar.gz' % VERSION,
35 'cd tiobench-%s && make' % VERSION]36 'cd tiobench-%s && make' % VERSION]
36RUNSTEPS = ["cd tiobench-%s && "\37RUNSTEPS = ["cd tiobench-%s && "\
37 "./tiobench.pl --block=4096 --block=8192 --threads=2 "\38 "./tiobench.pl $(OPTIONS)" % (VERSION)]
38 "--numruns=2" % (VERSION)]
3939
4040
41class TIObenchTestParser(TestParser):41class TIObenchTestParser(TestParser):
@@ -70,7 +70,7 @@
7070
71tiobench_inst = TestInstaller(INSTALLSTEPS, url=URL,71tiobench_inst = TestInstaller(INSTALLSTEPS, url=URL,
72 md5=MD5)72 md5=MD5)
73tiobench_run = TestRunner(RUNSTEPS)73tiobench_run = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
74parse = TIObenchTestParser(appendall={'units':'MB/s', 'result':'pass'})74parse = TIObenchTestParser(appendall={'units':'MB/s', 'result':'pass'})
75testobj = Test(test_id="tiobench", test_version=VERSION,75testobj = Test(test_id="tiobench", test_version=VERSION,
76 installer=tiobench_inst, runner=tiobench_run, parser=parse)76 installer=tiobench_inst, runner=tiobench_run, parser=parse)
7777
=== modified file 'lava_test/test_definitions/x11perf.py'
--- lava_test/test_definitions/x11perf.py 2011-09-12 09:19:10 +0000
+++ lava_test/test_definitions/x11perf.py 2011-10-20 12:16:24 +0000
@@ -46,11 +46,12 @@
46 "-scroll500",46 "-scroll500",
47 ]47 ]
4848
49RUNSTEPS = ["x11perf %s %s" % (x11perf_options, " ".join(x11perf_tests))]49DEFAULT_OPTIONS = "%s %s" % (x11perf_options, " ".join(x11perf_tests))
50RUNSTEPS = ["x11perf $(OPTIONS)"]
50PATTERN = "trep @.*\(\W*(?P<measurement>\d+.\d+)/sec\):\W+(?P<test_case_id>.+)"51PATTERN = "trep @.*\(\W*(?P<measurement>\d+.\d+)/sec\):\W+(?P<test_case_id>.+)"
5152
52inst = TestInstaller(deps=["x11-apps"])53inst = TestInstaller(deps=["x11-apps"])
53run = TestRunner(RUNSTEPS)54run = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
54parse = TestParser(PATTERN,55parse = TestParser(PATTERN,
55 appendall={'units':'reps/s',56 appendall={'units':'reps/s',
56 'result':'pass'})57 'result':'pass'})
5758
=== modified file 'lava_test/test_definitions/xrestop.py'
--- lava_test/test_definitions/xrestop.py 2011-09-23 08:10:25 +0000
+++ lava_test/test_definitions/xrestop.py 2011-10-20 12:16:24 +0000
@@ -19,11 +19,12 @@
19from lava_test.core.tests import Test19from lava_test.core.tests import Test
2020
21INSTALLSTEPS = ['bzr branch lp:~linaro-foundations/lava-test/xrestopscript']21INSTALLSTEPS = ['bzr branch lp:~linaro-foundations/lava-test/xrestopscript']
22RUNSTEPS = ["./xrestopscript/xrestop.sh"]22RUNSTEPS = ["./xrestopscript/xrestop.sh $(OPTIONS)"]
23PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+)"23PATTERN = "^(?P<test_case_id>\w+):\W+(?P<measurement>\d+)"
24DEFAULT_OPTIONS = ""
2425
25xrestopinst = TestInstaller(INSTALLSTEPS, deps=["xrestop"])26xrestopinst = TestInstaller(INSTALLSTEPS, deps=["xrestop"])
26xrestoprun = TestRunner(RUNSTEPS)27xrestoprun = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS)
27xrestopparser = TestParser(PATTERN,28xrestopparser = TestParser(PATTERN,
28 appendall={'units':'KB', 'result':'pass'})29 appendall={'units':'KB', 'result':'pass'})
29testobj = Test(test_id="xrestop", installer=xrestopinst,30testobj = Test(test_id="xrestop", installer=xrestopinst,

Subscribers

People subscribed via source and target branches