示例#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)
示例#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)
示例#3
0
文件: lvm.py 项目: xin49/vdsm
def _getpvblksize(pv):
    dev = devicemapper.getDmId(os.path.basename(pv))
    return multipath.getDeviceBlockSizes(dev)
示例#4
0
文件: lvm.py 项目: EdDev/vdsm
def _getpvblksize(pv):
    dev = devicemapper.getDmId(os.path.basename(pv))
    return multipath.getDeviceBlockSizes(dev)