From 3b8a808d0d361f292c300fa4dc4c2c6e511e3bbc Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Tue, 9 Dec 2025 12:40:19 -0700 Subject: [PATCH 1/2] add dpa reconcile check for vmfr/non-admin --- tests/e2e/dpa_deployment_suite_test.go | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/e2e/dpa_deployment_suite_test.go b/tests/e2e/dpa_deployment_suite_test.go index 819eee6348..e2503e86ff 100644 --- a/tests/e2e/dpa_deployment_suite_test.go +++ b/tests/e2e/dpa_deployment_suite_test.go @@ -33,6 +33,8 @@ type TestDPASpec struct { NoS3ForcePathStyle bool NoRegion bool DoNotBackupImages bool + EnableVMFR bool + EnableNonAdmin bool } func createTestDPASpec(testSpec TestDPASpec) *oadpv1alpha1.DataProtectionApplicationSpec { @@ -129,6 +131,16 @@ func createTestDPASpec(testSpec TestDPASpec) *oadpv1alpha1.DataProtectionApplica if testSpec.DoNotBackupImages { dpaSpec.BackupImages = ptr.To(false) } + if testSpec.EnableNonAdmin { + dpaSpec.NonAdmin = &oadpv1alpha1.NonAdmin{ + Enable: ptr.To(true), + } + } + if testSpec.EnableVMFR { + dpaSpec.VMFileRestore = &oadpv1alpha1.VMFileRestore{ + Enable: ptr.To(true), + } + } return dpaSpec } @@ -374,6 +386,52 @@ var _ = ginkgo.Describe("Configuration testing for DPA Custom Resource", func() }, "Delete restic object from spec.configuration, use spec.configuration.nodeAgent instead"), ) + ginkgo.It("Should enable and disable NonAdmin", func() { + // 1. Enable NonAdmin + testSpec := TestDPASpec{ + BSLSecretName: bslSecretName, + EnableNonAdmin: true, + } + dpaSpec := createTestDPASpec(testSpec) + err := dpaCR.CreateOrUpdate(dpaSpec) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) + + log.Printf("Waiting for DPA to be reconciled with NonAdmin enabled") + gomega.Eventually(dpaCR.IsReconciledTrue(), time.Minute*2, time.Second*5).Should(gomega.BeTrue()) + + // 2. Disable NonAdmin + testSpec.EnableNonAdmin = false + dpaSpec = createTestDPASpec(testSpec) + err = dpaCR.CreateOrUpdate(dpaSpec) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) + + log.Printf("Waiting for DPA to be reconciled with NonAdmin disabled") + gomega.Eventually(dpaCR.IsReconciledTrue(), time.Minute*2, time.Second*5).Should(gomega.BeTrue()) + }) + + ginkgo.It("Should enable and disable VMFileRestore", func() { + // 1. Enable VMFileRestore + testSpec := TestDPASpec{ + BSLSecretName: bslSecretName, + EnableVMFR: true, + } + dpaSpec := createTestDPASpec(testSpec) + err := dpaCR.CreateOrUpdate(dpaSpec) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) + + log.Printf("Waiting for DPA to be reconciled with VMFileRestore enabled") + gomega.Eventually(dpaCR.IsReconciledTrue(), time.Minute*2, time.Second*5).Should(gomega.BeTrue()) + + // 2. Disable VMFileRestore + testSpec.EnableVMFR = false + dpaSpec = createTestDPASpec(testSpec) + err = dpaCR.CreateOrUpdate(dpaSpec) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) + + log.Printf("Waiting for DPA to be reconciled with VMFileRestore disabled") + gomega.Eventually(dpaCR.IsReconciledTrue(), time.Minute*2, time.Second*5).Should(gomega.BeTrue()) + }) + ginkgo.DescribeTable("DPA Deletion test", func() { log.Printf("Creating DPA") From 0dd5fcaddb450f4e984b1456ec0c264e631664f0 Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Tue, 9 Dec 2025 12:43:22 -0700 Subject: [PATCH 2/2] add doc re: test filter --- docs/developer/testing/TESTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/developer/testing/TESTING.md b/docs/developer/testing/TESTING.md index 9f2427802b..47751965a4 100644 --- a/docs/developer/testing/TESTING.md +++ b/docs/developer/testing/TESTING.md @@ -100,6 +100,11 @@ You can also execute make test-e2e with a $GINKGO_ARGS variable set. Example: make test-e2e GINKGO_ARGS="--ginkgo.focus='MySQL application DATAMOVER'" ``` +Some tests, like the DPA configuration will need the test filter removed +```bash +make test-e2e TEST_FILTER="" GINKGO_ARGS="--focus='Should enable and disable VMFileRestore'" +``` + ### Run selected test for HCP against external HostedControlPlane Set common env variables as mentioned above, then run: