From 49b9813035b3abb445ef7238f034897fa03a9652 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 30 Jan 2014 11:50:59 -0800 Subject: [PATCH] Fix integration tests Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- container.go | 4 ++-- integration/utils_test.go | 8 +++++++- runtime.go | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/container.go b/container.go index 365ff93c69..8ceec631f0 100644 --- a/container.go +++ b/container.go @@ -1109,7 +1109,7 @@ func (container *Container) allocateNetwork() error { var ( env *engine.Env - eng = container.runtime.srv.Eng + eng = container.runtime.eng ) if container.State.IsGhost() { if container.runtime.config.DisableNetwork { @@ -1220,7 +1220,7 @@ func (container *Container) releaseNetwork() { if container.Config.NetworkDisabled { return } - eng := container.runtime.srv.Eng + eng := container.runtime.eng eng.Job("release_interface", container.ID).Run() container.NetworkSettings = &NetworkSettings{} diff --git a/integration/utils_test.go b/integration/utils_test.go index 2eff13c81d..b4f3eb597d 100644 --- a/integration/utils_test.go +++ b/integration/utils_test.go @@ -34,7 +34,13 @@ func mkRuntime(f utils.Fataler) *docker.Runtime { AutoRestart: false, Mtu: docker.DefaultNetworkMtu, } - r, err := docker.NewRuntimeFromDirectory(config) + + eng, err := engine.New(root) + if err != nil { + f.Fatal(err) + } + + r, err := docker.NewRuntimeFromDirectory(config, eng) if err != nil { f.Fatal(err) } diff --git a/runtime.go b/runtime.go index d03db3d068..7e4ae79b40 100644 --- a/runtime.go +++ b/runtime.go @@ -50,6 +50,7 @@ type Runtime struct { sysInfo *sysinfo.SysInfo volumes *Graph srv *Server + eng *engine.Engine config *DaemonConfig containerGraph *graphdb.Database driver graphdriver.Driver @@ -740,6 +741,7 @@ func NewRuntimeFromDirectory(config *DaemonConfig, eng *engine.Engine) (*Runtime driver: driver, sysInitPath: sysInitPath, execDriver: ed, + eng: eng, } if err := runtime.restore(); err != nil {