Skip to content

Fix mtools version sensitivity in 095 and 099 FAT tests - #297

Merged
fhunleth merged 1 commit into
fwup-home:mainfrom
Hermanverschooten:fix-mdir-sparse-tests
Jul 23, 2026
Merged

Fix mtools version sensitivity in 095 and 099 FAT tests#297
fhunleth merged 1 commit into
fwup-home:mainfrom
Hermanverschooten:fix-mdir-sparse-tests

Conversation

@Hermanverschooten

Copy link
Copy Markdown
Contributor

Follow-up to #287. That PR relaxed the exact mdir directory-listing comparison in the FAT tests to tolerate newer mtools formatting, but missed 095_sparse_apply and 099_sparse_lasthole (the two sparse tests that mkfs at offset 0 and so weren't in the @@32256 batch).

The failure

On the macOS CI runners (mtools 4.0.49), mdir renders the short-name directory entry with a phantom column for entries that use the VFAT lowercase NT-case flags:

< sparse   bin   9234631 ...
> sparse  _bin bin   9234631 ...

so the exact diff fails. It's nondeterministic — it hits a different subset of the exact-diff FAT tests each run, which is why it only ever showed up on CI.

Root cause (confirmed, not an fwup bug)

fwup writes a valid entry — verified by dumping the raw root-dir bytes on both Linux and an arm64 Mac:

53 50 41 52 53 45 20 20  42 49 4e 20  18   ...
S  P  A  R  S  E  ␠  ␠   B  I  N  ␠   NTflags=0x18

Short name SPARSE␠␠BIN, byte 0x0C = 0x18 (lowercase basename + ext), no LFN entry, preceding slot zeroed. The _bin is purely mtools's rendering of that entry. File content is already independently verified by the existing mcopy + cmp.

Fix

Replace the full-listing diff with the same targeted grep #287 introduced. Reproduced the failure and verified the fix on an arm64 Mac (macOS 26, mtools 4.0.49) via make distcheck, and confirmed no regression on Linux.

Follow-up to fwup-home#287, which relaxed the exact mdir directory-listing
comparison in the other FAT tests but missed these two sparse tests.
Newer mtools (4.0.44+) renders the short-name directory entry with a
phantom column (e.g. "sparse  _bin bin") for entries that use the
VFAT lowercase NT-case flags, so the exact diff fails nondeterministically
on the macOS CI runners.

Replace the full-listing diff with the same targeted grep fwup-home#287 used,
which tolerates the mtools formatting. File content is still verified
byte-for-byte by the existing mcopy + cmp.
@fhunleth
fhunleth merged commit 8092111 into fwup-home:main Jul 23, 2026
9 checks passed
@fhunleth

Copy link
Copy Markdown
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants