diff --git a/testutil/daemon/daemon.go b/testutil/daemon/daemon.go index d6a7a07276..c5aa1de23d 100644 --- a/testutil/daemon/daemon.go +++ b/testutil/daemon/daemon.go @@ -28,11 +28,12 @@ import ( "gotest.tools/assert" ) -type logT interface { +// LogT is the subset of the testing.TB interface used by the daemon. +type LogT interface { Logf(string, ...interface{}) } -// nopLog is a no-op implementation of logT that is used in daemons created by +// nopLog is a no-op implementation of LogT that is used in daemons created by // NewDaemon (where no testing.TB is available). type nopLog struct{} @@ -71,7 +72,7 @@ type Daemon struct { experimental bool init bool dockerdBinary string - log logT + log LogT pidFile string args []string diff --git a/testutil/daemon/ops.go b/testutil/daemon/ops.go index e45eeafeae..a866ff8be6 100644 --- a/testutil/daemon/ops.go +++ b/testutil/daemon/ops.go @@ -1,8 +1,6 @@ package daemon import ( - "testing" - "github.com/docker/docker/testutil/environment" ) @@ -17,7 +15,7 @@ func WithDefaultCgroupNamespaceMode(mode string) Option { } // WithTestLogger causes the daemon to log certain actions to the provided test. -func WithTestLogger(t testing.TB) Option { +func WithTestLogger(t LogT) Option { return func(d *Daemon) { d.log = t }