forked from vinted/ceph-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ceph_health_collector_test.go
46 lines (44 loc) · 2.04 KB
/
ceph_health_collector_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"reflect"
"testing"
)
func TestCephHealthCollector(t *testing.T) {
health := CephHealthCollector()
if reflect.TypeOf(health["ceph_cluster_pgs_degraded"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_degraded] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_undersized"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_undersized] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_stuck_degraded"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_stuck_degraded] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_stuck_unclean"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_degraded] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_backfill"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_backfill] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_backfill_toofull"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_backfill_toofull] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_backfill_wait"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_backfill_wait] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_recovery_wait"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_recovery_wait] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_pgs_peering"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_pgs_peering] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_objects_degraded"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_objects_degraded] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_objects_misplaced"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_objects_misplaced] has wrong data")
}
if reflect.TypeOf(health["ceph_cluster_noout_flag"]).String() != "main.cephHealthData" {
t.Errorf("health[ceph_cluster_noout_flag] has wrong data")
}
}