Commit 43d595b7 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

integration: Add tests for healthmon

parent fa8bccba
...@@ -942,3 +942,22 @@ backend=127.0.0.1,3011 ...@@ -942,3 +942,22 @@ backend=127.0.0.1,3011
t.Errorf("apiResp.Status: %v; want %v", got, want) t.Errorf("apiResp.Status: %v; want %v", got, want)
} }
} }
// TestH1Healthmon tests health monitor endpoint.
func TestH1Healthmon(t *testing.T) {
st := newServerTesterConnectPort([]string{"-f127.0.0.1,3011;healthmon;no-tls"}, t, func(w http.ResponseWriter, r *http.Request) {
t.Fatalf("request should not be forwarded")
}, 3011)
defer st.Close()
res, err := st.http1(requestParam{
name: "TestH1Healthmon",
path: "/alpha/bravo",
})
if err != nil {
t.Fatalf("Error st.http1() = %v", err)
}
if got, want := res.status, 200; got != want {
t.Errorf("res.status: %v; want %v", got, want)
}
}
...@@ -1992,3 +1992,22 @@ backend=127.0.0.1,3011 ...@@ -1992,3 +1992,22 @@ backend=127.0.0.1,3011
t.Errorf("apiResp.Status: %v; want %v", got, want) t.Errorf("apiResp.Status: %v; want %v", got, want)
} }
} }
// TestH2Healthmon tests health monitor endpoint.
func TestH2Healthmon(t *testing.T) {
st := newServerTesterConnectPort([]string{"-f127.0.0.1,3011;healthmon;no-tls"}, t, func(w http.ResponseWriter, r *http.Request) {
t.Fatalf("request should not be forwarded")
}, 3011)
defer st.Close()
res, err := st.http2(requestParam{
name: "TestH2Healthmon",
path: "/alpha/bravo",
})
if err != nil {
t.Fatalf("Error st.http2() = %v", err)
}
if got, want := res.status, 200; got != want {
t.Errorf("res.status: %v; want %v", got, want)
}
}
...@@ -623,3 +623,22 @@ backend=127.0.0.1,3011 ...@@ -623,3 +623,22 @@ backend=127.0.0.1,3011
t.Errorf("apiResp.Status: %v; want %v", got, want) t.Errorf("apiResp.Status: %v; want %v", got, want)
} }
} }
// TestS3Healthmon tests health monitor endpoint.
func TestS3Healthmon(t *testing.T) {
st := newServerTesterTLSConnectPort([]string{"--npn-list=spdy/3.1", "-f127.0.0.1,3011;healthmon"}, t, func(w http.ResponseWriter, r *http.Request) {
t.Fatalf("request should not be forwarded")
}, 3011)
defer st.Close()
res, err := st.spdy(requestParam{
name: "TestS3Healthmon",
path: "/alpha/bravo",
})
if err != nil {
t.Fatalf("Error st.spdy() = %v", err)
}
if got, want := res.status, 200; got != want {
t.Errorf("res.status: %v; want %v", got, want)
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment