[vminitd]: api for freeze/thaw filesystem operations#685
Open
saehejkang wants to merge 3 commits into
Open
Conversation
Contributor
|
@dcantah wdyt? |
Contributor
|
Looks good! |
dcantah
reviewed
Apr 15, 2026
dcantah
reviewed
Apr 15, 2026
dcantah
reviewed
Apr 15, 2026
Contributor
Author
Contributor
|
@saehejkang Congrats! And it's a good question. I'm wondering if you could make a copy of one of the really simple "run container and exec a command" integration tests and extend it so that it does this instead:
|
4dc49f5 to
9dd12d9
Compare
Contributor
|
You'll need to run |
f01ce95 to
b7fbbe5
Compare
Contributor
Author
7 tasks
jglogan
reviewed
Jun 16, 2026
jglogan
left a comment
Contributor
There was a problem hiding this comment.
@saehejkang looks good, only a couple of nits
b82be48 to
4b06bfc
Compare
jglogan
requested changes
Jun 18, 2026
jglogan
requested changes
Jun 18, 2026
jglogan
reviewed
Jun 18, 2026
jglogan
left a comment
Contributor
There was a problem hiding this comment.
@saehejkang I ran into two errors when running make all integration:
- The defer-remove of cloneImageURL was removing the cloned image was removing the cloned image before it could be used in a later scope. Suite.swift removes testDir at the end of the tests, so the removes should be unnecessary.
- The dmesg check was failing; the output I was seeing when running the test was:
[ 0.310796] EXT4-fs (vdc): warning: mounting unchecked fs, running e2fsck is recommended [ 0.310975] EXT4-fs (vdc): mounted filesystem 8a5c73a9-3c81-45b5-909f-d4708ebfa119 r/w without journal. Quota mode: disabled.
I think that the prior mount check should be sufficient to ensure that the cloned fs was able to be mounted. Here's what I changed to get tests to pass:
diff --git a/Sources/Integration/ContainerTests.swift b/Sources/Integration/ContainerTests.swift
index 81ffc09..60362c8 100644
--- a/Sources/Integration/ContainerTests.swift
+++ b/Sources/Integration/ContainerTests.swift
@@ -4256,10 +4256,6 @@ extension IntegrationSuite {
}
try FileManager.default.copyItem(at: diskImageURL, to: cloneImageURL)
- defer {
- try? FileManager.default.removeItem(at: diskImageURL)
- try? FileManager.default.removeItem(at: cloneImageURL)
- }
try await writerContainer.filesystemOperation(operation: .thaw, path: "/data")
@@ -4304,22 +4300,6 @@ extension IntegrationSuite {
throw IntegrationError.assert(msg: "expected ext4 mount at /data, got: \(mountOutput)")
}
- let dmesgBuffer = BufferWriter()
- let dmesgExec = try await verifyContainer.exec("verify-dmesg-clean") { config in
- config.arguments = [
- "/bin/sh", "-c",
- "if dmesg | grep -Eiq 'fsck|recovering journal|recovery complete'; then dmesg | grep -Ei 'fsck|recovering journal|recovery complete'; exit 1; fi",
- ]
- config.stdout = dmesgBuffer
- }
- try await dmesgExec.start()
- status = try await dmesgExec.wait()
- try await dmesgExec.delete()
- guard status.exitCode == 0 else {
- let dmesgOutput = String(decoding: dmesgBuffer.data, as: UTF8.self)
- throw IntegrationError.assert(msg: "dmesg indicates filesystem recovery on cloned image: \(dmesgOutput)")
- }
-
let lsBuffer = BufferWriter()
let lsExec = try await verifyContainer.exec("verify-no-hello") { config in
config.arguments = ["ls", "-1", "/data"]
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.
Addition of
vminitdAPI for freeze/thaw filesystem operationsCloses #660