validation_test.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // +build !windows
  2. package logging
  3. import (
  4. "context"
  5. "testing"
  6. "github.com/docker/docker/api/types"
  7. "github.com/docker/docker/internal/test/daemon"
  8. "gotest.tools/assert"
  9. "gotest.tools/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. client, err := d.NewClient()
  22. assert.Check(t, err)
  23. ctx := context.Background()
  24. createPlugin(t, client, "test", "dummy", asLogDriver)
  25. err = client.PluginEnable(ctx, "test", types.PluginEnableOptions{Timeout: 30})
  26. assert.Check(t, err)
  27. defer client.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. }