Skip to content

Commit 7a75847

Browse files
Add more tests for docker exec
Signed-off-by: Kyle Edwards <[email protected]>
1 parent eb92df3 commit 7a75847

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/container/docker_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ func TestDockerContainer(t *testing.T) {
6868
t.Error("Output for command 'uname' did not contain expected string 'Linux'")
6969
return
7070
}
71+
72+
exitCode, stdout, stderr, err := c.Exec("sh", "-c", `echo "This is stdout" && echo "This is stderr" >&2 && exit 42`)
73+
assert.NoError(err)
74+
assert.Equal("This is stdout\n", stdout)
75+
assert.Equal("This is stderr\n", stderr)
76+
assert.Equal(42, exitCode)
7177
}
7278
func TestDockerContainerRemoves(t *testing.T) {
7379
c := New("nginx", nil, nil, nil, nil)

0 commit comments

Comments
 (0)