github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/integration/plugin/logging/validation_test.go (about) 1 //go:build !windows 2 3 package logging 4 5 import ( 6 "testing" 7 8 "github.com/Prakhar-Agarwal-byte/moby/api/types" 9 "github.com/Prakhar-Agarwal-byte/moby/testutil" 10 "github.com/Prakhar-Agarwal-byte/moby/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 ctx := testutil.StartSpan(baseContext, t) 24 25 d := daemon.New(t) 26 d.Start(t, "--iptables=false") 27 defer d.Stop(t) 28 29 c := d.NewClientT(t) 30 31 createPlugin(ctx, 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 }