add grow-case tests for squashfs and FAT32 copyFilesystems paths#8
Open
eriknordmark wants to merge 1 commit into
Open
add grow-case tests for squashfs and FAT32 copyFilesystems paths#8eriknordmark wants to merge 1 commit into
eriknordmark wants to merge 1 commit into
Conversation
Two new tests cover the grow case (target larger than source) for the two filesystem types EVE-style migrations actually exercise: - TestCopyFilesystemsSquashfs builds a real squashfs into a source partition using go-diskfs's writer, then grows it 3x via copyFilesystems. Hits the squashfs branch and exercises the full raw-copy + verifyBlockCopy + squashfs-read round-trip, with file content verification at the end. Requires the upstream go-diskfs squashfs partition-offset and verifyBlockCopy grow fixes (diskfs/go-diskfs#404). - TestCopyFilesystemsFat32Grow builds a FAT32 source with a known marker file and grows it 4x. Hits the FAT32 branch (CreateFilesystem + CopyFileSystem + CompareFS), which the existing TestCopyFilesystems didn't exercise — that one uses an equal-sized target. Does not depend on the go-diskfs squashfs fix; passes against upstream go-diskfs as-is. Together they pin down the two filesystem-copy paths that drive the realistic shape of partition-grow workflows (rootfs squashfs grow and ESP FAT32 grow). Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new tests covering the grow case (target partition larger than source) for the two filesystem types EVE-style partition migrations actually exercise:
TestCopyFilesystemsSquashfs
Builds a real squashfs into a source partition using go-diskfs's writer, then grows it 3× via
copyFilesystems. Hits the squashfs branch, exercises the full raw-copy +verifyBlockCopy+squashfs.Readround-trip, with file content verification at the end.Depends on diskfs/go-diskfs#404. Against the current upstream go-diskfs HEAD (7b44905), this test fails because:
squashfs.Finalizewrites the squashfs at byte 0 of the disk instead of the partition's byte offset (clobbering the GPT).sync.verifyBlockCopywould reject the grow case afterward because target size > source size.With #404 applied (Sub-wrapping the backend in squashfs.Create/Read; LimitWriter on both sides in verifyBlockCopy), the test passes:
TestCopyFilesystemsFat32Grow
Builds a FAT32 source with a known marker file and grows it 4×. Hits the FAT32 branch of
copyFilesystems(CreateFilesystem+CopyFileSystem+CompareFS), which the existingTestCopyFilesystemsdidn't cover — that one uses an equal-sized target.Does not depend on #404. Passes against unmodified upstream go-diskfs as-is; the FAT32 path uses file-level copy, not the raw-copy / verifyBlockCopy code that #404 touches.
Why this matters
Together, these two tests pin down the two filesystem-copy code paths that real grow workflows hit:
Without them,
copyFilesystems' grow behavior was only exercised end-to-end byTestRun, which is currently blocked on a separate go-diskfs ext4 multi-GB CreateFilesystem issue (diskfs/go-diskfs#402) and so doesn't surface regressions in the squashfs/FAT32 paths.Merge order
This PR should land after diskfs/go-diskfs#404 merges and partitionresizer's
go.modbumps to a version that includes the fix. Until then, CI will reportTestCopyFilesystemsSquashfsfailing here.The FAT32 test can be cherry-picked or split out earlier if you'd prefer; happy to follow either path.
Signed-off-by: eriknordmark erik@zededa.com