l.h.s.t.t.TestUdevDevice(TestCaseHWDB) : class documentation

Part of lp.hardwaredb.scripts.tests.test_hwdb_submission_processing View In Hierarchy

Tests of class UdevDevice.
Method setUp Setup the test environment.
Method test_device_device_id Test of UdevDevice.device_id.
Method test_root_device_ids Undocumented
Method test_is_pci Test of UdevDevice.is_pci.
Method test_pci_class_info Test of UdevDevice.pci_class_info
Method test_pci_class Test of UdevDevice.pci_class
Method test_pci_subclass Test of UdevDevice.pci_subclass
Method test_pci_ids Test of UdevDevice.pci_ids
Method test_is_usb Test of UdevDevice.is_usb
Method test_usb_ids Test of UdevDevice.usb_ids
Method test_usb_vendor_id Test of UdevDevice.usb_vendor_id
Method test_usb_product_id Test of UdevDevice.usb_product_id
Method test_is_scsi_device Test of UdevDevice.is_scsi_device.
Method test_is_scsi_device__no_sysfs_data Test of UdevDevice.is_scsi_device.
Method test_scsi_vendor Test of UdevDevice.scsi_vendor.
Method test_scsi_model Test of UdevDevice.scsi_model.
Method test_raw_bus Test of UdevDevice.raw_bus.
Method test_is_root_device Test of UdevDevice.is_root_device.
Method test_getVendorOrProduct Test of UdevDevice.getVendorOrProduct().
Method test_vendor Test of UdevDevice.vendor.
Method test_product Test of UdevDevice.product.
Method test_getVendorOrProductID Test of UdevDevice.getVendorOrProduct().
Method test_vendor_id Test of UdevDevice.vendor_id.
Method test_product_id Test of UdevDevice.product_id.
Method test_vendor_id_for_db Test of UdevDevice.vendor_id_for_db.
Method test_product_id_for_db Test of UdevDevice.product_id_for_db.
Method test_driver_name Test of UdevDevice.driver_name.
Method buildUdevDeviceHierarchy Build a UdevDevice hierarchy from device_data.
Method test_scsi_controller Test of UdevDevice.scsi_controller for a PCI controller.
Method test_scsi_controller_insufficient_anchestors Test of UdevDevice.scsi_controller for a PCI controller.
Method test_scsi_controller_no_scsi_device Test of UdevDevice.scsi_controller for a PCI controller.
Method test_translateScsiBus_real_scsi_device Test of UdevDevice.translateScsiBus() with a real SCSI device.
Method test_translateScsiBus_ide_device Test of UdevDevice.translateScsiBus() with an IDE device.
Method test_translateScsiBus_usb_device Test of UdevDevice.translateScsiBus() with a USB device.
Method test_translateScsiBus_non_scsi_device Test of UdevDevice.translateScsiBus() for a non-SCSI device.
Method test_translatePciBus Test of UdevDevice.translatePciBus().
Method test_real_bus_usb_device Test of UdevDevice.real_bus for a USB device.
Method test_real_bus_usb_interface Test of UdevDevice.real_bus for a USB interface.
Method test_real_bus_pci Test of UdevDevice.real_bus for PCI devices.
Method test_real_bus_scsi Test of UdevDevice.real_bus for a SCSI device.
Method test_real_bus_system Test of UdevDevice.real_bus for a system.
Method test_is_real_device_root_device Test of UdevDevice._is_real_device for the root device.
Method test_is_real_device_pci_device Test of UdevDevice._is_real_device for a PCI device.
Method test_is_real_device_scsi_device_related_nodes Test of UdevDevice._is_real_device for SCSI related nodes.
Method test_is_real_device_ide_device_related_nodes Test of UdevDevice._is_real_device for IDE related nodes.
Method test_is_real_device_ata_device_related_nodes Test of UdevDevice._is_real_device for IDE related nodes.
Method test_is_real_device_usb_storage_device_related_nodes Test of UdevDevice._is_real_device for USB storage related nodes.
Method test_is_real_device_usb_hub_with_odd_parent Test of UdevDevice._is_real_device for USB storage related nodes.
Method test_has_reliable_data_system Test of UdevDevice.has_reliable_data for a system.
Method test_has_reliable_data_system_no_vendor_name Test of UdevDevice.has_reliable_data for a system.
Method test_has_reliable_data_system_no_product_name Test of UdevDevice.has_reliable_data for a system.
Method test_has_reliable_data_acpi_device Test of UdevDevice.has_reliable_data for an ACPI device.
Method test_has_reliable_data_platform_device Test of UdevDevice.has_reliable_data for a "platform" device.
Method test_has_reliable_data_pci_device Test of UdevDevice.has_reliable_data for a PCI device.
Method test_has_reliable_data_usb_device Test of UdevDevice.has_reliable_data for a USB device.
Method test_has_reliable_data_scsi_device Test of UdevDevice.has_reliable_data for a SCSI device.
Method test_has_reliable_data_usb_interface_device Test of UdevDevice.has_reliable_data for a USB interface.
Method test_warnings_not_suppressed Logging of warnings can be allowed.
Method test_warnings_suppressed Logging of warnings can be suppressed.
Method test_device_id Each UdevDevice has a property 'id'.

Inherited from TestCaseHWDB:

Method assertWarningMessage Search for message in the log entries for submission_key.
Method assertErrorMessage Search for log_message in the log entries for submission_key.

Inherited from TestCase (via TestCaseHWDB):

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.
def setUp(self):
Setup the test environment.
def test_device_device_id(self):
Test of UdevDevice.device_id.
def test_root_device_ids(self):
Undocumented
def test_is_pci(self):
Test of UdevDevice.is_pci.
def test_pci_class_info(self):
Test of UdevDevice.pci_class_info
def test_pci_class(self):
Test of UdevDevice.pci_class
def test_pci_subclass(self):
Test of UdevDevice.pci_subclass
def test_pci_ids(self):
Test of UdevDevice.pci_ids
def test_is_usb(self):
Test of UdevDevice.is_usb
def test_usb_ids(self):
Test of UdevDevice.usb_ids
def test_usb_vendor_id(self):
Test of UdevDevice.usb_vendor_id
def test_usb_product_id(self):
Test of UdevDevice.usb_product_id
def test_is_scsi_device(self):
Test of UdevDevice.is_scsi_device.
def test_is_scsi_device__no_sysfs_data(self):
Test of UdevDevice.is_scsi_device.

If there is no sysfs data for a real SCSI device, is it not considered as a real SCSI device.

Reason: Without sysfs data, we don't know the vendor and model name, making it impossible to store data about the device in the database.

def test_scsi_vendor(self):
Test of UdevDevice.scsi_vendor.
def test_scsi_model(self):
Test of UdevDevice.scsi_model.
def test_raw_bus(self):
Test of UdevDevice.raw_bus.
def test_is_root_device(self):
Test of UdevDevice.is_root_device.
def test_getVendorOrProduct(self):
Test of UdevDevice.getVendorOrProduct().
def test_vendor(self):
Test of UdevDevice.vendor.
def test_product(self):
Test of UdevDevice.product.
def test_getVendorOrProductID(self):
Test of UdevDevice.getVendorOrProduct().
def test_vendor_id(self):
Test of UdevDevice.vendor_id.
def test_product_id(self):
Test of UdevDevice.product_id.
def test_vendor_id_for_db(self):
Test of UdevDevice.vendor_id_for_db.
def test_product_id_for_db(self):
Test of UdevDevice.product_id_for_db.
def test_driver_name(self):
Test of UdevDevice.driver_name.
def buildUdevDeviceHierarchy(self, device_data, parser=None):
Build a UdevDevice hierarchy from device_data.

:param device_data: A sequence of arguments that are passed
    to the UdevDevice constructor. Each element must be a
    dictionary that can be used as a **kwargs argument.

    Element N of the sequence is the parent of element N+1.
:param parser: A SubmissionParser instance to be passed to
    the constructor of UdevDevice.
def test_scsi_controller(self):
Test of UdevDevice.scsi_controller for a PCI controller.
def test_scsi_controller_insufficient_anchestors(self):
Test of UdevDevice.scsi_controller for a PCI controller.

If a SCSI device does not have a sufficient number of ancestors, UdevDevice.scsi_controller returns None.

def test_scsi_controller_no_scsi_device(self):
Test of UdevDevice.scsi_controller for a PCI controller.

For non-SCSI devices, this property is None.

def test_translateScsiBus_real_scsi_device(self):
Test of UdevDevice.translateScsiBus() with a real SCSI device.
def test_translateScsiBus_ide_device(self):
Test of UdevDevice.translateScsiBus() with an IDE device.
def test_translateScsiBus_usb_device(self):
Test of UdevDevice.translateScsiBus() with a USB device.
def test_translateScsiBus_non_scsi_device(self):
Test of UdevDevice.translateScsiBus() for a non-SCSI device.
def test_translatePciBus(self):
Test of UdevDevice.translatePciBus().
def test_real_bus_usb_device(self):
Test of UdevDevice.real_bus for a USB device.
def test_real_bus_usb_interface(self):
Test of UdevDevice.real_bus for a USB interface.
def test_real_bus_pci(self):
Test of UdevDevice.real_bus for PCI devices.
def test_real_bus_scsi(self):
Test of UdevDevice.real_bus for a SCSI device.
def test_real_bus_system(self):
Test of UdevDevice.real_bus for a system.
def test_is_real_device_root_device(self):
Test of UdevDevice._is_real_device for the root device.
def test_is_real_device_pci_device(self):
Test of UdevDevice._is_real_device for a PCI device.
def test_is_real_device_scsi_device_related_nodes(self):
Test of UdevDevice._is_real_device for SCSI related nodes.

A SCSI device and its controller are represented by several nodes which describe different aspects. Only the controller itself and the node representing the SCSI device are considered to be real devices.

def test_is_real_device_ide_device_related_nodes(self):
Test of UdevDevice._is_real_device for IDE related nodes.

An IDE device and its controller are represented by several nodes which describe different aspects. Only the controller itself and the node representing the IDE device are considered to be real devices.

def test_is_real_device_ata_device_related_nodes(self):
Test of UdevDevice._is_real_device for IDE related nodes.

An IDE device and its controller are represented by several nodes which describe different aspects. Only the controller itself and the node representing the IDE device are considered to be real devices.

def test_is_real_device_usb_storage_device_related_nodes(self):
Test of UdevDevice._is_real_device for USB storage related nodes.

A USB storage device is represented by several nodes which describe different aspects. Only the main USB device is considered to be real devices.

def test_is_real_device_usb_hub_with_odd_parent(self):
Test of UdevDevice._is_real_device for USB storage related nodes.

If called for USB hub node with vendor ID == 0 and product_id == 0 which is not the child of a PCI device, we get a warning.

def test_has_reliable_data_system(self):
Test of UdevDevice.has_reliable_data for a system.
def test_has_reliable_data_system_no_vendor_name(self):
Test of UdevDevice.has_reliable_data for a system.

If the DMI data does not provide vendor name, has_reliable_data is False.

def test_has_reliable_data_system_no_product_name(self):
Test of UdevDevice.has_reliable_data for a system.

If the DMI data does not provide product name, has_reliable_data is False.

def test_has_reliable_data_acpi_device(self):
Test of UdevDevice.has_reliable_data for an ACPI device.

APCI devices are considered not to have reliable data. The only exception is the root device, see test_has_reliable_data_system.

def test_has_reliable_data_platform_device(self):
Test of UdevDevice.has_reliable_data for a "platform" device.

devices with raw_bus == 'platform' are considered not to have reliable data.

def test_has_reliable_data_pci_device(self):
Test of UdevDevice.has_reliable_data for a PCI device.
def test_has_reliable_data_usb_device(self):
Test of UdevDevice.has_reliable_data for a USB device.
def test_has_reliable_data_scsi_device(self):
Test of UdevDevice.has_reliable_data for a SCSI device.
def test_has_reliable_data_usb_interface_device(self):
Test of UdevDevice.has_reliable_data for a USB interface.

UdevDevice.has_reliable_data should only be called for nodes where is_rel_device is True. If called for other nodes, we may get a warning because they do not provide reqired data, like a bus, vendor or product ID.

def test_warnings_not_suppressed(self):
Logging of warnings can be allowed.
def test_warnings_suppressed(self):
Logging of warnings can be suppressed.
def test_device_id(self):
Each UdevDevice has a property 'id'.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.