Skip to content

Commit 3f251d9

Browse files
committed
test: Ensure that BTF type information is available
BTF types are required for CO-RE eBPF programs. Check if the kernel was compiled with CONFIG_DEBUG_INFO_BTF and created the /sys/kernel/btf/vmlinux file.
1 parent 987f175 commit 3f251d9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/integration/iso_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,17 @@ func TestISOImage(t *testing.T) {
9999
})
100100
}
101101
})
102+
103+
t.Run("eBPFSupport", func(t *testing.T) {
104+
// Ensure that BTF type information is available (https://github.com/kubernetes/minikube/issues/21788)
105+
btfFile := "/sys/kernel/btf/vmlinux"
106+
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("test -f %s && echo 'OK' || echo 'NOT FOUND'", btfFile)))
107+
if err != nil {
108+
t.Errorf("failed to verify existence of %q file: args %q: %v", btfFile, rr.Command(), err)
109+
}
110+
111+
if !strings.Contains(rr.Stdout.String(), "OK") {
112+
t.Errorf("expected file %q to exist, but it does not. BTF types are required for CO-RE eBPF programs; set CONFIG_DEBUG_INFO_BTF in kernel configuration.", btfFile)
113+
}
114+
})
102115
}

0 commit comments

Comments
 (0)