github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/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/testutil/daemon"
    11  	"gotest.tools/v3/assert"
    12  	"gotest.tools/v3/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  }