From 50f95cf15de9c154906628b562d1a384cf87b136 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 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkg/sensors/tracing/kprobe_test.go b/pkg/sensors/tracing/kprobe_test.go index 28cdeeb3df5..fe9199e890e 100644 --- a/pkg/sensors/tracing/kprobe_test.go +++ b/pkg/sensors/tracing/kprobe_test.go @@ -6047,3 +6047,24 @@ 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" +` + createCrdFile(t, hookFull) + + _, err := observertesthelper.GetDefaultObserverWithFile(t, ctx, testConfigFile, tus.Conf().TetragonLib) + if err != nil { + t.Fatalf("GetDefaultObserverWithFile error: %s", err) + } +}