github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/integration/plugin/logging/validation_test.go (about)

     1  // +build !windows
     2  
     3  package logging
     4  
     5  import (
     6  	"context"
     7  	"testing"
     8  
     9  	"github.com/docker/docker/api/types"
    10  	"github.com/docker/docker/internal/test/daemon"
    11  	"gotest.tools/assert"
    12  	"gotest.tools/skip"
    13  )
    14  
    15  // Regression test for #35553
    16  // Ensure that a daemon with a log plugin set as the default logger for containers
    17  // does not keep the daemon from starting.
    18  func TestDaemonStartWithLogOpt(t *testing.T) {
    19  	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
    20  	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
    21  	t.Parallel()
    22  
    23  	d := daemon.New(t)
    24  	d.Start(t, "--iptables=false")
    25  	defer d.Stop(t)
    26  
    27  	c := d.NewClientT(t)
    28  	ctx := context.Background()
    29  
    30  	createPlugin(t, c, "test", "dummy", asLogDriver)
    31  	err := c.PluginEnable(ctx, "test", types.PluginEnableOptions{Timeout: 30})
    32  	assert.Check(t, err)
    33  	defer c.PluginRemove(ctx, "test", types.PluginRemoveOptions{Force: true})
    34  
    35  	d.Stop(t)
    36  	d.Start(t, "--iptables=false", "--log-driver=test", "--log-opt=foo=bar")
    37  }