Files
docker-cli/components/engine/integration/plugin/logging/validation_test.go
Brian Goff b4446f4926 Move log validator logic after plugins are loaded
This ensures that all log plugins are registered when the log validator
is run.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b0b9a25e7e60abbe143e149ccaaf4dfb62044016
Component: engine
2018-02-15 11:53:11 -05:00

34 lines
914 B
Go

package logging
import (
"context"
"testing"
"github.com/docker/docker/api/types"
"github.com/docker/docker/integration-cli/daemon"
"github.com/stretchr/testify/assert"
)
// 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) {
t.Parallel()
d := daemon.New(t, "", dockerdBinary, daemon.Config{})
d.Start(t, "--iptables=false")
defer d.Stop(t)
client, err := d.NewClient()
assert.NoError(t, err)
ctx := context.Background()
createPlugin(t, client, "test", "dummy", asLogDriver)
err = client.PluginEnable(ctx, "test", types.PluginEnableOptions{Timeout: 30})
assert.NoError(t, err)
defer client.PluginRemove(ctx, "test", types.PluginRemoveOptions{Force: true})
d.Stop(t)
d.Start(t, "--iptables=false", "--log-driver=test", "--log-opt=foo=bar")
}