tailcfg: add ServiceActionType constants

Updates tailscale/corp#42661

Signed-off-by: Adriano Sela Aviles <adriano@tailscale.com>
This commit is contained in:
Adriano Sela Aviles
2026-06-04 14:53:15 -07:00
committed by Adriano Sela Aviles
parent 6cb3852535
commit fc9b18f507
2 changed files with 132 additions and 1 deletions
+28
View File
@@ -1033,3 +1033,31 @@ func TestDisplayMessageEqual(t *testing.T) {
})
}
}
func TestServiceActionTypeValid(t *testing.T) {
tests := []struct {
typ ServiceActionType
want bool
}{
{ServiceActionTypeAWSS3, true},
{ServiceActionTypeCockroachDB, true},
{ServiceActionTypeElasticSearch, true},
{ServiceActionTypeHTTP, true},
{ServiceActionTypeKubernetes, true},
{ServiceActionTypeMongoDB, true},
{ServiceActionTypeMSSQL, true},
{ServiceActionTypeMySQL, true},
{ServiceActionTypePostgreSQL, true},
{ServiceActionTypeRDP, true},
{ServiceActionTypeVNC, true},
{ServiceActionTypeSSH, true},
{ServiceActionTypeTCP, true},
{"ftp", false},
{"", false},
}
for _, tt := range tests {
if got := tt.typ.Valid(); got != tt.want {
t.Errorf("ServiceActionType(%q).Valid() = %v, want %v", tt.typ, got, tt.want)
}
}
}