From a03c9769506ccc97d0322a2a19a22944150e79a9 Mon Sep 17 00:00:00 2001 From: Anastasios Papagiannis Date: Tue, 23 Aug 2022 08:41:27 +0000 Subject: [PATCH 1/3] Re-enable copyfd test As https://github.com/cilium/tetragon/issues/247 is resolved, this PR tries to enable this test again. Signed-off-by: Anastasios Papagiannis --- tools/split-tetragon-gotests/main.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/split-tetragon-gotests/main.go b/tools/split-tetragon-gotests/main.go index 08a7f0f7249..9dcb9475c1b 100644 --- a/tools/split-tetragon-gotests/main.go +++ b/tools/split-tetragon-gotests/main.go @@ -49,8 +49,6 @@ var CiBlacklist = []vmtests.GoTest{ // was a previous attempt to fix the test, but failed. Ignore it for // now. {PackageProg: "pkg.exporter"}, - // https://github.com/cilium/tetragon/issues/247 - {PackageProg: "pkg.sensors.tracing", Test: "TestCopyFd"}, } func usage() { From 26de1ef693d094626e6885a9a3f11f9e10659f5b Mon Sep 17 00:00:00 2001 From: Anastasios Papagiannis Date: Tue, 23 Aug 2022 09:52:02 +0000 Subject: [PATCH 2/3] Check return value of loadExporter Signed-off-by: Anastasios Papagiannis --- pkg/observer/observer_test_helper.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/observer/observer_test_helper.go b/pkg/observer/observer_test_helper.go index 8b1d3cbf187..626fb803561 100644 --- a/pkg/observer/observer_test_helper.go +++ b/pkg/observer/observer_test_helper.go @@ -273,7 +273,9 @@ func getDefaultObserverSensors(t *testing.T, ctx context.Context, base *sensors. option.Config.Verbosity = 1 } - loadExporter(t, ctx, obs, &o.exporter, &o.observer) + if err := loadExporter(t, ctx, obs, &o.exporter, &o.observer); err != nil { + return nil, ret, err + } cnf, _ := readConfig(o.observer.config) if cnf != nil { From 811b17c42da19f1d1c729966635e7cbfbe465bf8 Mon Sep 17 00:00:00 2001 From: Anastasios Papagiannis Date: Tue, 23 Aug 2022 17:32:47 +0000 Subject: [PATCH 3/3] Use the appropriate timeout in context for TestCopyFd Signed-off-by: Anastasios Papagiannis --- pkg/sensors/tracing/kprobe_copyfd_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/sensors/tracing/kprobe_copyfd_test.go b/pkg/sensors/tracing/kprobe_copyfd_test.go index fcb49f92252..e79c66bdbc6 100644 --- a/pkg/sensors/tracing/kprobe_copyfd_test.go +++ b/pkg/sensors/tracing/kprobe_copyfd_test.go @@ -17,7 +17,6 @@ import ( "strconv" "sync" "testing" - "time" "github.com/cilium/tetragon/api/v1/tetragon" ec "github.com/cilium/tetragon/api/v1/tetragon/codegen/eventchecker" @@ -42,7 +41,7 @@ func TestCopyFd(t *testing.T) { var doneWG, readyWG sync.WaitGroup defer doneWG.Wait() - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), tus.Conf().CmdWaitTime) defer cancel() testBin := testutils.ContribPath("tester-progs/dup-tester")