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 <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai
2019-09-25 16:25:10 -04:00
parent 851e3775d5
commit 65b20bd521
5 changed files with 20 additions and 11 deletions

View File

@ -78,11 +78,15 @@ func (a testResultsSorted) Less(i, j int) bool { return a[i].length < a[j].lengt
var testResults []testResult
func TestMain(m *testing.M) {
if reexec.Init() {
return
}
os.Exit(m.Run())
}
// TestLibpod ginkgo master function
func TestLibpod(t *testing.T) {
if reexec.Init() {
os.Exit(1)
}
if os.Getenv("NOCACHE") == "1" {
CACHE_IMAGES = []string{}
RESTORE_IMAGES = []string{}