(shimPid int)
| 125 | } |
| 126 | |
| 127 | func 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 | |
| 137 | func checkTTY(t *testing.T, shimPid, expected int) { |
| 138 | require.NoError(t, Eventually(func() (bool, error) { |