diff --git a/auditbeat/module/file_integrity/exeobjparser_test.go b/auditbeat/module/file_integrity/exeobjparser_test.go index 0958305afb8..f8ca144e4ed 100644 --- a/auditbeat/module/file_integrity/exeobjparser_test.go +++ b/auditbeat/module/file_integrity/exeobjparser_test.go @@ -19,8 +19,11 @@ package file_integrity import ( + "errors" "fmt" + "io/fs" "math" + "os" "reflect" "strconv" "testing" @@ -44,6 +47,12 @@ func TestExeObjParser(t *testing.T) { t.Skip("skipping test on garbled PE file: see https://github.com/elastic/beats/issues/35705") } + if _, ci := os.LookupEnv("CI"); ci { + if _, err := os.Stat(target); err != nil && errors.Is(fs.ErrNotExist, err) { + t.Skip("skipping test because target binary was not found: see https://github.com/elastic/beats/issues/38211") + } + } + got := make(mapstr.M) err := exeObjParser(nil).Parse(got, target) if err != nil {