Skip to content

[Task]: Implement the core create→start→kill→delete lifecycle test #20

Description

@michael-duren

What needs to be done

Implement the first end-to-end acceptance test that drives the real box binary
through the full lifecycle against a real bundle, asserting the behavior our unit
tests deliberately can't reach.

Using the harness (#18) and bundle fixture
(#19), the test should:

  1. Build (or locate) ./bin/box and a fresh bundle running a long-lived process
    (e.g. sleep).
  2. box create <id> --bundle <dir> → assert box state <id> reports created
    (this exercises the InitReexec unix-socket handshake).
  3. box start <id> → assert status running and that the user process is
    actually alive (covers the start handshake + syscall.Exec).
  4. box kill <id> (e.g. SIGTERM/SIGKILL) → assert status stopped and the
    process is gone (covers real signal delivery).
  5. box delete <id> → assert the state and runtime directories are removed and
    box state <id> now errors (covers process kill + cleanup).

Also add the obvious negative cases that are only meaningful end-to-end, e.g.
start on an unknown id, delete of a running container without --force.

This is where the methods marked TODO(tdd) / skipped in
internal/container/container_test.go (Init, Reexec, and the happy paths of
Start/Kill/Delete) get their coverage.

Acceptance criteria

  • An acceptance test drives create → start → state → kill → delete against the real binary
  • Status transitions asserted at each step (createdrunningstopped)
  • The user process is verified running after start and gone after kill
  • delete is verified to remove state + runtime files
  • At least two negative/end-to-end-only cases included
  • The test skips cleanly when prerequisites (privileges/rootfs/Linux) are missing

Parent / tracking issue

Part of #17.

Blocked by

Rough size

L — a few days

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskA single, concrete unit of build worktesting

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions