Files
admin bb60c06c0e
Container-Image veröffentlichen / container (push) v1.4.0 wurde manuell veröffentlicht und verifiziert
feat: establish secure update foundation
2026-08-29 11:30:43 +02:00

25 lines
942 B
Go

package main
import "testing"
func TestCommandForInvocationKeepsV13ComposeAgentCompatible(t *testing.T) {
t.Parallel()
tests := []struct {
arguments []string
want string
}{
{arguments: []string{"/usr/local/bin/domain-control"}, want: "serve"},
{arguments: []string{"/usr/local/bin/domain-control", "update-agent"}, want: "update-agent"},
{arguments: []string{"/usr/local/bin/domain-control", "healthcheck"}, want: "healthcheck"},
{arguments: []string{"/usr/local/bin/update-agent"}, want: "update-agent"},
{arguments: []string{"/usr/local/bin/update-agent", "serve"}, want: "update-agent"},
{arguments: []string{"/usr/local/bin/domain-control", "serve", "extra"}, want: "invalid"},
{arguments: nil, want: "invalid"},
}
for _, test := range tests {
if got := commandForInvocation(test.arguments); got != test.want {
t.Errorf("commandForInvocation(%q) = %q; want %q", test.arguments, got, test.want)
}
}
}