mirror of
https://github.com/bpmforge/kryptkeeper.git
synced 2026-11-23 16:02:01 +00:00
e0d82a4ed0
First stable release. Notes: docs/release/RELEASE_NOTES_v1.0.0.md Lab record: docs/release/LIVE_RESULTS_v1.0.0.md
32 lines
705 B
Go
32 lines
705 B
Go
// Copyright 2026 Kryptkeeper Authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"kryptkeeper/internal/metrics"
|
|
)
|
|
|
|
func TestCertManagerOpsReadiness(t *testing.T) {
|
|
h := metrics.OpsHandler(newOpsConfig("x"))
|
|
code := func(p string) int {
|
|
rec := httptest.NewRecorder()
|
|
h.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, p, nil))
|
|
return rec.Code
|
|
}
|
|
ready.Store(false)
|
|
if code("/healthz") != 200 || code("/readyz") != 503 {
|
|
t.Fatal("not-running controller must be live but unready")
|
|
}
|
|
ready.Store(true)
|
|
t.Cleanup(func() { ready.Store(false) })
|
|
if code("/readyz") != 200 {
|
|
t.Fatal("running controller must be ready")
|
|
}
|
|
}
|