From 6f7d645c228ef7bdcfe31947acb27f2644a1da20 Mon Sep 17 00:00:00 2001 From: Mahe Tardy Date: Tue, 10 Oct 2023 17:18:10 +0000 Subject: [PATCH] pkg/testutils: default value for option.Config.HubbleLib The testutils Config.TetragonLib (or in the end ConfigDefault.TetragonLib) was never written to the actual option.Config.HubbleLib. We noticed it was done manually all over the place in tests so this commit adds it in TestSensorRun that runs in TestMain. Signed-off-by: Mahe Tardy --- pkg/testutils/sensors/testrun.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/testutils/sensors/testrun.go b/pkg/testutils/sensors/testrun.go index 32e4f3c4e43..d23b9ac5e01 100644 --- a/pkg/testutils/sensors/testrun.go +++ b/pkg/testutils/sensors/testrun.go @@ -111,6 +111,10 @@ func TestSensorsRun(m *testing.M, sensorName string) int { bpf.CheckOrMountDebugFS() bpf.ConfigureResourceLimits() + if config.TetragonLib != "" { + option.Config.HubbleLib = config.TetragonLib + } + bpf.SetMapPrefix(testMapDir) defer func() { log := logger.GetLogger()