Add fastlz compression support

This commit is contained in:
Lucian Petrut
2026-09-07 13:10:10 +00:00
parent b7131ec0af
commit 56a1c36c80
13 changed files with 522 additions and 71 deletions
+7 -2
View File
@@ -12,13 +12,18 @@ from tests.integration.base import LabEnv, SECTOR_SIZE, pattern_bytes
class TestNfcOpen:
@pytest.mark.parametrize(
"nfc_ssl", [True, False], ids=["nbdssl", "nbd"])
@pytest.mark.parametrize(
"compression",
[nfc_open.NFC_COMPRESSION_NONE, nfc_open.NFC_COMPRESSION_FASTLZ],
ids=["plain", "fastlz"])
def test_open_disk_and_read_first_sector(
self, lab: LabEnv, nfc_ssl: bool) -> None:
self, lab: LabEnv, nfc_ssl: bool, compression: int) -> None:
"""Open the temp VMDK, write sector 0, and read it back."""
expected = pattern_bytes(SECTOR_SIZE, b"NFC-OPEN-S0")
with lab.authenticate(read_only=False, nfc_ssl=nfc_ssl) as session:
with nfc_open.open_disk(
session, lab.disk_path, read_only=False) as disk:
session, lab.disk_path, read_only=False,
compression=compression) as disk:
assert disk.path == lab.disk_path
assert disk.handle > 0
assert disk.sector_size == SECTOR_SIZE