Part of lp.hardwaredb.scripts.tests.test_hwdb_submission_parser View In Hierarchy
Method | setUp | Setup the test environment. |
Method | getTimestampETreeNode | Return an Elementtree node for an XML tag with a timestamp. |
Method | testTimeConversion | Test of the conversion of a "time string" into datetime object. |
Method | testSummary | Undocumented |
Method | testSummaryNodeWithKernelRelease | The <summary> node may contain the sub-node <kernel-release>. |
Method | testBooleanPropertyTypes | Test the parsing result for a boolean property. |
Method | testStringPropertyTypes | String properties are converted into (name, (value, type)). |
Method | testStringPropertyEncoding | Different encodings are properly handled. |
Method | testIntegerPropertyTypes | Int properties are converted into (name, (value, type_string)). |
Method | testFloatPropertyTypes | Float properties are converted into ('name', (value, type_string)). |
Method | testListPropertyTypes | List properties are converted into ('name', a_list). |
Method | testDictPropertyTypes | Dict properties are converted into ('name', a_dict). |
Method | testProperties | A set of properties is converted into a dictionary. |
Method | testDevice | A device node is converted into a dictionary. |
Method | testHal | The <hal> node is converted into a Python dict. |
Method | testProcessors | The <processors> node is converted into a Python list. |
Method | testAliases | The <aliases> node is converted into a Python list. |
Method | testUdev | The content of the <udev> node is converted into a list of dicts. |
Method | testUdevLineWithoutColon | <udev> nodes with lines not in key: value format are rejected. |
Method | testUdevPropertyLineWithoutEqualSign | <udev> nodes with lines not in key: value format are rejected. |
Method | testUdevDataWithDuplicateKey | <udev> nodes with lines not in key: value format are rejected. |
Method | testDmi | The content of the <udev> node is converted into a dictionary. |
Method | testDmiInvalidData | <dmi> nodes with lines not in key:value format are rejected. |
Method | testSysfsAttributes | Test of SubmissionParser._parseSysfsAttributes(). |
Method | testSysfsAttributesLineWithoutKeyValueData | Test of SubmissionParser._parseSysfsAttributes(). |
Method | testSysfsAttributesDuplicatePLine | Test of SubmissionParser._parseSysfsAttributes(). |
Method | testSysfsAttributesNoPLineAtDeviceStart | Test of SubmissionParser._parseSysfsAttributes(). |
Method | testSysfsAttributesNoAttributeKeyValue | Test of SubmissionParser._parseSysfsAttributes(). |
Method | testSysfsAttributesInvalidMainKey | Test of SubmissionParser._parseSysfsAttributes(). |
Class | MockSubmissionParserParseHardwareTest | A SubmissionParser variant for testing checkCOnsistentData() |
Method | testHardware | The <hardware> tag is converted into a dictionary. |
Method | testHardware_no_sysfs_node | If teh <sysfs-attributes> node is missing, parseHardware() |
Method | test_parseHardware_sub_parsers_fail | Test of SubmissionParser._parseHardware(). |
Method | testLsbRelease | The <lsbrelease> node is converted into a Python dictionary. |
Method | testPackages | The <packages> node is converted into a Python dictionary. |
Method | testDuplicatePackage | Two <package> nodes with the same name are rejected. |
Method | testXorg | The <xorg> node is converted into a Python dictionary. |
Method | testDuplicateXorgDriver | Two <driver> nodes in <xorg> with the same name are rejected. |
Method | test_parseSoftware | Test SubmissionParser._parseSoftware |
Method | test_parseSoftware_without_xorg_node | Test SubmissionParser._parseSoftware |
Method | test_parseSoftware_without_packages_node | Test SubmissionParser._parseSoftware |
Method | testMultipleChoiceQuestion | The <questions> node is converted into a Python dictionary. |
Method | testMeasurementQuestion | The <questions> node is converted into a Python dictionary. |
Method | testContext | The content of the <context> node is currently not processed. |
Class | MockSubmissionParserMainParserTest | A SubmissionParser variant for testing checkCOnsistentData() |
Method | testMainParser | Test SubmissionParser.parseMainSections |
Method | testSubmissionParser | Test the entire parser. |
Method | testFindDuplicates | Test of SubmissionParser._findDuplicates. |
Method | testFindDuplicateIDs | SubmissionParser.findDuplicateIDs lists duplicate IDS. |
Method | testFindDuplicateIDsUdev | SubmissionParser.findDuplicateIDs lists duplicate IDS. |
Method | testFindDuplicateIDsDuplicateUdevNode | SubmissionParser.findDuplicateIDs lists duplicate IDS. |
Method | testIDMap | Test of SubmissionParser._getIDMap. |
Method | testIDMapUdev | Test of SubmissionParser._getIDMap. |
Method | testInvalidIDReferencesUdev | Test of SubmissionParser.checkIDReferences. |
Method | testUDIDeviceMap | Test the creation of the mapping UDI -> device. |
Method | testIDUDIMaps | Test of SubmissionParser._getIDUDIMaps. |
Method | testUDIChildren | Test of SubmissionParser.getUDIChildren. |
Method | testUDIDeviceMapInvalidRootNode | The root node of the devices must have a special UDI. |
Method | testUDIDeviceMapMissingRootNode | If no root node exists, getUDIChildren raises a ValueError. |
Method | testParentChildInconsistency | Test of SubmissionParser.checkHALDevicesParentChildConsistency. |
Method | testCheckUdevDictsHavePathKey | Test of SubmissionParser.checkNodesHavePathKey() |
Method | testCheckUdevPciProperties | Test of SubmissionParser.checkUdevPciProperties(). |
Method | testCheckUdevPciPropertiesNonPciDeviceWithPciProperties | Test of SubmissionParser.checkUdevPciProperties(). |
Method | testCheckUdevPciPropertiesPciDeviceWithoutRequiredProperties | Test of SubmissionParser.checkUdevPciProperties(). |
Method | testCheckUdevPciPropertiesPciDeviceWithNonIntegerPciClass | Test of SubmissionParser.checkUdevPciProperties(). |
Method | testCheckUdevPciPropertiesPciDeviceWithInvalidPciClassValue | Test of SubmissionParser.checkUdevPciProperties(). |
Method | testCheckUdevPciPropertiesPciDeviceWithInvalidDeviceID | Test of SubmissionParser.checkUdevPciProperties(). |
Method | testCheckUdevPciPropertiesPciDeviceWithInvalidSubsystemID | Test of SubmissionParser.checkUdevPciProperties(). |
Method | testCheckUdevUsbProperties | Test of SubmissionParser.checkUdevUsbProperties(). |
Method | testCheckUdevUsbProperties_missing_required_property | Test of SubmissionParser.checkUdevUsbProperties(). |
Method | testCheckUdevUsbProperties_with_invalid_product_id | Test of SubmissionParser.checkUdevUsbProperties(). |
Method | testCheckUdevUsbProperties_with_invalid_type_data | Test of SubmmissionParser.checkUdevUsbProperties(). |
Method | testCheckUdevUsbProperties_with_invalid_devtype | Test of SubmmissionParser.checkUdevUsbProperties(). |
Method | testCheckUdevUsbProperties_interface_without_interface_property | Test of SubmmissionParser.checkUdevUsbProperties(). |
Method | testCheckUdevUsbProperties_interface_invalid_interface_property | Test of SubmmissionParser.checkUdevUsbProperties(). |
Method | testCheckUdevScsiProperties | Test of SubmissionParser.checkUdevScsiProperties(). |
Method | testCheckUdevScsiProperties_data_is_none | Test of SubmissionParser.checkUdevScsiProperties(). |
Method | testCheckUdevScsiProperties_missing_devtype | Test of SubmissionParser.checkUdevScsiProperties(). |
Method | testCheckUdevScsiProperties_no_sysfs_data | Test of SubmissionParser.checkUdevScsiProperties(). |
Method | testCheckUdevScsiProperties_missing_sysfs_attributes | Test of SubmissionParser.checkUdevScsiProperties(). |
Class | UdevTestSubmissionParser | A variant of SubmissionParser that shortcuts udev related tests. |
Method | testCheckConsistentUdevDeviceData | Test of SubmissionParser.checkConsistentUdevDeviceData(), |
Method | testCheckConsistentUdevDeviceData_invalid_path_data | Test of SubmissionParser.checkConsistentUdevDeviceData(), |
Method | testCheckConsistentUdevDeviceData_invalid_pci_data | Test of SubmissionParser.checkConsistentUdevDeviceData(), |
Method | testCheckConsistentUdevDeviceData_invalid_usb_data | Test of SubmissionParser.checkConsistentUdevDeviceData(), |
Method | testCheckConsistentUdevDeviceData_invalid_scsi_data | Test of SubmissionParser.checkConsistentUdevDeviceData(), |
Method | testCheckConsistentUdevDeviceData_invalid_dmi_data | Test of SubmissionParser.checkConsistentUdevDeviceData(), |
Class | MockSubmissionParser | A SubmissionParser variant for testing checkCOnsistentData() |
Method | assertErrorMessage | Search for message in the log entries for submission_key. |
Method | assertWarningMessage | Search for message in the log entries for submission_key. |
Method | testConsistencyCheck | Test of SubmissionParser.checkConsistency. |
Method | testConsistencyCheckValidUdevData | Test of SubmissionParser.checkConsistency. |
Method | testConsistencyCheck_invalid_udev_data | Test of SubmissionParser.checkConsistency. |
Method | testConsistencyCheckWithDuplicateIDs | SubmissionParser.checkConsistency detects duplicate IDs. |
Method | testConsistencyCheckWithInvalidIDReferences | SubmissionParser.checkConsistency detects invalid ID references. |
Method | testConsistencyCheckWithDuplicateUDI | SubmissionParser.checkConsistency detects duplicate UDIs. |
Method | testConsistencyCheckChildUDIWithoutParent | SubmissionParser.checkConsistency detects "orphaned" devices. |
Method | testConsistencyCheckCircularParentChildRelation | SubmissionParser.checkConsistency detects "orphaned" devices. |
Method | _runPropertyTest | Undocumented |
Inherited from TestCase:
Method | becomeDbUser | Commit, then log into the database as dbuser . |
Method | __str__ | The string representation of a test is its id. |
Method | useContext | Use the supplied context in this test. |
Method | makeTemporaryDirectory | Create a temporary directory, and return its path. |
Method | installKarmaRecorder | Set up and return a KarmaRecorder . |
Method | assertProvides | Assert 'obj' correctly provides 'interface'. |
Method | assertNotifies | Assert that a callable performs a given notification. |
Method | assertNoNotification | Assert that no notifications are generated by the callable. |
Method | assertSqlAttributeEqualsDate | Fail unless the value of the attribute is equal to the date. |
Method | assertTextMatchesExpressionIgnoreWhitespace | Undocumented |
Method | assertIsInstance | Assert that an instance is an instance of assert_class. |
Method | assertIsNot | Assert that expected is not the same object as observed . |
Method | assertContentEqual | Assert that 'iter1' has the same content as 'iter2'. |
Method | assertRaisesWithContent | Check if the given exception is raised with given content. |
Method | assertBetween | Assert that 'variable' is strictly between two boundaries. |
Method | assertVectorEqual | Apply assertEqual to all given pairs in one go. |
Method | expectedLog | Expect a log to be written that matches the regex. |
Method | pushConfig | Push some key-value pairs into a section of the config. |
Method | attachOopses | Undocumented |
Method | attachLibrarianLog | Include the logChunks from fixture in the test details. |
Method | assertStatementCount | Assert that the expected number of SQL statements occurred. |
Method | useTempDir | Use a temporary directory for this test. |
Method | assertEmailHeadersEqual | Assert that two email headers are equal. |
Method | assertStartsWith | Undocumented |
Method | assertEndsWith | Asserts that s ends with suffix. |
Method | checkPermissions | Check if the used_permissions match expected_permissions. |
Method | assertEmailQueueLength | Pop the email queue, assert its length, and return it. |
Method | _unfoldEmailHeader | Unfold a multiline email header. |
type(value) is int or long, depending on the value.
type(value) is float.
a_list is a Python list, where the list elements represent the values of the <value> sub-nodes of the <property>.
a_dict is a Python dictionary, where the items represent the values of the <value> sub-nodes of the <property>.
The list elements represent the <processor> nodes.
The list elements represent the <alias> nodes.
The content of the <sys-attributes> node is converted into a dictionary.
Lines not in key: value format are rejected.
A line starting with "P:" must be the first line of a device block.
The data for a device must start with a "P:" line.
A line starting with "A:" must be in key=value format.
All lines must start with "P:" or "A:".
If one of the sub-parsers returns None, _parseHardware() returns None.
Each dict item represents a <property> sub-node.
Each dict item represents a <package> sub-node as (package_name, package_data), where package_data is a dictionary representing the <property> sub-nodes of a <package> node.
Ensure that all sub-parsers are properly called.
Ensure that _parseSoftware creates an entry in its result for <xorg> even if the submitted data does not contains this node.
Ensure that _parseSoftware creates an entry in its result for <packages> even if the submitted data does not contains this node.
Instead, a log warning is issued.
Ensure that all sub-parsers are properly called.
The IDs of HAL devices, processors and packages should be unique.
The IDs of udev devices, processors and packages should be unique.
Two udev dictionaries with the same device['P'] value are invalid.
Variant for submissions with udev data.
Variant for submissions containing udev data.
getUDIChildren ensures that the only device without an info.parent property has the UDI /org/freedesktop/Hal/devices/computer (ROOT_UDI).
A non-PCI device having PCI properties makes a submission invalid.
A PCI device not having a required PCI property makes a submission invalid.
A PCI device with a non-integer class value makes a submission invalid.
A PCI device with invalid class data makes a submission invalid.
A PCI device with an invalid device ID makes a submission invalid.
A PCI device with an invalid subsystem ID makes a submission invalid.
udev nodes for USB devices must define the three properties DEVTYPE, PRODUCT, TYPE or none of them.
A USB device where some but not all of the properties DEVTYPE, PRODUCT, TYPE are defined makes a submission invalid.
A USB device with an invalid product ID makes a submission invalid.
A USB device with invalid type data makes a submission invalid.
A udev USB device must have DEVTYPE set to 'usb_device' or 'usb_interface'.
A udev USB device for a USB interface have the property INTERFACE.
The INTERFACE proeprty of A udev USB device for a USB interface must have value in the format main_class/sub_class/version
checkUdevScsiProperties() even if no sysfs properties are available.
Each udev SCSI node must define the DEVTYPE property.
Each udev SCSI node must have a corresponding sysfs node.
Each sysfs node for a udev SCSI node must have a the attribues vendor, model and type.
Detection of invalid path data lets the check fail.
Detection of invalid PCI data lets the check fail.
Detection of invalid USB data lets the check fail.
Detection of invalid SCSI data lets the check fail.
Detection of invalid DMI data lets the check fail.
Search for message in the log entries for submission_key. assertErrorMessage requires that (a) a log message starts with "Parsing submisson <submission_key>:" (b) the error message passed as the parameter message appears in a log string that matches (a) (c) result, which is supposed to contain an object representing the result of parsing a submission, is None. (d) the log level is ERROR. If all four criteria match, assertErrormessage does not raise any exception.
Search for message in the log entries for submission_key. assertErrorMessage requires that (a) a log message starts with "Parsing submisson <submission_key>:" (b) the error message passed as the parameter message appears in a log string that matches (a) (c) result, which is supposed to contain an object representing the result of parsing a submission, is None. (d) the log level is WARNING. If all four criteria match, assertWarningMessage does not raise any exception.