integration-cli: DockerCLIPluginLogDriverSuite: replace dockerCmd
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a837cb444c
commit
e28da7686e
1 changed files with 12 additions and 11 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/docker/docker/integration-cli/cli"
|
||||
"github.com/docker/docker/testutil"
|
||||
"gotest.tools/v3/assert"
|
||||
)
|
||||
|
@ -25,28 +26,28 @@ func (s *DockerCLIPluginLogDriverSuite) OnTimeout(c *testing.T) {
|
|||
func (s *DockerCLIPluginLogDriverSuite) TestPluginLogDriver(c *testing.T) {
|
||||
testRequires(c, IsAmd64, DaemonIsLinux)
|
||||
|
||||
pluginName := "cpuguy83/docker-logdriver-test:latest"
|
||||
const pluginName = "cpuguy83/docker-logdriver-test:latest"
|
||||
|
||||
dockerCmd(c, "plugin", "install", pluginName)
|
||||
dockerCmd(c, "run", "--log-driver", pluginName, "--name=test", "busybox", "echo", "hello")
|
||||
out, _ := dockerCmd(c, "logs", "test")
|
||||
cli.DockerCmd(c, "plugin", "install", pluginName)
|
||||
cli.DockerCmd(c, "run", "--log-driver", pluginName, "--name=test", "busybox", "echo", "hello")
|
||||
out := cli.DockerCmd(c, "logs", "test").Combined()
|
||||
assert.Equal(c, strings.TrimSpace(out), "hello")
|
||||
|
||||
dockerCmd(c, "start", "-a", "test")
|
||||
out, _ = dockerCmd(c, "logs", "test")
|
||||
cli.DockerCmd(c, "start", "-a", "test")
|
||||
out = cli.DockerCmd(c, "logs", "test").Combined()
|
||||
assert.Equal(c, strings.TrimSpace(out), "hello\nhello")
|
||||
|
||||
dockerCmd(c, "rm", "test")
|
||||
dockerCmd(c, "plugin", "disable", pluginName)
|
||||
dockerCmd(c, "plugin", "rm", pluginName)
|
||||
cli.DockerCmd(c, "rm", "test")
|
||||
cli.DockerCmd(c, "plugin", "disable", pluginName)
|
||||
cli.DockerCmd(c, "plugin", "rm", pluginName)
|
||||
}
|
||||
|
||||
// Make sure log drivers are listed in info, and v2 plugins are not.
|
||||
func (s *DockerCLIPluginLogDriverSuite) TestPluginLogDriverInfoList(c *testing.T) {
|
||||
testRequires(c, IsAmd64, DaemonIsLinux)
|
||||
pluginName := "cpuguy83/docker-logdriver-test"
|
||||
const pluginName = "cpuguy83/docker-logdriver-test"
|
||||
|
||||
dockerCmd(c, "plugin", "install", pluginName)
|
||||
cli.DockerCmd(c, "plugin", "install", pluginName)
|
||||
|
||||
apiClient, err := client.NewClientWithOpts(client.FromEnv)
|
||||
assert.NilError(c, err)
|
||||
|
|
Loading…
Reference in a new issue