e2e: add backend validation of cephfs pvc

added a backend validation to check subvolumes
count when we create and delete pvc.

fixes #1316

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-08-05 13:05:17 +05:30 committed by mergify[bot]
parent 141b89f514
commit 2307687dc2

View File

@ -232,8 +232,12 @@ var _ = Describe("cephfs", func() {
} }
} }
// TODO add cephfs backend validation subVol := listCephFSSubVolumes(f, "myfs", subvolumegroup)
if len(subVol) != totalCount {
msg := fmt.Sprintf("subvolumes %v. subvolume count %d not matching expected count %v", subVol, len(subVol), totalCount)
e2elog.Logf(msg)
Fail(msg)
}
// delete pvc and app // delete pvc and app
for i := 0; i < totalCount; i++ { for i := 0; i < totalCount; i++ {
name := fmt.Sprintf("%s%d", f.UniqueName, i) name := fmt.Sprintf("%s%d", f.UniqueName, i)
@ -243,6 +247,12 @@ var _ = Describe("cephfs", func() {
} }
} }
subVol = listCephFSSubVolumes(f, "myfs", subvolumegroup)
if len(subVol) != 0 {
msg := fmt.Sprintf("subvolumes %v. subvolume count %d not matching expected count %v", subVol, len(subVol), 0)
e2elog.Logf(msg)
Fail(msg)
}
}) })
By("check data persist after recreating pod with same pvc", func() { By("check data persist after recreating pod with same pvc", func() {