Clusters : port 8006 par défaut, liste des cibles jamais null
This commit is contained in:
1 parent
8dd2f187ee
commit
ee8343c69f
5 files changed
+50
-3
No files matched your search
@@ -239,6 +239,19 @@ func TestFromScratch(t *testing.T) {
|
||||
if _, d := adm.do("GET", "/api/state", nil, false); d["setup"] != "clusters" {
|
||||
t.Fatalf("state on an empty database: %v", d)
|
||||
}
|
||||
// a primary alone: no target yet, the state lists none (not null); no port: 8006
|
||||
if code, d := adm.do("PUT", "/api/clusters/-", map[string]any{"name": "solo", "role": "primary", "url": "https://pve-solo", "password": "x", "tls": "insecure"}, true); code != http.StatusOK {
|
||||
t.Fatalf("save solo: %d %v", code, d)
|
||||
}
|
||||
if _, d := adm.do("GET", "/api/clusters", nil, false); d["clusters"].([]any)[0].(map[string]any)["url"] != "https://pve-solo:8006" {
|
||||
t.Fatalf("default port expected: %v", d)
|
||||
}
|
||||
if _, d := adm.do("GET", "/api/state", nil, false); d["state"] == nil || d["state"].(map[string]any)["clients"] == nil {
|
||||
t.Fatalf("clients must be an empty list: %v", d)
|
||||
}
|
||||
if code, d := adm.do("DELETE", "/api/clusters/solo", nil, true); code != http.StatusOK {
|
||||
t.Fatalf("delete solo: %d %v", code, d)
|
||||
}
|
||||
for _, c := range []struct {
|
||||
name string
|
||||
s *pvetest.Server
|
||||
|
||||
Reference in new issue
Block a user