Files
lostakj 6e3bb0ff7b
Build Docker image on push / docker (push) Successful in 22s
Build and push Docker image on tag / docker (push) Successful in 23s
Added host URL normalization
2026-08-17 23:04:28 +02:00

33 lines
713 B
Go

package configuration
import "testing"
func TestConfigurationValidateAcceptsIPAndDNSPveHosts(t *testing.T) {
tests := []struct {
name string
host string
}{
{name: "IP address", host: "https://192.168.0.10:8006"},
{name: "DNS name", host: "https://pve.example.com:8006"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
configuration := Configuration{
Host: "0.0.0.0",
PVE: PveConfiguration{
Hosts: []string{tt.host},
Token: PveTokenConfiguration{
TokenId: "token",
Secret: "secret",
},
},
}
if err := configuration.Validate(); err != nil {
t.Fatalf("Validate() rejected %s host %q: %v", tt.name, tt.host, err)
}
})
}
}