Skip to content

Commit

Permalink
sharedlibraries: tests: Fix bugs in the test (DataDog#31744)
Browse files Browse the repository at this point in the history
  • Loading branch information
guyarb authored Dec 4, 2024
1 parent a9eac76 commit a79d704
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/network/usm/sharedlibraries/ebpf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,20 @@ func (s *EbpfProgramSuite) TestCanInstantiateMultipleTimes() {

prog := GetEBPFProgram(cfg)
require.NotNil(t, prog)
t.Cleanup(prog.Stop)
t.Cleanup(func() {
if prog != nil {
prog.Stop()
}
})

require.NoError(t, prog.InitWithLibsets(LibsetCrypto))
prog.Stop()
prog = nil

prog2 := GetEBPFProgram(cfg)
require.NotNil(t, prog2)

require.NoError(t, prog.InitWithLibsets(LibsetCrypto))
t.Cleanup(prog2.Stop)
require.NoError(t, prog2.InitWithLibsets(LibsetCrypto))
}

func (s *EbpfProgramSuite) TestProgramReceivesEventsWithSingleLibset() {
Expand Down

0 comments on commit a79d704

Please sign in to comment.