use init function

This commit is contained in:
Victor Vieux 2013-08-29 22:55:24 +00:00
parent eee6d3dae9
commit 740a97f1a8
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()