killable

command
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package main is the test-only subprocess that exercises Importer.Attach against a fake server and pauses at controllable checkpoints so the parent test can SIGKILL it at an exact instant. The binary is built on-demand by the process-death integration test; it is NOT a user-facing command. See test/integration/process_death_test.go for the parent-side orchestration that pairs with this program.

The kill-point is chosen by USBIP_TEST_KILL_AT:

before_dial — pause BEFORE Transport.Dial. Parent SIGKILLs here
              to prove no vhci port is even attempted.
after_dial  — pause AFTER Dial but BEFORE AttachRemote, to cover
              the "kernel closes TCP socket on process death
              before sysfs handoff" branch.
after_sysfs — pause AFTER a successful AttachRemote, to cover the
              "kernel holds its own ref, parent cleans up via
              Detach" branch.

The parent reads "AT=<point>\n" from stderr to know the child is parked at the checkpoint; it then SIGKILLs and proceeds to assert the expected kernel-side state. exit code 0 when the child survives to the end (no kill happened) so a silent test fixture bug surfaces as unexpected parent-side state instead of a hung process.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL