mirror of https://github.com/docker/cli.git
Add e2e tests for run w/ bad entrypoint
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
parent
31644d5ea7
commit
8d6e571c03
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/docker/cli/e2e/internal/fixtures"
|
"github.com/docker/cli/e2e/internal/fixtures"
|
||||||
"github.com/docker/cli/internal/test/environment"
|
"github.com/docker/cli/internal/test/environment"
|
||||||
|
@ -34,6 +35,22 @@ func TestRunAttachedFromRemoteImageAndRemove(t *testing.T) {
|
||||||
golden.Assert(t, result.Stderr(), "run-attached-from-remote-and-remove.golden")
|
golden.Assert(t, result.Stderr(), "run-attached-from-remote-and-remove.golden")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regression test for https://github.com/docker/cli/issues/5053
|
||||||
|
func TestRunInvalidEntrypointWithAutoremove(t *testing.T) {
|
||||||
|
environment.SkipIfDaemonNotLinux(t)
|
||||||
|
|
||||||
|
result := make(chan *icmd.Result)
|
||||||
|
go func() {
|
||||||
|
result <- icmd.RunCommand("docker", "run", "--rm", fixtures.AlpineImage, "invalidcommand")
|
||||||
|
}()
|
||||||
|
select {
|
||||||
|
case r := <-result:
|
||||||
|
r.Assert(t, icmd.Expected{ExitCode: 127})
|
||||||
|
case <-time.After(4 * time.Second):
|
||||||
|
t.Fatal("test took too long, shouldn't hang")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestRunWithContentTrust(t *testing.T) {
|
func TestRunWithContentTrust(t *testing.T) {
|
||||||
skip.If(t, environment.RemoteDaemon())
|
skip.If(t, environment.RemoteDaemon())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue