validation_test.go 1.0 KB

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