Browse code

integration-cli: DockerCLINetmodeSuite: replace dockerCmd and waitRun

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2023/07/27 20:00:39
Showing 1 changed files
... ...
@@ -5,6 +5,7 @@ import (
5 5
 	"strings"
6 6
 	"testing"
7 7
 
8
+	"github.com/docker/docker/integration-cli/cli"
8 9
 	"github.com/docker/docker/runconfig"
9 10
 	"gotest.tools/v3/assert"
10 11
 )
... ...
@@ -39,18 +40,18 @@ func dockerCmdWithFail(c *testing.T, args ...string) (string, int) {
39 39
 func (s *DockerCLINetmodeSuite) TestNetHostnameWithNetHost(c *testing.T) {
40 40
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
41 41
 
42
-	out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ps")
42
+	out := cli.DockerCmd(c, "run", "--net=host", "busybox", "ps").Stdout()
43 43
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
44 44
 }
45 45
 
46 46
 func (s *DockerCLINetmodeSuite) TestNetHostname(c *testing.T) {
47 47
 	testRequires(c, DaemonIsLinux)
48 48
 
49
-	out, _ := dockerCmd(c, "run", "-h=name", "busybox", "ps")
49
+	out := cli.DockerCmd(c, "run", "-h=name", "busybox", "ps").Stdout()
50 50
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
51
-	out, _ = dockerCmd(c, "run", "-h=name", "--net=bridge", "busybox", "ps")
51
+	out = cli.DockerCmd(c, "run", "-h=name", "--net=bridge", "busybox", "ps").Stdout()
52 52
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
53
-	out, _ = dockerCmd(c, "run", "-h=name", "--net=none", "busybox", "ps")
53
+	out = cli.DockerCmd(c, "run", "-h=name", "--net=none", "busybox", "ps").Stdout()
54 54
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
55 55
 	out, _ = dockerCmdWithFail(c, "run", "-h=name", "--net=container:other", "busybox", "ps")
56 56
 	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkHostname.Error()))