Improve service checks and system health details
This commit is contained in:
@@ -27,3 +27,14 @@ func TestValidateServiceAllowsLocalAddress(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateServiceChecksBothHTTPAddresses(t *testing.T) {
|
||||
v := MonitoredService{Name: "Gitea", URL: "https://git.example.test", LocalAddress: "192.168.0.6:3000", CheckType: "http", TimeoutSeconds: 5}
|
||||
if err := validateService(v); err == nil {
|
||||
t.Fatal("expected invalid local HTTP address")
|
||||
}
|
||||
v.LocalAddress = "https://192.168.0.6:3000"
|
||||
if err := validateService(v); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user