MCPcopy Index your code
hub / github.com/containerd/containerd / numTTY

Function numTTY

integration/container_tty_leak_linux_test.go:127–135  ·  view source on GitHub ↗
(shimPid int)

Source from the content-addressed store, hash-verified

125}
126
127func numTTY(shimPid int) int {
128 cmd := exec.Command("sh", "-c", fmt.Sprintf("lsof -p %d | grep ptmx", shimPid))
129 var stdout bytes.Buffer
130 cmd.Stdout = &stdout
131 if err := cmd.Run(); err != nil {
132 return 0
133 }
134 return strings.Count(stdout.String(), "\n")
135}
136
137func checkTTY(t *testing.T, shimPid, expected int) {
138 require.NoError(t, Eventually(func() (bool, error) {

Callers 1

checkTTYFunction · 0.85

Calls 2

RunMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…