use init function
Upstream-commit: 740a97f1a836be17ab39e8496b7372900782c20b Component: engine
This commit is contained in:
@ -1,10 +0,0 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
os.Setenv("TEST", "1")
|
||||
}
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user