Kaynağa Gözat

integration-cli: DockerCLINetmodeSuite: replace dockerCmd and waitRun

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 yıl önce
ebeveyn
işleme
02fd8485fa
1 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 5 4
      integration-cli/docker_cli_netmode_test.go

+ 5 - 4
integration-cli/docker_cli_netmode_test.go

@@ -5,6 +5,7 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/runconfig"
 	"gotest.tools/v3/assert"
 )
@@ -39,18 +40,18 @@ func dockerCmdWithFail(c *testing.T, args ...string) (string, int) {
 func (s *DockerCLINetmodeSuite) TestNetHostnameWithNetHost(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 
-	out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ps")
+	out := cli.DockerCmd(c, "run", "--net=host", "busybox", "ps").Stdout()
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
 }
 
 func (s *DockerCLINetmodeSuite) TestNetHostname(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 
-	out, _ := dockerCmd(c, "run", "-h=name", "busybox", "ps")
+	out := cli.DockerCmd(c, "run", "-h=name", "busybox", "ps").Stdout()
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
-	out, _ = dockerCmd(c, "run", "-h=name", "--net=bridge", "busybox", "ps")
+	out = cli.DockerCmd(c, "run", "-h=name", "--net=bridge", "busybox", "ps").Stdout()
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
-	out, _ = dockerCmd(c, "run", "-h=name", "--net=none", "busybox", "ps")
+	out = cli.DockerCmd(c, "run", "-h=name", "--net=none", "busybox", "ps").Stdout()
 	assert.Assert(c, strings.Contains(out, stringCheckPS))
 	out, _ = dockerCmdWithFail(c, "run", "-h=name", "--net=container:other", "busybox", "ps")
 	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkHostname.Error()))