Skip to content

Commit 40ce5a2

Browse files
committed
mantle: detect when dumping to the virtio port failed
This will help warn the user that the normal passing of information didn't work right so we can investigate it further. We were seeing this race condition in coreos/fedora-coreos-tracker#2019
1 parent ac2a223 commit 40ce5a2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mantle/kola/tests/ignition/qemufailure.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,17 @@ func verifyError(builder *platform.QemuBuilder, searchPattern string) error {
133133
if err := inst.Kill(); err != nil {
134134
return errors.Wrapf(err, "failed to kill the vm instance")
135135
}
136-
return errors.Wrapf(ctx.Err(), "timed out waiting for initramfs error")
136+
// If somehow the journal dumping failed let's flag that. We
137+
// just ignore errors here. This effort is only trying to help
138+
// be more informative about why things failed. This "string"
139+
// we are searching for comes from ignition-virtio-dump-journal
140+
searchPattern = "Didn't find virtio port /dev/virtio-ports/com.coreos.ignition.journal"
141+
found, _ := fileContainsPattern(builder.ConsoleFile, searchPattern)
142+
if found {
143+
return errors.Wrapf(ctx.Err(), "Journal dumping during emergency.target failed")
144+
} else {
145+
return errors.Wrapf(ctx.Err(), "timed out waiting for initramfs error")
146+
}
137147
case err := <-errchan:
138148
if err != nil {
139149
return err

0 commit comments

Comments
 (0)