use init function

Upstream-commit: 740a97f1a836be17ab39e8496b7372900782c20b
Component: engine
This commit is contained in:
Victor Vieux
2013-08-29 22:55:24 +00:00
parent d89a877aeb
commit 6b54138e54
2 changed files with 2 additions and 10 deletions

View File

@ -1,10 +0,0 @@
package docker
import (
"os"
"testing"
)
func Test(t *testing.T) {
os.Setenv("TEST", "1")
}

View File

@ -72,6 +72,8 @@ func layerArchive(tarfile string) (io.Reader, error) {
}
func init() {
os.Setenv("TEST", "1")
// Hack to run sys init during unit testing
if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {
SysInit()