зеркало из https://github.com/microsoft/docker.git
Merge pull request #1052 from lopter/master
Fix a couple critical bugs on the test suite
This commit is contained in:
Коммит
84f41954ae
|
@ -2,6 +2,7 @@ package docker
|
|||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -92,7 +93,12 @@ func TestBuild(t *testing.T) {
|
|||
}
|
||||
defer nuke(runtime)
|
||||
|
||||
srv := &Server{runtime: runtime}
|
||||
srv := &Server{
|
||||
runtime: runtime,
|
||||
lock: &sync.Mutex{},
|
||||
pullingPool: make(map[string]struct{}),
|
||||
pushingPool: make(map[string]struct{}),
|
||||
}
|
||||
|
||||
buildfile := NewBuildFile(srv, ioutil.Discard)
|
||||
if _, err := buildfile.Build(mkTestContext(ctx.dockerfile, ctx.files, t)); err != nil {
|
||||
|
|
|
@ -135,10 +135,13 @@ func GetTestImage(runtime *Runtime) *Image {
|
|||
imgs, err := runtime.graph.All()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
} else if len(imgs) < 1 {
|
||||
panic("GASP")
|
||||
}
|
||||
return imgs[0]
|
||||
for i := range imgs {
|
||||
if imgs[i].ID == unitTestImageId {
|
||||
return imgs[i]
|
||||
}
|
||||
}
|
||||
panic(fmt.Errorf("Test image %v not found", unitTestImageId))
|
||||
}
|
||||
|
||||
func TestRuntimeCreate(t *testing.T) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче