Browse Source

Fix a nil dereference in buildfile_test.go

The test runtime object wasn't properly initialized.
Louis Opter 12 years ago
parent
commit
aa8ea84d11
1 changed files with 7 additions and 1 deletions
  1. 7 1
      buildfile_test.go

+ 7 - 1
buildfile_test.go

@@ -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 {