Skip to content

Commit 6432243

Browse files
committed
tetragon: Display verifier log in TestVerifyTetragonPrograms
Signed-off-by: Jiri Olsa <[email protected]>
1 parent ddcf58d commit 6432243

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contrib/verify/verify_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package verify
77

88
import (
9+
"errors"
910
"fmt"
1011
"log"
1112
"os"
@@ -114,6 +115,16 @@ func TestVerifyTetragonPrograms(t *testing.T) {
114115
}
115116

116117
collection, err := ebpf.NewCollection(spec)
118+
if err != nil {
119+
var ve *ebpf.VerifierError
120+
if errors.As(err, &ve) {
121+
fmt.Printf("%+v\n", ve)
122+
123+
_, kver, _ := kernels.GetKernelVersion("", "/proc")
124+
fmt.Printf("failed object %s, kernel %s\n", fileName, kver)
125+
}
126+
}
127+
117128
require.NoError(t, err, "failed to load resources into the kernel")
118129

119130
collection.Close()

0 commit comments

Comments
 (0)