Skip to content

Add focused tests for FreeBSD VM console parsing #653

Closed

Description

@LunaStev

Current evidence

tools/check_freebsd_sys.py contains a Console helper that incrementally reads the QEMU serial stream, appends bytes to a text buffer, searches regular expressions across reads, consumes matched prefixes, reports EOF, and enforces timeouts.

Those behaviors are independent of actually booting FreeBSD, but they are currently exercised only as part of the full VM workflow. Regressions in split serial output or buffer consumption therefore require an expensive QEMU run to detect.

Scope

  • Add focused Python unit tests for Console.expect without launching QEMU or requiring a FreeBSD image.
  • Cover a match contained in one read and a match split across multiple reads.
  • Verify matched text is consumed while later buffered output remains available to the next expect call.
  • Cover EOF before a match, timeout behavior, and guest-log writes.
  • Keep the production VM boot and shutdown flow unchanged.

Completion criteria

  • Tests run on a normal development/CI host with only the Python standard library.
  • No QEMU, firmware, disk image, network, or compiler invocation is required by the focused tests.
  • Existing FreeBSD system-test behavior remains unchanged.

Activity

  1. added
    good first issue
    needs testing
    on Sep 15, 2026
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

    good first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions