feat: add proxmox reconciliation job
This commit is contained in:
@@ -130,6 +130,25 @@ func TestClientPowersVM(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientGetsVMStatus(t *testing.T) {
|
||||
server := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/api2/json/nodes/pve/qemu/100/status/current" {
|
||||
t.Fatalf("path = %q", r.URL.Path)
|
||||
}
|
||||
_, _ = w.Write([]byte(`{"data":{"status":"running"}}`))
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
client := newTestClient(t, server, fingerprintForServer(server))
|
||||
status, err := client.GetVMStatus(context.Background(), "pve", 100)
|
||||
if err != nil {
|
||||
t.Fatalf("GetVMStatus() error = %v", err)
|
||||
}
|
||||
if status.Status != "running" {
|
||||
t.Fatalf("status = %q, want running", status.Status)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewClientRejectsInvalidFingerprint(t *testing.T) {
|
||||
_, err := NewClient(cluster.Cluster{
|
||||
APIEndpoint: "https://pve.example.test:8006/api2/json",
|
||||
|
||||
Reference in New Issue
Block a user