validation_test.go 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //go:build !windows
  2. package logging
  3. import (
  4. "context"
  5. "testing"
  6. "github.com/docker/docker/api/types"
  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. d := daemon.New(t)
  19. d.Start(t, "--iptables=false")
  20. defer d.Stop(t)
  21. c := d.NewClientT(t)
  22. ctx := context.Background()
  23. createPlugin(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. }