validation_test.go 914 B

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