Skip to content

Commit

Permalink
Add required changes after api update
Browse files Browse the repository at this point in the history
Signed-off-by: Malay Kumar Parida <[email protected]>
  • Loading branch information
malayparida2000 committed Nov 14, 2024
1 parent 913114a commit ff3e55b
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions metrics/internal/collectors/ceph-block-pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,49 @@ func TestCollectPoolMirroringImageHealth(t *testing.T) {
objOk := mockCephBlockPool1.DeepCopy()
objOk.Name = objOk.Name + "ok"
objOk.Status = &cephv1.CephBlockPoolStatus{
MirroringStatus: &cephv1.MirroringStatusSpec{PoolMirroringStatus: cephv1.PoolMirroringStatus{Summary: &cephv1.PoolMirroringStatusSummarySpec{ImageHealth: "OK"}}},
MirroringStatus: &cephv1.MirroringStatusSpec{
MirroringStatus: cephv1.MirroringStatus{
Summary: &cephv1.MirroringStatusSummarySpec{
ImageHealth: "OK",
},
},
},
}

objUnknown := mockCephBlockPool1.DeepCopy()
objUnknown.Name = objUnknown.Name + "unknown"
objUnknown.Status = &cephv1.CephBlockPoolStatus{
MirroringStatus: &cephv1.MirroringStatusSpec{PoolMirroringStatus: cephv1.PoolMirroringStatus{Summary: &cephv1.PoolMirroringStatusSummarySpec{ImageHealth: "UNKNOWN"}}},
MirroringStatus: &cephv1.MirroringStatusSpec{
MirroringStatus: cephv1.MirroringStatus{
Summary: &cephv1.MirroringStatusSummarySpec{
ImageHealth: "UNKNOWN",
},
},
},
}

objWarning := mockCephBlockPool1.DeepCopy()
objWarning.Name = objWarning.Name + "warning"
objWarning.Status = &cephv1.CephBlockPoolStatus{
MirroringStatus: &cephv1.MirroringStatusSpec{PoolMirroringStatus: cephv1.PoolMirroringStatus{Summary: &cephv1.PoolMirroringStatusSummarySpec{ImageHealth: "WARNING"}}},
MirroringStatus: &cephv1.MirroringStatusSpec{
MirroringStatus: cephv1.MirroringStatus{
Summary: &cephv1.MirroringStatusSummarySpec{
ImageHealth: "WARNING",
},
},
},
}

objError := mockCephBlockPool1.DeepCopy()
objError.Name = objError.Name + "error"
objError.Status = &cephv1.CephBlockPoolStatus{
MirroringStatus: &cephv1.MirroringStatusSpec{PoolMirroringStatus: cephv1.PoolMirroringStatus{Summary: &cephv1.PoolMirroringStatusSummarySpec{ImageHealth: "ERROR"}}},
MirroringStatus: &cephv1.MirroringStatusSpec{
MirroringStatus: cephv1.MirroringStatus{
Summary: &cephv1.MirroringStatusSummarySpec{
ImageHealth: "ERROR",
},
},
},
}

tests := Tests{
Expand Down

0 comments on commit ff3e55b

Please sign in to comment.