fix(agentctl): allow native ACP CLIs in probe allowlist (#1059)
This commit is contained in:
@@ -1,6 +1,35 @@
|
||||
package utility
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"maps"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestResolveProbeCommand_AllowsEveryListedBinary(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for _, name := range slices.Sorted(maps.Keys(allowedProbeCommands)) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
if got := resolveProbeCommand(name); got != name {
|
||||
t.Fatalf("resolveProbeCommand(%q) = %q, want %q", name, got, name)
|
||||
}
|
||||
path := filepath.Join("/usr/local/bin", name)
|
||||
if got := resolveProbeCommand(path); got != name {
|
||||
t.Fatalf("resolveProbeCommand(%q) = %q, want %q", path, got, name)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveProbeCommand_RejectsUnknown(t *testing.T) {
|
||||
t.Parallel()
|
||||
if got := resolveProbeCommand("claude"); got != "" {
|
||||
t.Fatalf("resolveProbeCommand(claude) = %q, want empty", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSanitizeInferenceChunk_DropsPiVersionBanner(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
Reference in New Issue
Block a user