From 0227aa455bfb8ec355da304a2fcc53a7c248d198 Mon Sep 17 00:00:00 2001 From: Djalal Harouni Date: Thu, 28 Dec 2023 18:09:07 +0100 Subject: [PATCH] test: add kprobe sysfs enable stability test Signed-off-by: Djalal Harouni --- pkg/sensors/tracing/kprobe_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkg/sensors/tracing/kprobe_test.go b/pkg/sensors/tracing/kprobe_test.go index 28cdeeb3df5..a1d8902006d 100644 --- a/pkg/sensors/tracing/kprobe_test.go +++ b/pkg/sensors/tracing/kprobe_test.go @@ -6047,3 +6047,25 @@ spec: err = jsonchecker.JsonTestCheck(t, checker) assert.NoError(t, err) } + +// This stability of `write_enabled_file_bool` hook. +func TestKprobeSysfsEnableStability(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), tus.Conf().CmdWaitTime) + defer cancel() + + hookFull := `apiVersion: cilium.io/v1alpha1 +kind: TracingPolicy +metadata: + name: "kprobes-interface-stability" +spec: + kprobes: + - call: "write_enabled_file_bool" + syscall: false +` + createCrdFile(t, hookFull) + + _, err := observertesthelper.GetDefaultObserverWithFile(t, ctx, testConfigFile, tus.Conf().TetragonLib) + if err != nil { + t.Fatalf("GetDefaultObserverWithFile error: %s", err) + } +}