Skip to content

Commit 8d41178

Browse files
kola: fix SIGSEGV in luks.cex test
This fixes null pointer derefernce when VM starup fails: ``` --- FAIL: luks.cex (5.83s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x75d18a] ```
1 parent c31f322 commit 8d41178

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mantle/kola/tests/ignition/luks.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ func runCexTest(c cluster.TestCluster) {
242242
switch pc := c.Cluster.(type) {
243243
case *qemu.Cluster:
244244
m, err = pc.NewMachineWithQemuOptions(ignition, opts)
245+
if err != nil {
246+
c.Fatalf("Unable to create test machine: %v", err)
247+
}
245248
default:
246249
panic("Unsupported cluster type")
247250
}
@@ -251,12 +254,7 @@ func runCexTest(c cluster.TestCluster) {
251254
c.Fatal(err)
252255
}
253256
coretest.LocalTests(c)
254-
255-
if err != nil {
256-
c.Fatalf("Unable to create test machine: %v", err)
257-
}
258257
rootPart := "/dev/disk/by-partlabel/root"
259-
260258
ut.LUKSSanityCEXTest(c, m, rootPart)
261259
}
262260

0 commit comments

Comments
 (0)