Files
docker-cli/components/engine/integration/plugin/logging/validation_test.go
Sebastiaan van Stijn 7f2bfe773c Test: Replace NewClient() with NewClientT()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2cb7b73a1bdbf2e7ea6da7d0c050b303c2c4f5dc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bb221587404be76f404062618e7d947f4d1bd39b
Component: engine
2019-04-17 21:34:09 +02:00

38 lines
982 B
Go

// +build !windows
package logging
import (
"context"
"testing"
"github.com/docker/docker/api/types"
"github.com/docker/docker/internal/test/daemon"
"gotest.tools/assert"
"gotest.tools/skip"
)
// Regression test for #35553
// Ensure that a daemon with a log plugin set as the default logger for containers
// does not keep the daemon from starting.
func TestDaemonStartWithLogOpt(t *testing.T) {
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
t.Parallel()
d := daemon.New(t)
d.Start(t, "--iptables=false")
defer d.Stop(t)
c := d.NewClientT(t)
ctx := context.Background()
createPlugin(t, c, "test", "dummy", asLogDriver)
err := c.PluginEnable(ctx, "test", types.PluginEnableOptions{Timeout: 30})
assert.Check(t, err)
defer c.PluginRemove(ctx, "test", types.PluginRemoveOptions{Force: true})
d.Stop(t)
d.Start(t, "--iptables=false", "--log-driver=test", "--log-opt=foo=bar")
}