~ubuntu-branches/ubuntu/oneiric/checkbox/oneiric-updates

« back to all changes in this revision

Viewing changes to plugins/shell_test.py

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Marc Tardif
  • Date: 2010-03-09 16:58:36 UTC
  • Revision ID: james.westby@ubuntu.com-20100309165836-26f22oe6ubppzx0d
Tags: 0.9
[ Marc Tardif ]
New upstream release (LP: #532882):
* Introduced job_prompt plugin to treat all jobs (suites, tests, etc.) as composites.
* Replaced the registry and resource scripts and centralized job iteration.
* Replaced dependency on dbus by using sudo/gksu/kdesudo instead.
* Replaced mktemp with mkdtemp for security purposes.
* Fixed strings in fingerprint and modem tests (LP: #457759)
* Fixed client side validation of Launchpad form (LP: #438671)
* Added device information to tags when reporting bugs with apport.
* Added shorthands for blacklist-file and whitelist-file.
* Added support for apport default configuration (LP: #465447)
* Added support for scrolled options list (LP: #411526)
* Added support for tests generated by suites to run as root.
* Added support for requirements in attachments.
* Added support for armv7l processor
* Added Autotest integration
* Added LTP integration
* Added Phoronix integration
* Added qa-regression-testing integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#
19
19
from gettext import gettext as _
20
20
 
21
 
from checkbox.job import Job, UNINITIATED
 
21
from checkbox.job import UNINITIATED
22
22
from checkbox.plugin import Plugin
23
23
 
24
24
 
36
36
        command = test.get("command")
37
37
        status = test.get("status", UNINITIATED)
38
38
        if command and status == UNINITIATED:
39
 
            job = Job(command, test.get("environ"),
40
 
                test.get("timeout"), test.get("user"))
41
 
            (status, data, duration) = interface.show_progress(
42
 
                _("Running shell tests..."), job.execute)
43
 
            test["data"] = data
44
 
            test["duration"] = duration
45
 
            test["status"] = status
 
39
            # Register temporary handler for message-result events
 
40
            def message_result(status, data, duration):
 
41
                test["status"] = status
 
42
                test["data"] = data
 
43
                test["duration"] = duration
 
44
 
 
45
                # Don't fire any other message result
 
46
                self._manager.reactor.stop()
 
47
 
 
48
            event_id = self._manager.reactor.call_on("message-result", message_result, -100)
 
49
 
 
50
            interface.show_progress(
 
51
                _("Running %s..." % test["name"]), self._manager.reactor.fire,
 
52
                "message-exec", test)
 
53
 
 
54
            self._manager.reactor.cancel_call(event_id)
 
55
 
 
56
        self._manager.reactor.fire("prompt-test", interface, test)
46
57
 
47
58
    def report_shell(self, test):
48
59
        self._manager.reactor.fire("report-test", test)