示例#1
0
def storage_interfaces_to_test(session):
    """Return a list of all storage interface devices that connected to local
    disks and must be tested by the auto cert kit."""

    def comp_key(src, dst, key):
        return key in src and key in dst and src[key] == dst[key]

    # Get all interfaces that has a disk connected.
    devices = utils.get_local_storage_info(session)

    # Some devices, which can have multiple disks, only need to be tested once.
    devices_to_test = []
    for device in devices:
        for existing in devices_to_test:
            if comp_key(device, existing, 'vendor') and \
                    comp_key(device, existing, 'driver') and \
                    comp_key(device, existing, 'subclass') and \
                    comp_key(device, existing, 'class'):
                break
            if comp_key(device, existing, 'PCI_id'):
                break
        else:
            devices_to_test.append(device)

    return devices_to_test
示例#2
0
def storage_interfaces_to_test(session):
    """Return a list of all storage interface devices that connected to local
    disks and must be tested by the auto cert kit."""

    def comp_key(src, dst, key):
        return key in src and key in dst and src[key] == dst[key]

    # Get all interfaces that has a disk connected.
    devices = utils.get_local_storage_info(session)

    # Some devices, which can have multiple disks, only need to be tested once.
    devices_to_test = []
    for device in devices:
        for existing in devices_to_test:
            if comp_key(device, existing, 'vendor') and \
                comp_key(device, existing, 'driver') and \
                comp_key(device, existing, 'subclass') and \
                comp_key(device, existing, 'class'):
                break
            if comp_key(device, existing, 'PCI_id'):
                break
        else:
            devices_to_test.append(device)

    return devices_to_test
 def get_device_config(self):
     """Retrieve info regarding the local SCSI devices"""
     rec = super(StorageTestGenerator, self).get_device_config()
     devices = utils.get_local_storage_info(self.session)
     for device_rec in devices:
         rec = utils.combine_recs(rec, device_rec)
     return rec