MCPcopy
hub / github.com/opencontainers/runc / testExecPS

Function testExecPS

libcontainer/integration/exec_test.go:38–54  ·  view source on GitHub ↗
(t *testing.T, userns bool)

Source from the content-addressed store, hash-verified

36}
37
38func testExecPS(t *testing.T, userns bool) {
39 if testing.Short() {
40 return
41 }
42 config := newTemplateConfig(t, &tParam{userns: userns})
43
44 buffers := runContainerOk(t, config, "ps", "-o", "pid,user,comm")
45 lines := strings.Split(buffers.Stdout.String(), "\n")
46 if len(lines) < 2 {
47 t.Fatalf("more than one process running for output %q", buffers.Stdout.String())
48 }
49 expected := `1 root ps`
50 actual := strings.Trim(lines[1], "\n ")
51 if actual != expected {
52 t.Fatalf("expected output %q but received %q", expected, actual)
53 }
54}
55
56func TestIPCPrivate(t *testing.T) {
57 if testing.Short() {

Callers 2

TestExecPSFunction · 0.85
TestUsernsExecPSFunction · 0.85

Calls 3

newTemplateConfigFunction · 0.85
runContainerOkFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…