diff --git a/docker/tests/test_vault.py b/docker/tests/test_vault.py --- a/docker/tests/test_vault.py +++ b/docker/tests/test_vault.py @@ -43,8 +43,13 @@ tfinfo = tarfiles.get(join(dir_id, fname)) assert tfinfo, f"Missing path {fname} in retrieved tarfile" if fdesc["type"] == "file": - assert fdesc["length"] == tfinfo.size, f"File {fname}: length mismatch" - fdata = tarf.extractfile(tfinfo).read() + # symlink has no size in tar archive + if not tfinfo.issym(): + assert fdesc["length"] == tfinfo.size, f"File {fname}: length mismatch" + fdata = tarf.extractfile(tfinfo).read() + else: + # checksum was computed from targeted path for symlink + fdata = tfinfo.linkname.encode() for algo in fdesc["checksums"]: if algo not in hashlib.algorithms_available: continue