[#312] control: Add health status field to health check response body

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-01-15 13:18:03 +03:00 committed by Alex Vanin
parent 0abb8acef3
commit 6ae51e41f9
4 changed files with 92 additions and 51 deletions

View file

@ -22,12 +22,14 @@ func TestHealthCheckResponse_Body_StableMarshal(t *testing.T) {
func generateHealthCheckResponseBody() *control.HealthCheckResponse_Body {
body := new(control.HealthCheckResponse_Body)
body.SetNetmapStatus(control.NetmapStatus_ONLINE)
body.SetHealthStatus(control.HealthStatus_SHUTTING_DOWN)
return body
}
func equalHealthCheckResponseBodies(b1, b2 *control.HealthCheckResponse_Body) bool {
return b1.GetNetmapStatus() == b2.GetNetmapStatus()
return b1.GetNetmapStatus() == b2.GetNetmapStatus() &&
b1.GetHealthStatus() == b2.GetHealthStatus()
}
func TestNetmapSnapshotResponse_Body_StableMarshal(t *testing.T) {