From 65b20bd521302020ff229d455c60102e15a41b8a Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 25 Sep 2019 16:25:10 -0400 Subject: Correct use of reexec.Init() A true result from reexec.Init() isn't an error, but it indicates that main() should exit with a success exit status. Signed-off-by: Nalin Dahyabhai --- libpod/image/image_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libpod/image/image_test.go') diff --git a/libpod/image/image_test.go b/libpod/image/image_test.go index 5a6d095f6..ef39d09c3 100644 --- a/libpod/image/image_test.go +++ b/libpod/image/image_test.go @@ -11,6 +11,7 @@ import ( "github.com/containers/libpod/libpod/events" "github.com/containers/libpod/pkg/util" "github.com/containers/storage" + "github.com/containers/storage/pkg/reexec" "github.com/opencontainers/go-digest" "github.com/stretchr/testify/assert" ) @@ -70,6 +71,13 @@ func makeLocalMatrix(b, bg *Image) ([]localImageTest, error) { } +func TestMain(m *testing.M) { + if reexec.Init() { + return + } + os.Exit(m.Run()) +} + // TestImage_NewFromLocal tests finding the image locally by various names, // tags, and aliases func TestImage_NewFromLocal(t *testing.T) { -- cgit v1.2.3-54-g00ecf