mirror of https://github.com/helm/helm
parent
ada108126c
commit
fe3afa8012
@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestProbesServer(t *testing.T) {
|
||||
mux := newProbesMux()
|
||||
srv := httptest.NewServer(mux)
|
||||
defer srv.Close()
|
||||
resp, err := http.Get("/readiness")
|
||||
if err != nil {
|
||||
t.Fatalf("GET /readiness returned an error (%s)", err)
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
t.Fatalf("GET /readiness returned status code %d, expected %d", resp.StatusCode, http.StatusOK)
|
||||
}
|
||||
|
||||
resp, err = http.Get("/liveness")
|
||||
if err != nil {
|
||||
t.Fatalf("GET /liveness returned an error (%s)", err)
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
t.Fatalf("GET /liveness returned status code %d, expected %d", resp.StatusCode, http.StatusOK)
|
||||
}
|
||||
}
|
Loading…
Reference in new issue