Skip to content

Commit 8d6e571

Browse files
committed
Add e2e tests for run w/ bad entrypoint
Signed-off-by: Laura Brehm <[email protected]>
1 parent 31644d5 commit 8d6e571

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

e2e/container/run_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"strings"
66
"testing"
7+
"time"
78

89
"github.com/docker/cli/e2e/internal/fixtures"
910
"github.com/docker/cli/internal/test/environment"
@@ -34,6 +35,22 @@ func TestRunAttachedFromRemoteImageAndRemove(t *testing.T) {
3435
golden.Assert(t, result.Stderr(), "run-attached-from-remote-and-remove.golden")
3536
}
3637

38+
// Regression test for https://github.com/docker/cli/issues/5053
39+
func TestRunInvalidEntrypointWithAutoremove(t *testing.T) {
40+
environment.SkipIfDaemonNotLinux(t)
41+
42+
result := make(chan *icmd.Result)
43+
go func() {
44+
result <- icmd.RunCommand("docker", "run", "--rm", fixtures.AlpineImage, "invalidcommand")
45+
}()
46+
select {
47+
case r := <-result:
48+
r.Assert(t, icmd.Expected{ExitCode: 127})
49+
case <-time.After(4 * time.Second):
50+
t.Fatal("test took too long, shouldn't hang")
51+
}
52+
}
53+
3754
func TestRunWithContentTrust(t *testing.T) {
3855
skip.If(t, environment.RemoteDaemon())
3956

0 commit comments

Comments
 (0)