github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/integration/plugin/logging/validation_test.go (about)

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