osbase/bringup/test: unflake test

This is a fun one and sadly semi-expected/wanted behavior. Because we
have the exception tracing of the kernel enabled, it captures all
unhandled signals and prints them into dmesg. This is then written to
serial, which then is read by our test. Because this is all serial and
there is no locking, the kernel and our test can race each other and
the tests can't identify the string which identifies a PASS. It's simple
to fix, as we can just disable the exception trace before provoking a
segfault.

Closes monogon-dev/monogon#366

Change-Id: I8766a28bf339e9e2d5b0aec415c3affe0db82f50
Reviewed-on: https://review.monogon.dev/c/monogon/+/3758
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/osbase/bringup/test/main_failed.go b/osbase/bringup/test/main_failed.go
index 4ed8a17..739f16e 100644
--- a/osbase/bringup/test/main_failed.go
+++ b/osbase/bringup/test/main_failed.go
@@ -1,9 +1,24 @@
 package main
 
 import (
+	"context"
+	"os"
+
 	"source.monogon.dev/osbase/bringup"
 )
 
 func main() {
-	bringup.Runnable(nil).Run()
+	bringup.Runnable(func(ctx context.Context) error {
+		// Disable the exception tracing of the kernel which captures unhandled
+		// signals as it races with our logging which makes the test flaky.
+		err := os.WriteFile("/proc/sys/debug/exception-trace", []byte("0"), 0755)
+		if err != nil {
+			return err
+		}
+
+		// Provoke a segfault, which produces a panic inside the root runnable
+		//nolint:nilness
+		_ = *(*string)(nil)
+		return nil
+	}).Run()
 }