Browse code

integration-cli: DockerCLIPluginLogDriverSuite: replace dockerCmd

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

Sebastiaan van Stijn authored on 2023/07/28 17:38:51
Showing 1 changed files
... ...
@@ -6,6 +6,7 @@ import (
6 6
 	"testing"
7 7
 
8 8
 	"github.com/docker/docker/client"
9
+	"github.com/docker/docker/integration-cli/cli"
9 10
 	"github.com/docker/docker/testutil"
10 11
 	"gotest.tools/v3/assert"
11 12
 )
... ...
@@ -25,28 +26,28 @@ func (s *DockerCLIPluginLogDriverSuite) OnTimeout(c *testing.T) {
25 25
 func (s *DockerCLIPluginLogDriverSuite) TestPluginLogDriver(c *testing.T) {
26 26
 	testRequires(c, IsAmd64, DaemonIsLinux)
27 27
 
28
-	pluginName := "cpuguy83/docker-logdriver-test:latest"
28
+	const pluginName = "cpuguy83/docker-logdriver-test:latest"
29 29
 
30
-	dockerCmd(c, "plugin", "install", pluginName)
31
-	dockerCmd(c, "run", "--log-driver", pluginName, "--name=test", "busybox", "echo", "hello")
32
-	out, _ := dockerCmd(c, "logs", "test")
30
+	cli.DockerCmd(c, "plugin", "install", pluginName)
31
+	cli.DockerCmd(c, "run", "--log-driver", pluginName, "--name=test", "busybox", "echo", "hello")
32
+	out := cli.DockerCmd(c, "logs", "test").Combined()
33 33
 	assert.Equal(c, strings.TrimSpace(out), "hello")
34 34
 
35
-	dockerCmd(c, "start", "-a", "test")
36
-	out, _ = dockerCmd(c, "logs", "test")
35
+	cli.DockerCmd(c, "start", "-a", "test")
36
+	out = cli.DockerCmd(c, "logs", "test").Combined()
37 37
 	assert.Equal(c, strings.TrimSpace(out), "hello\nhello")
38 38
 
39
-	dockerCmd(c, "rm", "test")
40
-	dockerCmd(c, "plugin", "disable", pluginName)
41
-	dockerCmd(c, "plugin", "rm", pluginName)
39
+	cli.DockerCmd(c, "rm", "test")
40
+	cli.DockerCmd(c, "plugin", "disable", pluginName)
41
+	cli.DockerCmd(c, "plugin", "rm", pluginName)
42 42
 }
43 43
 
44 44
 // Make sure log drivers are listed in info, and v2 plugins are not.
45 45
 func (s *DockerCLIPluginLogDriverSuite) TestPluginLogDriverInfoList(c *testing.T) {
46 46
 	testRequires(c, IsAmd64, DaemonIsLinux)
47
-	pluginName := "cpuguy83/docker-logdriver-test"
47
+	const pluginName = "cpuguy83/docker-logdriver-test"
48 48
 
49
-	dockerCmd(c, "plugin", "install", pluginName)
49
+	cli.DockerCmd(c, "plugin", "install", pluginName)
50 50
 
51 51
 	apiClient, err := client.NewClientWithOpts(client.FromEnv)
52 52
 	assert.NilError(c, err)