feat(go): advance validation sidecar toward production
This commit is contained in:
parent
6a06eba255
commit
f85c2e831a
92 changed files with 8881 additions and 91 deletions
15
go-agent/internal/events/exec_event_test.go
Normal file
15
go-agent/internal/events/exec_event_test.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package events
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestExecEventDerivedFieldsMatchPython(t *testing.T) {
|
||||
event := ExecEvent{Filename: "/tmp/x", Argv: []string{"-c", "echo hi"}}
|
||||
if event.ExecComm() != "x" || event.ArgvString() != "/tmp/x -c echo hi" {
|
||||
t.Fatalf("unexpected derived fields: %q %q", event.ExecComm(), event.ArgvString())
|
||||
}
|
||||
if got := (ExecEvent{Filename: "/tmp/x/"}).ExecComm(); got != "" {
|
||||
t.Fatalf("trailing-slash basename drifted from Python: %q", got)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue