github.com/rita33cool1/iot-system-gateway@v0.0.0-20200911033302-e65bde238cc5/docker-engine/integration/plugin/logging/validation_test.go (about)

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