Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
123456789101112131415161718192021222324package gitutil
import ( "os/exec" "testing")
// os/exec refuses to start a command that carries a Cancel it did not get from// CommandContext, and the sandbox-wrapped commands in knotserver are exactly// that shape, so containment has to degrade instead of breaking themfunc TestContainContextlessCommand(t *testing.T) { cmd := Contain(exec.Command("git", "version")) out, err := cmd.CombinedOutput() if err != nil { t.Fatalf("%v: %s", err, out) } if !cmd.SysProcAttr.Setpgid { t.Fatal("a contained command has to lead its own process group") } if cmd.WaitDelay == 0 { t.Fatal("a contained command has to bound its wait") }}