From 7752ebe45e625ec18f0aee8dce09629a626be6cc Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Thu, 18 Jan 2018 10:00:28 -0500 Subject: [PATCH] Fix sys/health tests --- http/sys_health_test.go | 55 +++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/http/sys_health_test.go b/http/sys_health_test.go index e03589110..33456ed7f 100644 --- a/http/sys_health_test.go +++ b/http/sys_health_test.go @@ -8,6 +8,7 @@ import ( "reflect" "testing" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/vault" ) @@ -23,10 +24,11 @@ func TestSysHealth_get(t *testing.T) { var actual map[string]interface{} expected := map[string]interface{}{ - "replication_dr_secondary": false, - "initialized": false, - "sealed": true, - "standby": true, + "replication_perf_mode": consts.ReplicationDisabled.String(), + "replication_dr_mode": consts.ReplicationDisabled.String(), + "initialized": false, + "sealed": true, + "standby": true, } testResponseStatus(t, resp, 501) testResponseBody(t, resp, &actual) @@ -54,10 +56,11 @@ func TestSysHealth_get(t *testing.T) { actual = map[string]interface{}{} expected = map[string]interface{}{ - "replication_dr_secondary": false, - "initialized": true, - "sealed": true, - "standby": true, + "replication_perf_mode": consts.ReplicationDisabled.String(), + "replication_dr_mode": consts.ReplicationDisabled.String(), + "initialized": true, + "sealed": true, + "standby": true, } testResponseStatus(t, resp, 503) testResponseBody(t, resp, &actual) @@ -89,10 +92,11 @@ func TestSysHealth_get(t *testing.T) { actual = map[string]interface{}{} expected = map[string]interface{}{ - "replication_dr_secondary": false, - "initialized": true, - "sealed": false, - "standby": false, + "replication_perf_mode": consts.ReplicationDisabled.String(), + "replication_dr_mode": consts.ReplicationDisabled.String(), + "initialized": true, + "sealed": false, + "standby": false, } testResponseStatus(t, resp, 200) testResponseBody(t, resp, &actual) @@ -130,10 +134,11 @@ func TestSysHealth_customcodes(t *testing.T) { var actual map[string]interface{} expected := map[string]interface{}{ - "replication_dr_secondary": false, - "initialized": false, - "sealed": true, - "standby": true, + "replication_perf_mode": consts.ReplicationDisabled.String(), + "replication_dr_mode": consts.ReplicationDisabled.String(), + "initialized": false, + "sealed": true, + "standby": true, } testResponseStatus(t, resp, 581) testResponseBody(t, resp, &actual) @@ -162,10 +167,11 @@ func TestSysHealth_customcodes(t *testing.T) { actual = map[string]interface{}{} expected = map[string]interface{}{ - "replication_dr_secondary": false, - "initialized": true, - "sealed": true, - "standby": true, + "replication_perf_mode": consts.ReplicationDisabled.String(), + "replication_dr_mode": consts.ReplicationDisabled.String(), + "initialized": true, + "sealed": true, + "standby": true, } testResponseStatus(t, resp, 523) testResponseBody(t, resp, &actual) @@ -198,10 +204,11 @@ func TestSysHealth_customcodes(t *testing.T) { actual = map[string]interface{}{} expected = map[string]interface{}{ - "replication_dr_secondary": false, - "initialized": true, - "sealed": false, - "standby": false, + "replication_perf_mode": consts.ReplicationDisabled.String(), + "replication_dr_mode": consts.ReplicationDisabled.String(), + "initialized": true, + "sealed": false, + "standby": false, } testResponseStatus(t, resp, 202) testResponseBody(t, resp, &actual)