validation_test.go 1003 B

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