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

+25
View File
@@ -0,0 +1,25 @@
package service
import (
"context"
"strings"
"testing"
)
func TestCustomDomainRejectsEveryPlatformReservedZone(t *testing.T) {
projects := &Projects{reservedDomains: []string{"hosts.example.com", "console.example.com", "ftp.example.com"}}
tests := []string{
"hosts.example.com",
"tenant.hosts.example.com",
"console.example.com",
"login.console.example.com",
"ftp.example.com",
"files.ftp.example.com",
}
for _, domain := range tests {
_, _, err := projects.customDomain(context.Background(), domain)
if err == nil || !strings.Contains(err.Error(), "平台保留域名") {
t.Errorf("reserved domain %q was accepted: %v", domain, err)
}
}
}