From 15dc4975d942d1d635b9afd04f9e374aa6faa357 Mon Sep 17 00:00:00 2001 From: Sheetal Pamecha Date: Sun, 23 Jun 2024 23:33:30 +0530 Subject: [PATCH] tests: fix tests for NewVSHandler (#4) Signed-off-by: Sheetal Pamecha --- controllers/volsync/vshandler_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/volsync/vshandler_test.go b/controllers/volsync/vshandler_test.go index 9a830ad264..27e209bd37 100644 --- a/controllers/volsync/vshandler_test.go +++ b/controllers/volsync/vshandler_test.go @@ -87,7 +87,7 @@ var _ = Describe("VolSync Handler - Volume Replication Class tests", func() { var vsHandler *volsync.VSHandler BeforeEach(func() { - vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, nil, asyncSpec, "none", "Snapshot", false) + vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, nil, asyncSpec, "none", "Snapshot", true) }) It("GetVolumeSnapshotClasses() should find all volume snapshot classes", func() { @@ -116,7 +116,7 @@ var _ = Describe("VolSync Handler - Volume Replication Class tests", func() { }, } - vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, nil, asyncSpec, "none", "Snapshot", false) + vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, nil, asyncSpec, "none", "Snapshot", true) }) It("GetVolumeSnapshotClasses() should find matching volume snapshot classes", func() { @@ -159,7 +159,7 @@ var _ = Describe("VolSync Handler - Volume Replication Class tests", func() { }, } - vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, nil, asyncSpec, "none", "Snapshot", false) + vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, nil, asyncSpec, "none", "Snapshot", true) }) It("GetVolumeSnapshotClasses() should find matching volume snapshot classes", func() { @@ -216,7 +216,7 @@ var _ = Describe("VolSync Handler - Volume Replication Class tests", func() { // Initialize a vshandler vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, nil, asyncSpec, - "openshift-storage.cephfs.csi.ceph.com", "Snapshot", false) + "openshift-storage.cephfs.csi.ceph.com", "Snapshot", true) }) JustBeforeEach(func() { @@ -431,7 +431,7 @@ var _ = Describe("VolSync_Handler", func() { Expect(ownerCm.GetName()).NotTo(BeEmpty()) owner = ownerCm - vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, owner, asyncSpec, "none", "Snapshot", false) + vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, owner, asyncSpec, "none", "Snapshot", true) }) AfterEach(func() { @@ -656,7 +656,7 @@ var _ = Describe("VolSync_Handler", func() { BeforeEach(func() { rdSpec.ProtectedPVC.Namespace = testNamespace.GetName() - vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, owner, asyncSpec, "none", "Direct", false) + vsHandler = volsync.NewVSHandler(ctx, k8sClient, logger, owner, asyncSpec, "none", "Direct", true) }) It("PrecreateDestPVCIfEnabled() should return CopyMethod Snapshot and App PVC name", func() { @@ -1468,7 +1468,7 @@ var _ = Describe("VolSync_Handler", func() { Expect(k8sClient.Create(ctx, otherOwnerCm)).To(Succeed()) Expect(otherOwnerCm.GetName()).NotTo(BeEmpty()) otherVSHandler := volsync.NewVSHandler(ctx, k8sClient, logger, otherOwnerCm, asyncSpec, - "none", "Snapshot", false) + "none", "Snapshot", true) for i := 0; i < 2; i++ { otherOwnerRdSpec := ramendrv1alpha1.VolSyncReplicationDestinationSpec{ @@ -1660,7 +1660,7 @@ var _ = Describe("VolSync_Handler", func() { Expect(k8sClient.Create(ctx, otherOwnerCm)).To(Succeed()) Expect(otherOwnerCm.GetName()).NotTo(BeEmpty()) otherVSHandler := volsync.NewVSHandler(ctx, k8sClient, logger, otherOwnerCm, asyncSpec, - "none", "Snapshot", false) + "none", "Snapshot", true) for i := 0; i < 2; i++ { otherOwnerRsSpec := ramendrv1alpha1.VolSyncReplicationSourceSpec{