Skip to content

Commit

Permalink
[windows][cws] Fix etw test crash (#22671)
Browse files Browse the repository at this point in the history
[windows][cws] Fix etw test crash
  • Loading branch information
derekwbrown authored Feb 7, 2024
1 parent 7d66986 commit eee996e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/security/probe/probe_kernel_file_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"time"

"github.com/DataDog/datadog-agent/comp/etw"
"github.com/DataDog/datadog-agent/pkg/security/config"
"github.com/DataDog/datadog-agent/pkg/util/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -29,12 +30,19 @@ func createTestProbe() (*WindowsProbe, error) {
opts := Opts{
disableProcmon: true,
}
cfg, err := config.NewConfig()
if err != nil {
return nil, err
}
cfg.RuntimeSecurity.FIMEnabled = true

// probe and config are provided as null. During the tests, it is assumed
// that we will not access those values.
wp := &WindowsProbe{
opts: opts,
opts: opts,
config: cfg,
}
err := wp.Init()
err = wp.Init()

// do not call Start(), as start assumes we can load the driver. these tests
// are intended to be run without the driver needing to be present
Expand Down

0 comments on commit eee996e

Please sign in to comment.