diff --git a/mantle/cmd/kola/testiso.go b/mantle/cmd/kola/testiso.go index 1b72195083..48d90a4e7f 100644 --- a/mantle/cmd/kola/testiso.go +++ b/mantle/cmd/kola/testiso.go @@ -694,8 +694,7 @@ func awaitCompletion(ctx context.Context, inst *platform.QemuInstance, outdir st if err != nil { errchan <- err } - }() - } + } go func() { err := inst.Wait() // only one Wait() gets process data, so also manually check for signal diff --git a/mantle/kola/harness.go b/mantle/kola/harness.go index c351313ee1..b1b4ae84a4 100644 --- a/mantle/kola/harness.go +++ b/mantle/kola/harness.go @@ -1919,30 +1919,33 @@ func ScpKolet(machines []platform.Machine) error { // CheckConsoleText checks console output for badness -func CheckConsoleText(consoleOutput []byte) (bool, []string) { - var badlines []string - warnOnly, allowRerunSuccess := true, true +func CheckConsoleText(badlines []string) (bool, []string) { + badness := false + newBadlines := []string{} + + // Ensure there are enough badlines to check + if len(badlines) < 2 { + return badness, badlines // Return early if not enough lines + } for _, check := range consoleChecks { if check.skipFlag != nil { continue } - match := check.match.FindSubmatch(consoleOutput) + match := check.match.FindStringSubmatch(badlines[1]) if match != nil { badline := check.desc if len(match) > 1 { // include first subexpression - badline += fmt.Sprintf(" (%s)", match[1]) + badline += fmt.Sprintf(" (%v)", match[1]) } - badlines = append(badlines, badline) + newBadlines = append(newBadlines, badline) if !check.warnOnly { - warnOnly = false - } - if !check.allowRerunSuccess { - allowRerunSuccess = false + badness = false } } } - return warnOnly, badlines + badlines = append(badlines, newBadlines...) + return badness, badlines } // CheckConsole checks some console output for badness and returns short @@ -1972,9 +1975,8 @@ func CheckConsole(output []byte, t *register.Test) (bool, []string) { if !check.allowRerunSuccess { allowRerunSuccess = false } - cc := CheckConsoleText([]byte(output)) - fmt.Printf("Test failed: %v", cc) - fmt.Printf("// Leftovers \n\n") + is_it_err,checkConsole := CheckConsoleText([]string(badlines)) + fmt.Printf("%v\n,%v", checkConsole, is_it_err) } } if len(badlines) > 0 && allowRerunSuccess && t != nil { diff --git a/mantle/platform/qemu.go b/mantle/platform/qemu.go index 64cba8ff7f..d8239133e7 100644 --- a/mantle/platform/qemu.go +++ b/mantle/platform/qemu.go @@ -43,7 +43,6 @@ import ( "syscall" "time" - "github.com/coreos/coreos-assembler/mantle/kola" "github.com/coreos/coreos-assembler/mantle/platform/conf" "github.com/coreos/coreos-assembler/mantle/util" coreosarch "github.com/coreos/stream-metadata-go/arch"