github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/integration/session/main_test.go (about) 1 package session // import "github.com/docker/docker/integration/session" 2 3 import ( 4 "fmt" 5 "os" 6 "testing" 7 8 "github.com/docker/docker/internal/test/environment" 9 ) 10 11 var testEnv *environment.Execution 12 13 func TestMain(m *testing.M) { 14 var err error 15 testEnv, err = environment.New() 16 if err != nil { 17 fmt.Println(err) 18 os.Exit(1) 19 } 20 err = environment.EnsureFrozenImagesLinux(testEnv) 21 if err != nil { 22 fmt.Println(err) 23 os.Exit(1) 24 } 25 26 testEnv.Print() 27 os.Exit(m.Run()) 28 } 29 30 func setupTest(t *testing.T) func() { 31 environment.ProtectAll(t, testEnv) 32 return func() { testEnv.Clean(t) } 33 }