How to use the pycdlib.udf.UDFLogicalVolumeDescriptor function in pycdlib

To help you get started, we’ve selected a few pycdlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_equals():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    logvol.new()

    logvol2 = pycdlib.udf.UDFLogicalVolumeDescriptor()
    logvol2.new()

    assert(logvol == logvol2)
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_set_integrity_location_not_initialized():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    with pytest.raises(pycdlib.pycdlibexception.PyCdlibInternalError) as excinfo:
        logvol.set_integrity_location(0)
    assert(str(excinfo.value) == 'UDF Logical Volume Descriptor not initialized')
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_parse_bad_map_data():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    tag = pycdlib.udf.UDFTag()
    tag.new(0, 0)
    with pytest.raises(pycdlib.pycdlibexception.PyCdlibInvalidISO) as excinfo:
        logvol.parse(b'\x00'*16 + b'\x00\x00\x00\x00' + b'\x00'*64 + b'\x00'*128 + b'\x00\x08\x00\x00' + b'\x00*OSTA UDF Compliant' + b'\x00'*12 + b'\x00'*16 + b'\x00\x00\x00\x00\x01\x00\x00\x00' + b'\x00'*32 + b'\x00'*128 + b'\x00'*8 + b'\x00\x80' + b'\x00'*70, 0, tag)
    assert(str(excinfo.value) == 'Partition map goes beyond end of data, ISO corrupt')
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_equals():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    logvol.new()

    logvol2 = pycdlib.udf.UDFLogicalVolumeDescriptor()
    logvol2.new()

    assert(logvol == logvol2)
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_parse_bad_logical_block_size():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    tag = pycdlib.udf.UDFTag()
    tag.new(0, 0)
    with pytest.raises(pycdlib.pycdlibexception.PyCdlibInvalidISO) as excinfo:
        logvol.parse(b'\x00'*16 + b'\x00\x00\x00\x00' + b'\x00'*64 + b'\x00'*128 + b'\x00\x07\x00\x00' + b'\x00*OSTA UDF Compliant' + b'\x00'*12 + b'\x00'*16 + b'\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00'*32 + b'\x00'*128 + b'\x00'*8 + b'\x00'*72, 0, tag)
    assert(str(excinfo.value) == 'Volume Descriptor block size is not 2048')
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_extent_location_not_initialized():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    with pytest.raises(pycdlib.pycdlibexception.PyCdlibInternalError) as excinfo:
        logvol.extent_location()
    assert(str(excinfo.value) == 'UDF Logical Volume Descriptor not initialized')
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_add_partition_map_not_initialized():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    with pytest.raises(pycdlib.pycdlibexception.PyCdlibInternalError) as excinfo:
        logvol.add_partition_map(1)
    assert(str(excinfo.value) == 'UDF Logical Volume Descriptor not initialized')
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_add_partition_map_type_0():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    logvol.new()
    logvol.add_partition_map(0)
    assert(len(logvol.partition_maps) == 1)
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_new_initialized_twice():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    logvol.new()
    with pytest.raises(pycdlib.pycdlibexception.PyCdlibInternalError) as excinfo:
        logvol.new()
    assert(str(excinfo.value) == 'UDF Logical Volume Descriptor already initialized')
github clalancette / pycdlib / tests / unit / test_udf.py View on Github external
def test_logvoldesc_parse_map_type_0():
    logvol = pycdlib.udf.UDFLogicalVolumeDescriptor()
    tag = pycdlib.udf.UDFTag()
    tag.new(0, 0)
    logvol.parse(b'\x00'*16 + b'\x00\x00\x00\x00' + b'\x00'*64 + b'\x00'*128 + b'\x00\x08\x00\x00' + b'\x00*OSTA UDF Compliant' + b'\x00'*12 + b'\x00'*16 + b'\x02\x00\x00\x00\x01\x00\x00\x00' + b'\x00'*32 + b'\x00'*128 + b'\x00'*8 + b'\x00\x02' + b'\x00'*70, 0, tag)
    assert(len(logvol.partition_maps) == 1)
    assert(isinstance(logvol.partition_maps[0], pycdlib.udf.UDFType0PartitionMap))