mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
e2e: add snapshot count validation
Add snapshot count validation for cephfs and nfs to avoid resource leak. fixes: #3224 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
c5a6d11a8f
commit
28f51aaaf7
@ -208,6 +208,12 @@ var _ = Describe("CephFS Upgrade Testing", func() {
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create pvc and application: %v", err)
|
||||
}
|
||||
var pv *v1.PersistentVolume
|
||||
_, pv, err = getPVCAndPV(f.ClientSet, pvc.Name, pvc.Namespace)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to get PV object for %s: %v", pvc.Name, err)
|
||||
}
|
||||
|
||||
opt := metav1.ListOptions{
|
||||
LabelSelector: fmt.Sprintf("%s=%s", appKey, label[appKey]),
|
||||
}
|
||||
@ -246,6 +252,8 @@ var _ = Describe("CephFS Upgrade Testing", func() {
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create snapshot %v", err)
|
||||
}
|
||||
validateCephFSSnapshotCount(f, 1, defaultSubvolumegroup, pv)
|
||||
|
||||
err = deletePod(app.Name, app.Namespace, f.ClientSet, deployTimeout)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete application: %v", err)
|
||||
@ -300,6 +308,12 @@ var _ = Describe("CephFS Upgrade Testing", func() {
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create pvc and application: %v", err)
|
||||
}
|
||||
var pv *v1.PersistentVolume
|
||||
_, pv, err = getPVCAndPV(f.ClientSet, pvc.Name, pvc.Namespace)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to get PV object for %s: %v", pvc.Name, err)
|
||||
}
|
||||
|
||||
opt := metav1.ListOptions{
|
||||
LabelSelector: fmt.Sprintf("%s=%s", appKey, label[appKey]),
|
||||
}
|
||||
@ -333,6 +347,7 @@ var _ = Describe("CephFS Upgrade Testing", func() {
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete snapshot %v", err)
|
||||
}
|
||||
validateCephFSSnapshotCount(f, 0, defaultSubvolumegroup, pv)
|
||||
})
|
||||
|
||||
By("Create clone from existing PVC", func() {
|
||||
|
Reference in New Issue
Block a user