Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,47 @@ func awaitCompletion(ctx context.Context, inst *platform.QemuInstance, outdir st
}
}()
err := <-errchan
return time.Since(start), err
elapsed := time.Since(start)
if err == nil {
// No error so far, check the console and journal files
consoleFile := filepath.Join(outdir, "console.txt")
journalFile := filepath.Join(outdir, "journal.txt")
files := []string{consoleFile, journalFile}
for _, file := range files {
fileName := filepath.Base(file)
// Check if the file exists
_, err := os.Stat(file)
if os.IsNotExist(err) {
fmt.Printf("The file: %v does not exist\n", fileName)
continue
} else if err != nil {
fmt.Println(err)
return elapsed, err
}
// Read the contents of the file
fileContent, err := os.ReadFile(file)
if err != nil {
fmt.Println(err)
return elapsed, err
}
// Check for badness with CheckConsole
warnOnly, badlines := kola.CheckConsole([]byte(fileContent), nil)
if len(badlines) > 0 {
for _, badline := range badlines {
if warnOnly {
plog.Errorf("bad log line detected: %v", badline)
} else {
plog.Warningf("bad log line detected: %v", badline)
}
}
if !warnOnly {
err = fmt.Errorf("errors found in log files")
return elapsed, err
}
}
}
}
return elapsed, err
}

func printResult(test string, duration time.Duration, err error) bool {
Expand Down
Loading