feat: import Sea vHost single-server testing release

This commit is contained in:
canglan committed 2026-10-30 08:39:10 +08:00
commit 248badd33e
441 files changed
+63221

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
package cluster
import "testing"
func TestRoutingIgnoresCustomerDomainPrefixes(t *testing.T) {
cases := []struct {
body map[string]any
host string
}{
{map[string]any{"name": "sv0123456789.customer.example", "domain": "svabcdef0123.example"}, ""},
{map[string]any{"hostName": "sv0123456789"}, "sv0123456789"},
{map[string]any{"site": map[string]any{"Name": "svabcdef0123", "Domain": "sv0123456789.customer.example"}}, "svabcdef0123"},
{map[string]any{"runtime": map[string]any{"ProjectName": "svabcdef0123_42"}}, "svabcdef0123"},
}
for _, tc := range cases {
if got := hostFromValue(tc.body); got != tc.host {
t.Fatalf("route identity = %q, want %q", got, tc.host)
}
}
}