~cr3/ubuntu/quantal/checkbox/0.14

« back to all changes in this revision

Viewing changes to scripts/cpuinfo_resource

  • Committer: Package Import Robot
  • Author(s): Daniel Manrique, Marc Tardif, Daniel Manrique, Jeff Lane, Ara Pulido, Brendan Donegan, Javier Collado
  • Date: 2011-11-18 12:46:21 UTC
  • Revision ID: package-import@ubuntu.com-20111118124621-87rjnjm27ool11e6
Tags: 0.13
New upstream release (LP: #892268):

[Marc Tardif]
* Generate a submission.xml file that contains all device and attachment
* Write the report before reporting the validation error.
* Changed device.product to dmi.product for the formfactor (LP: #875312)

[Daniel Manrique]
* Use gettext for string (LP: #869267)
* Move progress indicator to main checkbox dialog instead of a 
  transient window (LP: #868995)
* Ignore malformed dpkg entries in package_resource (LP: #794747)
* Reset window title after finishing a manual test (LP: #874690)
* Handle "@" in locale names (as in ca@valencia).

[Jeff Lane]
* Went through all the job files and:
  * Updated descriptions to match Unity UI structure
  * Added descriptions where necessary
  * Added further details to some descriptions
  * Moved some jobs to more appropriate files
  * Fixed job names in older job files to match new naming scheme 
    (suite/testname)
  * Added jobs to local.txt to ensure all job files are now parsed
    (this allows easier addition of existing tests to whitelists)
  * Changed remaining manual job descriptions to match the new format
* Updated CD and DVD write tests to be more clear about when to skip
  them (LP: #772794)

[Ara Pulido]
* Rewrote all job descriptions to match OEM QA syntax

[Brendan Donegan]  
* Fix the code that assigns keys in checkbox-cli so that it never assigns
  keys which have other uses. (LP: #877467)
* Show details of unmet job requirements (LP: #855852)
* Ensure that connect_wireless chooses a wireless connection from the list
  of available connections (LP: #877752)
* Have the bluetooth/detect tests require a device with the category
  BLUETOOTH to run, thus preventing the test from failing on systems with
  no Bluetooth device (LP: #862322)
* Rename attachment jobs to not have a forward slash in their name
  (LP: #887964)
* Guard against trying to write files to logical partitions on USB sticks
  (which will obviously fail) in usb_test (LP: #887049)
* Make the OpenGL test ignore the return value of glxgears and improve
  the test description (LP: #890725)
* Allow input/mouse test to run if a TOUCH device is present
  (LP: #886129)

[ Javier Collado ]
* Broken job dependencies fixed (LP: #888447)
* Regex support when specifying blacklists and whitelists on the
  commandline (LP: #588647)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import sys
21
21
import posixpath
22
22
 
23
 
from checkbox.parsers.cpuinfo import (
24
 
    CpuinfoParser,
25
 
    CpuinfoResult,
26
 
    )
 
23
from checkbox.parsers.cpuinfo import CpuinfoParser
27
24
 
28
25
# Filename where cpuinfo is stored.
29
26
CPUINFO_FILENAME = "/proc/cpuinfo"
32
29
FREQUENCY_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
33
30
 
34
31
 
35
 
class ResourceResult(CpuinfoResult):
36
 
 
37
 
    def __setitem__(self, key, value):
38
 
        print "%s: %s" % (key, value)
39
 
 
40
 
    def setSpeed(self, speed):
41
 
        # Check for frequency scaling
42
 
        if posixpath.exists(FREQUENCY_FILENAME):
43
 
            speed = open(FREQUENCY_FILENAME).read().strip()
44
 
            speed = int(speed) / 1000
45
 
 
46
 
        self["speed"] = speed
 
32
class CpuinfoResult:
 
33
 
 
34
    def setProcessor(self, processor):
 
35
        for key, value in processor.iteritems():
 
36
            if key == "speed":
 
37
                # Check for frequency scaling
 
38
                if posixpath.exists(FREQUENCY_FILENAME):
 
39
                    value = open(FREQUENCY_FILENAME).read().strip()
 
40
                    value = int(value) / 1000
 
41
 
 
42
            print "%s: %s" % (key, value)
47
43
 
48
44
 
49
45
def main():
50
46
    stream = open(CPUINFO_FILENAME)
51
47
    parser = CpuinfoParser(stream)
52
48
 
53
 
    result = ResourceResult()
 
49
    result = CpuinfoResult()
54
50
    parser.run(result)
55
51
 
56
52
    return 0