validation_test.go 1010 B

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