fix health unit tests
This commit is contained in:
parent
5dd16fe875
commit
362cb4b8dd
|
@ -176,18 +176,14 @@ func TestClusterHealthCollector(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "health ok",
|
||||
input: `
|
||||
{
|
||||
"health": { "status": "HEALTH_OK" } }`,
|
||||
input: `{"health": { "status": "HEALTH_OK" } }`,
|
||||
reMatch: []*regexp.Regexp{
|
||||
regexp.MustCompile(`health_status{cluster="ceph"} 0`),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "health warn",
|
||||
input: `
|
||||
{
|
||||
"health": { "status": "HEALTH_OK } }`,
|
||||
input: `{"health": { "status": "HEALTH_OK" } }`,
|
||||
reMatch: []*regexp.Regexp{
|
||||
regexp.MustCompile(`health_status{cluster="ceph"} 0`),
|
||||
regexp.MustCompile(`health_status_interp{cluster="ceph"} 0`),
|
||||
|
@ -195,9 +191,7 @@ func TestClusterHealthCollector(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "health ok 2",
|
||||
input: `
|
||||
{
|
||||
"health": { "status": "HEALTH_OK } }`,
|
||||
input: `{"health": { "status": "HEALTH_OK" } }`,
|
||||
reMatch: []*regexp.Regexp{
|
||||
regexp.MustCompile(`health_status{cluster="ceph"} 0`),
|
||||
regexp.MustCompile(`health_status_interp{cluster="ceph"} 0`),
|
||||
|
@ -205,9 +199,7 @@ func TestClusterHealthCollector(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "health warn 2",
|
||||
input: `
|
||||
{
|
||||
"health": { "status": "HEALTH_WARN" } }`,
|
||||
input: `{"health": { "status": "HEALTH_WARN" } }`,
|
||||
reMatch: []*regexp.Regexp{
|
||||
regexp.MustCompile(`health_status{cluster="ceph"} 1`),
|
||||
regexp.MustCompile(`health_status_interp{cluster="ceph"} 2`),
|
||||
|
@ -215,9 +207,7 @@ func TestClusterHealthCollector(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "health err",
|
||||
input: `
|
||||
{
|
||||
"health": { "status": "HEALTH_ERR" } }`,
|
||||
input: `{"health": { "status": "HEALTH_ERR" } }`,
|
||||
reMatch: []*regexp.Regexp{
|
||||
regexp.MustCompile(`health_status{cluster="ceph"} 2`),
|
||||
regexp.MustCompile(`health_status_interp{cluster="ceph"} 3`),
|
||||
|
|
Loading…
Reference in New Issue