예제 #1
0
파일: hostdev_test.py 프로젝트: nirs/vdsm
 def test_device_name_from_address(self, addr_type, addr, name):
     # we need to make sure we scan all the devices (hence caps=None)
     hostdev.list_by_caps()
     self.assertEqual(
         hostdev.device_name_from_address(addr_type, addr),
         name
     )
예제 #2
0
파일: hostdev_test.py 프로젝트: jxyzn/vdsm
    def testListByCaps(self, caps):
        devices = hostdev.list_by_caps(caps)

        for cap in caps:
            self.assertTrue(
                set(hostdevlib.DEVICES_BY_CAPS[cap].keys()).issubset(
                    set(devices.keys())))
예제 #3
0
def _get_sriov_devices():
    devices = hostdev.list_by_caps()
    return [
        device_name for device_name, device_info in six.viewitems(devices)
        if 'totalvfs' in device_info['params']
    ]
예제 #4
0
파일: hostdev_test.py 프로젝트: jxyzn/vdsm
 def test_3k_storage_devices(self):
     with hostdevlib.Connection.use_hostdev_tree():
         self.assertEqual(len(hostdev.list_by_caps()),
                          len(libvirtconnection.get().listAllDevices()))
예제 #5
0
파일: hostdev_test.py 프로젝트: jxyzn/vdsm
 def test_device_name_from_address(self, addr_type, addr, name):
     # we need to make sure we scan all the devices (hence caps=None)
     hostdev.list_by_caps()
     self.assertEqual(hostdev.device_name_from_address(addr_type, addr),
                      name)
예제 #6
0
파일: hostdev_test.py 프로젝트: nirs/vdsm
 def test_3k_storage_devices(self):
     with hostdevlib.Connection.use_hostdev_tree():
         self.assertEqual(
             len(hostdev.list_by_caps()),
             len(libvirtconnection.get().listAllDevices())
         )
예제 #7
0
파일: hostdev_test.py 프로젝트: nirs/vdsm
    def testListByCaps(self, caps):
        devices = hostdev.list_by_caps(caps)

        for cap in caps:
            self.assertTrue(set(hostdevlib.DEVICES_BY_CAPS[cap].keys()).
                            issubset(devices.keys()))
예제 #8
0
def _get_sriov_devices():
    devices = hostdev.list_by_caps()
    return [device_name for device_name, device_info
            in six.viewitems(devices)
            if 'totalvfs' in device_info['params']]