From 2307687dc2c9e924a02b24190bd39a363c2afe30 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 5 Aug 2020 13:05:17 +0530 Subject: [PATCH] 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 --- e2e/cephfs.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/e2e/cephfs.go b/e2e/cephfs.go index e8a8d34c8..119f930a4 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -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 for i := 0; i < totalCount; 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() {