1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration/plugin/logging/validation_test.go
Vincent Demeester f0d277fe84
Move integration-cli daemon package to internal/test…
… and do not use the `docker` cli in it. One of the reason of this
move is to not make `integration` package using legacy
`integration-cli` package.

Next move will be to support swarm within this package *and* provide
some helper function using the api (compared to the one using cli in
`integration-cli/daemon` package).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-10 16:29:48 +02:00

35 lines
1,021 B
Go

package logging
import (
"context"
"testing"
"github.com/docker/docker/api/types"
"github.com/docker/docker/internal/test/daemon"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/skip"
)
// Regression test for #35553
// Ensure that a daemon with a log plugin set as the default logger for containers
// does not keep the daemon from starting.
func TestDaemonStartWithLogOpt(t *testing.T) {
skip.IfCondition(t, testEnv.IsRemoteDaemon(), "cannot run daemon when remote daemon")
t.Parallel()
d := daemon.New(t)
d.Start(t, "--iptables=false")
defer d.Stop(t)
client, err := d.NewClient()
assert.Check(t, err)
ctx := context.Background()
createPlugin(t, client, "test", "dummy", asLogDriver)
err = client.PluginEnable(ctx, "test", types.PluginEnableOptions{Timeout: 30})
assert.Check(t, err)
defer client.PluginRemove(ctx, "test", types.PluginRemoveOptions{Force: true})
d.Stop(t)
d.Start(t, "--iptables=false", "--log-driver=test", "--log-opt=foo=bar")
}