Skip to content

Add a test target covering vmexec Console.configureStdIO #844

Description

@SomSamantray

Problem

The regression test added for the pty raw-mode fix (apple/container#1148) validates the pre-existing Terminal.setraw() recipe at the ContainerizationOS level, but never exercises the changed production code path vminitd/Sources/vmexec/Console.swift configureStdIO(). A regression in the production wiring (e.g. removal of the setraw() call) would pass the macOS test suite.

Why it matters

Console.configureStdIO() is Linux-only (the vmexec executable target in the vminitd package) and the vminitd package declares zero test targets today. The 1024-byte stdout truncation it fixes is Linux-kernel tty behavior that macOS openpty cannot reproduce, so the truncation regression is unguarded by automation.

Suggested fix

Add a Linux-target test (or CI step) that runs Console.configureStdIO() on a pty pair and writes >1024 bytes through the slave, asserting full delivery on the master. Keep the macOS termios-flag assertions as fast recipe-level coverage.

Evidence

  • vminitd/Sources/vmexec/Console.swift:63: try Terminal(descriptor: slaveFD, setInitState: false).setraw()
  • Tests/ContainerizationOSTests/TerminalRawModeTests.swift:63: try child.setraw()
  • vminitd/Package.swift declares no testTarget for vmexec

Source

Branch fix/pty-raw-mode-interactive-stdout at head 9ed4b36 in apple/containerization (worktree).

Metadata

Severity: P2
Confidence: 100
Reviewer(s): correctness, testing
Finding ID: vminitdsourcesvmexecconsole.swift63-regressiontestdoesnotexercisetheproductioncodepathconsoleconfigurestdioitismeanttoprotect

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions