Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit f0fbc43

Browse files
authored
Merge pull request #1410 from gtardif/context_endpoint_connection
Add remote engine context e2e
2 parents 5bb676c + f4c6842 commit f0fbc43

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

local/e2e/cli-only/e2e_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,14 +396,19 @@ func TestLegacy(t *testing.T) {
396396
})
397397

398398
t.Run("host flag", func(t *testing.T) {
399-
stderr := "dial tcp: lookup nonexistent"
400-
if runtime.GOOS == "windows" {
401-
stderr = "dial tcp: lookup nonexistent: no such host"
402-
}
403399
res := c.RunDockerOrExitError("-H", "tcp://nonexistent:123", "version")
404400
assert.Assert(t, res.ExitCode == 1)
405-
assert.Assert(t, strings.Contains(res.Stdout(), stderr), res.Stdout())
401+
assert.Assert(t, strings.Contains(res.Stdout(), "dial tcp: lookup nonexistent"), res.Stdout())
402+
403+
})
404+
405+
t.Run("remote engine context", func(t *testing.T) {
406+
c.RunDockerCmd("context", "create", "test-remote-engine", "--docker", "host=tcp://nonexistent:1234")
407+
c.RunDockerCmd("context", "use", "test-remote-engine")
406408

409+
res := c.RunDockerOrExitError("version")
410+
assert.Assert(t, res.ExitCode == 1)
411+
assert.Assert(t, strings.Contains(res.Stdout(), "dial tcp: lookup nonexistent"), res.Stdout())
407412
})
408413

409414
t.Run("existing contexts delegate", func(t *testing.T) {

0 commit comments

Comments
 (0)