Ejemplo n.º 1
0
def test_with_device(tmpdir, sector_size):
    filename = str(tmpdir.join("file"))
    prepare_backing_file(filename)
    with loopback.Device(filename, sector_size=sector_size) as device:
        assert device.is_attached()
        check_device(device)
        block_size, _ = multipath.getDeviceBlockSizes(device.path)
        expected = sector_size if sector_size else sc.BLOCK_SIZE_512
        assert block_size == expected
    assert not device.is_attached()
    check_backing_file(filename)
Ejemplo n.º 2
0
def test_with_device(tmpdir, sector_size):
    filename = str(tmpdir.join("file"))
    prepare_backing_file(filename)
    with loopback.Device(filename, sector_size=sector_size) as device:
        assert device.is_attached()
        check_device(device)
        block_size, _ = multipath.getDeviceBlockSizes(device.path)
        expected = sector_size if sector_size else sc.BLOCK_SIZE_512
        assert block_size == expected
    assert not device.is_attached()
    check_backing_file(filename)
Ejemplo n.º 3
0
Archivo: lvm.py Proyecto: xin49/vdsm
def _getpvblksize(pv):
    dev = devicemapper.getDmId(os.path.basename(pv))
    return multipath.getDeviceBlockSizes(dev)
Ejemplo n.º 4
0
Archivo: lvm.py Proyecto: EdDev/vdsm
def _getpvblksize(pv):
    dev = devicemapper.getDmId(os.path.basename(pv))
    return multipath.getDeviceBlockSizes(dev)