Skip to content

Add rootfs tests - #1498

Merged
ValentaTomas merged 24 commits into
nbd-fixfrom
rootfs-test
Nov 19, 2025
Merged

ValentaTomas merged 24 commits into
nbd-fixfrom
rootfs-test

Conversation

@ValentaTomas

@ValentaTomas ValentaTomas commented Nov 16, 2025 •

Copy link
Copy Markdown
Member
  • Refactor nbd testing
  • Add a simple test for the failing NBD writes

I had to change the tests to run as root, because NBD requires that.
I also added -race in the unit tests—will remove and re-add it in another PR if it is problematic here to quickly merge the hotfix.
More tests for the NBD should follow in next PR too.


Note

Adds NBD direct-path tests with new test utilities, enhances mount-rootfs (empty/verify/log), enables NBD and root-permission tests in CI, and removes legacy mock-nbd.

  • Tests (orchestrator):
    • Add nbd direct-path read/write tests (incl. O_DIRECT and large dd) in internal/sandbox/nbd/path_direct_test.go.
    • Introduce test utilities in internal/sandbox/nbd/testutils/* (ZeroDevice, BuildDevice, NBD device/mount helpers, cleaner, logger overlay, template rootfs helper).
  • CLI:
    • Expand cmd/mount-rootfs with flags: -empty, -size, -block-size, -verify, -log; supports creating empty rootfs, integrity/journal verification, and structured logging.
    • Simplify start.sh to pass through args.
  • CI:
    • Enable NBD (modprobe nbd), add udev rule to disable inotify on nbd*, and run go test with sudo in PR workflow.
  • Refactor/Removals:
    • Remove cmd/mock-nbd/ and mock-nbd Makefile target; drop github.com/pojntfx/go-nbd dependency.
    • Add DiffStore.RemoveCache() for cleanup; minor header comment tweak.

Written by Cursor Bugbot for commit da8c36d. This will update automatically on new commits. Configure here.

@ValentaTomas
ValentaTomas changed the base branch from main to nbd-fix November 19, 2025 03:02
@ValentaTomas
ValentaTomas marked this pull request as ready for review November 19, 2025 03:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/orchestrator/internal/sandbox/nbd/testutils/zero_device.go Outdated
Comment thread packages/orchestrator/internal/sandbox/nbd/testutils/zero_device.go
@ValentaTomas

ValentaTomas commented Nov 19, 2025 •

Copy link
Copy Markdown
Member Author

Merging to the other PR after tests pass.

Comment thread packages/orchestrator/cmd/mount-rootfs/main.go
@ValentaTomas
ValentaTomas merged commit aa33f09 into nbd-fix Nov 19, 2025
1 check passed
@ValentaTomas
ValentaTomas deleted the rootfs-test branch November 19, 2025 05:40
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.

3 participants