From bb4d2beac5d237062f73e1a81ec04b6a7e23aef7 Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Tue, 18 Nov 2025 13:02:14 -0700 Subject: [PATCH 1/5] run DC script only if DC detected + * refactor verify todolist and parks-app verify into single app. thanks @tiger * update test calls * while testing mongo, use solid known pattern from oadp-1.5 * get DAT CAPS on PASSED/FAILED status --- tests/e2e/backup_restore_cli_suite_test.go | 38 ++++----- tests/e2e/backup_restore_suite_test.go | 81 +++++++++---------- tests/e2e/lib/apps.go | 10 ++- .../mongo-persistent-block.yaml | 21 ++--- .../mongo-persistent-csi.yaml | 21 ++--- .../mongo-persistent/mongo-persistent.yaml | 21 ++--- .../pvc/ibmcloud-block-mode.yaml | 2 +- tests/e2e/virt_backup_restore_suite_test.go | 2 +- 8 files changed, 84 insertions(+), 112 deletions(-) diff --git a/tests/e2e/backup_restore_cli_suite_test.go b/tests/e2e/backup_restore_cli_suite_test.go index c428d6feda9..1dbd4842783 100644 --- a/tests/e2e/backup_restore_cli_suite_test.go +++ b/tests/e2e/backup_restore_cli_suite_test.go @@ -183,7 +183,7 @@ func runApplicationBackupAndRestoreViaCLI(brCase ApplicationBackupRestoreCase, u // CLI teardown function func tearDownBackupAndRestoreViaCLI(brCase BackupRestoreCase, installTime time.Time, report ginkgo.SpecReport) { - log.Println("Post backup and restore state (CLI): ", report.State.String()) + log.Println("Post backup and restore state (CLI): ", strings.ToUpper(report.State.String())) if report.Failed() { knownFlake = lib.CheckIfFlakeOccurred(accumulatedTestLogs) @@ -265,8 +265,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mysql-persistent", Name: "mysql-csi-cli-e2e", BackupRestoreType: lib.CSI, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -276,8 +276,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mongo-persistent", Name: "mongo-csi-cli-e2e", BackupRestoreType: lib.CSI, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -287,8 +287,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mysql-persistent", Name: "mysql-twovol-csi-cli-e2e", BackupRestoreType: lib.CSI, - PreBackupVerify: todoListReady(true, true, "mysql"), - PostRestoreVerify: todoListReady(false, true, "mysql"), + PreBackupVerify: verifyApplicationReady(true, true, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, true, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -298,8 +298,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mysql-persistent", Name: "mysql-kopia-cli-e2e", BackupRestoreType: lib.KOPIA, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -309,8 +309,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mongo-persistent", Name: "mongo-datamover-cli-e2e", BackupRestoreType: lib.CSIDataMover, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -320,8 +320,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mysql-persistent", Name: "mysql-datamover-cli-e2e", BackupRestoreType: lib.CSIDataMover, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -332,8 +332,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mongo-persistent", Name: "mongo-blockdevice-cli-e2e", BackupRestoreType: lib.CSIDataMover, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -343,8 +343,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mysql-persistent", Name: "mysql-native-snapshots-cli-e2e", BackupRestoreType: lib.NativeSnapshots, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -354,8 +354,8 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c Namespace: "mongo-persistent", Name: "mongo-native-snapshots-cli-e2e", BackupRestoreType: lib.NativeSnapshots, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), diff --git a/tests/e2e/backup_restore_suite_test.go b/tests/e2e/backup_restore_suite_test.go index 7383c912293..75fd325bda8 100644 --- a/tests/e2e/backup_restore_suite_test.go +++ b/tests/e2e/backup_restore_suite_test.go @@ -43,35 +43,32 @@ type ApplicationBackupRestoreCase struct { PvcSuffixName string } -func todoListReady(preBackupState bool, twoVol bool, database string) VerificationFunction { +func verifyApplicationReady(preBackupState bool, twoVol bool, appName, routeName, workloadName string, isDC bool, sccName string) VerificationFunction { return VerificationFunction(func(ocClient client.Client, namespace string) error { - log.Printf("checking for the NAMESPACE: %s", namespace) - gomega.Eventually(lib.IsDeploymentReady(ocClient, namespace, database), time.Minute*10, time.Second*10).Should(gomega.BeTrue()) - // perhaps we phase out deploymentConfigs? - //gomega.Eventually(lib.IsDCReady(ocClient, namespace, "todolist"), time.Minute*10, time.Second*10).Should(gomega.BeTrue()) - gomega.Eventually(lib.AreApplicationPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*9, time.Second*5).Should(gomega.BeTrue()) - // This test confirms that SCC restore logic in our plugin is working - err := lib.DoesSCCExist(ocClient, database+"-persistent-scc") - if err != nil { - return err + log.Printf("checking %s for the NAMESPACE: %s", appName, namespace) + if workloadName != "" { + if isDC { + gomega.Eventually(lib.IsDCReady(ocClient, namespace, workloadName), time.Minute*10, time.Second*10).Should(gomega.BeTrue()) + } else { + gomega.Eventually(lib.IsDeploymentReady(ocClient, namespace, workloadName), time.Minute*10, time.Second*10).Should(gomega.BeTrue()) + } } - err = lib.VerifyBackupRestoreData(runTimeClientForSuiteRun, kubernetesClientForSuiteRun, kubeConfig, artifact_dir, namespace, "todolist-route", "todolist", "todolist", preBackupState, twoVol) - return err - }) -} + gomega.Eventually(lib.AreApplicationPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*9, time.Second*5).Should(gomega.BeTrue()) -func parksAppReady(preBackupState bool, twoVol bool, DCReadyCheck bool) VerificationFunction { - return VerificationFunction(func(ocClient client.Client, namespace string) error { - log.Printf("checking parksapp for the NAMESPACE: %s", namespace) - if DCReadyCheck { - gomega.Eventually(lib.IsDCReady(ocClient, namespace, "restify"), time.Minute*10, time.Second*10).Should(gomega.BeTrue()) + if sccName != "" { + // This test confirms that SCC restore logic in our plugin is working + err := lib.DoesSCCExist(ocClient, sccName) + if err != nil { + return err + } } - gomega.Eventually(lib.AreApplicationPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*9, time.Second*5).Should(gomega.BeTrue()) - err := lib.VerifyBackupRestoreData(runTimeClientForSuiteRun, kubernetesClientForSuiteRun, kubeConfig, artifact_dir, namespace, "restify", "restify", "restify", preBackupState, twoVol) + + err := lib.VerifyBackupRestoreData(runTimeClientForSuiteRun, kubernetesClientForSuiteRun, kubeConfig, artifact_dir, namespace, routeName, appName, appName, preBackupState, twoVol) return err }) } + func waitOADPReadiness(backupRestoreType lib.BackupRestoreType) { err := dpaCR.CreateOrUpdate(dpaCR.Build(backupRestoreType)) gomega.Expect(err).NotTo(gomega.HaveOccurred()) @@ -317,7 +314,7 @@ func getFailedTestLogs(oadpNamespace string, appNamespace string, installTime ti } func tearDownBackupAndRestore(brCase BackupRestoreCase, installTime time.Time, report ginkgo.SpecReport) { - log.Println("Post backup and restore state: ", report.State.String()) + log.Println("Post backup and restore state: ", strings.ToUpper(report.State.String())) gatherLogs(brCase, installTime, report) tearDownDPAResources(brCase) deleteNamespace(brCase.Namespace) @@ -403,8 +400,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mysql-persistent", Name: "mysql-csi-e2e", BackupRestoreType: lib.CSI, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -414,8 +411,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mongo-persistent", Name: "mongo-csi-e2e", BackupRestoreType: lib.CSI, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -425,8 +422,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mysql-persistent", Name: "mysql-twovol-csi-e2e", BackupRestoreType: lib.CSI, - PreBackupVerify: todoListReady(true, true, "mysql"), - PostRestoreVerify: todoListReady(false, true, "mysql"), + PreBackupVerify: verifyApplicationReady(true, true, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, true, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -436,8 +433,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mysql-persistent", Name: "mysql-kopia-e2e", BackupRestoreType: lib.KOPIA, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -447,8 +444,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mongo-persistent", Name: "mongo-datamover-e2e", BackupRestoreType: lib.CSIDataMover, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -458,8 +455,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mysql-persistent", Name: "mysql-datamover-e2e", BackupRestoreType: lib.CSIDataMover, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -470,8 +467,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mongo-persistent", Name: "mongo-blockdevice-e2e", BackupRestoreType: lib.CSIDataMover, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -481,8 +478,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mysql-persistent", Name: "mysql-native-snapshots-e2e", BackupRestoreType: lib.NativeSnapshots, - PreBackupVerify: todoListReady(true, false, "mysql"), - PostRestoreVerify: todoListReady(false, false, "mysql"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mysql", false, "mysql-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -492,8 +489,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "mongo-persistent", Name: "mongo-native-snapshots-e2e", BackupRestoreType: lib.NativeSnapshots, - PreBackupVerify: todoListReady(true, false, "mongo"), - PostRestoreVerify: todoListReady(false, false, "mongo"), + PreBackupVerify: verifyApplicationReady(true, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), + PostRestoreVerify: verifyApplicationReady(false, false, "todolist", "todolist-route", "mongo", false, "mongo-persistent-scc"), BackupTimeout: 20 * time.Minute, }, }, nil), @@ -503,8 +500,8 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() { Namespace: "parks-app", Name: "mongo-parksapp-native-snapshots-e2e", BackupRestoreType: lib.NativeSnapshots, - PreBackupVerify: parksAppReady(true, false, true), - PostRestoreVerify: parksAppReady(false, false, false), + PreBackupVerify: verifyApplicationReady(true, false, "restify", "restify", "restify", true, ""), + PostRestoreVerify: verifyApplicationReady(false, false, "restify", "restify", "", true, ""), BackupTimeout: 20 * time.Minute, ExcludedResources: []string{"jobs.batch", "events", "events.events.k8s.io", "buildconfigs.build.openshift.io", "builds.build.openshift.io"}, RestoreHooks: &velero.RestoreHooks{ diff --git a/tests/e2e/lib/apps.go b/tests/e2e/lib/apps.go index ebabfe67c7c..d7ffe4ec825 100755 --- a/tests/e2e/lib/apps.go +++ b/tests/e2e/lib/apps.go @@ -248,8 +248,16 @@ func AreVolumeSnapshotsReady(ocClient client.Client, backupName string) wait.Con func IsDCReady(ocClient client.Client, namespace, dcName string) wait.ConditionFunc { return func() (bool, error) { + // Only execute checks if a DeploymentConfig object is detected in the namespace + hasDC, err := HasDCsInNamespace(ocClient, namespace) + if err != nil { + return false, err + } + if !hasDC { + return true, nil + } dc := ocpappsv1.DeploymentConfig{} - err := ocClient.Get(context.Background(), client.ObjectKey{ + err = ocClient.Get(context.Background(), client.ObjectKey{ Namespace: namespace, Name: dcName, }, &dc) diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml index 12544c83030..377905cdaa2 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml @@ -156,10 +156,11 @@ items: startupProbe: exec: command: - - bash - - -c - - | - mongosh admin --authenticationDatabase admin -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval 'db.adminCommand("ping")' + - mongosh + - admin + - -u $(MONGO_INITDB_ROOT_USERNAME) + - -p $(MONGO_INITDB_ROOT_PASSWORD) + - --eval 'printjson(db.getCollectionNames())' initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 @@ -222,18 +223,6 @@ items: ports: - containerPort: 8000 protocol: TCP - livenessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 5 - periodSeconds: 5 initContainers: - name: init-myservice image: docker.io/curlimages/curl:8.5.0 diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml index 07c81581f90..11cb460f6f5 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml @@ -113,10 +113,11 @@ items: startupProbe: exec: command: - - bash - - -c - - | - mongosh admin --authenticationDatabase admin -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval 'db.adminCommand("ping")' + - mongosh + - admin + - -u $(MONGO_INITDB_ROOT_USERNAME) + - -p $(MONGO_INITDB_ROOT_PASSWORD) + - --eval 'printjson(db.getCollectionNames())' initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 @@ -179,18 +180,6 @@ items: ports: - containerPort: 8000 protocol: TCP - livenessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 5 - periodSeconds: 5 initContainers: - name: init-myservice image: docker.io/curlimages/curl:8.5.0 diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml index addb097dd0c..7077cca2447 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml @@ -126,10 +126,11 @@ items: startupProbe: exec: command: - - bash - - -c - - | - mongosh admin --authenticationDatabase admin -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval 'db.adminCommand("ping")' + - mongosh + - admin + - -u $(MONGO_INITDB_ROOT_USERNAME) + - -p $(MONGO_INITDB_ROOT_PASSWORD) + - --eval 'printjson(db.getCollectionNames())' initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 @@ -192,18 +193,6 @@ items: ports: - containerPort: 8000 protocol: TCP - livenessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 5 - periodSeconds: 5 initContainers: - name: init-myservice image: docker.io/curlimages/curl:8.5.0 diff --git a/tests/e2e/sample-applications/mongo-persistent/pvc/ibmcloud-block-mode.yaml b/tests/e2e/sample-applications/mongo-persistent/pvc/ibmcloud-block-mode.yaml index f059056673a..df07cc5d6b5 100644 --- a/tests/e2e/sample-applications/mongo-persistent/pvc/ibmcloud-block-mode.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/pvc/ibmcloud-block-mode.yaml @@ -15,4 +15,4 @@ items: storageClassName: ocs-storagecluster-ceph-rbd resources: requests: - storage: 1Gi \ No newline at end of file + storage: 1Gi diff --git a/tests/e2e/virt_backup_restore_suite_test.go b/tests/e2e/virt_backup_restore_suite_test.go index d7c5ec80c09..604a750fd67 100644 --- a/tests/e2e/virt_backup_restore_suite_test.go +++ b/tests/e2e/virt_backup_restore_suite_test.go @@ -18,7 +18,7 @@ import ( "github.com/openshift/oadp-operator/tests/e2e/lib" ) -// TODO duplication of todoListReady in tests/e2e/backup_restore_suite_test.go +// TODO duplication of verifyApplicationReady in tests/e2e/backup_restore_suite_test.go func vmTodoListReady(preBackupState bool, twoVol bool, database string) VerificationFunction { return VerificationFunction(func(ocClient client.Client, namespace string) error { log.Printf("checking for the NAMESPACE: %s", namespace) From 9a1fe2fe1a9819ec2a96d8363d82418be0bcb0d9 Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Fri, 21 Nov 2025 08:57:47 -0700 Subject: [PATCH 2/5] fix lint --- tests/e2e/backup_restore_suite_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/backup_restore_suite_test.go b/tests/e2e/backup_restore_suite_test.go index 75fd325bda8..c6a78bb5e46 100644 --- a/tests/e2e/backup_restore_suite_test.go +++ b/tests/e2e/backup_restore_suite_test.go @@ -68,7 +68,6 @@ func verifyApplicationReady(preBackupState bool, twoVol bool, appName, routeName }) } - func waitOADPReadiness(backupRestoreType lib.BackupRestoreType) { err := dpaCR.CreateOrUpdate(dpaCR.Build(backupRestoreType)) gomega.Expect(err).NotTo(gomega.HaveOccurred()) From 89e9ec42411a94947d4ea19d77ceeb7b356e6423 Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Fri, 21 Nov 2025 09:29:18 -0700 Subject: [PATCH 3/5] try a different startup probe --- .../mongo-persistent/mongo-persistent-block.yaml | 8 +++----- .../mongo-persistent/mongo-persistent-csi.yaml | 8 +++----- .../mongo-persistent/mongo-persistent.yaml | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml index 377905cdaa2..551c1db9d13 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml @@ -156,11 +156,9 @@ items: startupProbe: exec: command: - - mongosh - - admin - - -u $(MONGO_INITDB_ROOT_USERNAME) - - -p $(MONGO_INITDB_ROOT_PASSWORD) - - --eval 'printjson(db.getCollectionNames())' + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml index 11cb460f6f5..b94b7c25582 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml @@ -113,11 +113,9 @@ items: startupProbe: exec: command: - - mongosh - - admin - - -u $(MONGO_INITDB_ROOT_USERNAME) - - -p $(MONGO_INITDB_ROOT_PASSWORD) - - --eval 'printjson(db.getCollectionNames())' + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml index 7077cca2447..5176d33fcec 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml @@ -126,11 +126,9 @@ items: startupProbe: exec: command: - - mongosh - - admin - - -u $(MONGO_INITDB_ROOT_USERNAME) - - -p $(MONGO_INITDB_ROOT_PASSWORD) - - --eval 'printjson(db.getCollectionNames())' + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 From 44936f343e47b0dddb495bd06ed7c2dec99ff404 Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Fri, 12 Dec 2025 07:55:53 -0700 Subject: [PATCH 4/5] as close to oadp-1.5 branch as possible atm --- .../mongo-persistent-block.yaml | 11 ++-- .../mongo-persistent-csi.yaml | 19 ++++--- .../mongo-persistent/mongo-persistent.yaml | 19 ++++--- .../mysql-persistent-csi.yaml | 53 ++---------------- .../mysql-persistent-twovol-csi.yaml | 53 ++---------------- .../mysql-persistent/mysql-persistent.yaml | 55 +++---------------- 6 files changed, 44 insertions(+), 166 deletions(-) diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml index 551c1db9d13..d03632137ff 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml @@ -188,8 +188,8 @@ items: port: 27017 selector: app: mongo - - apiVersion: apps/v1 - kind: Deployment + - apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig metadata: name: todolist namespace: mongo-persistent @@ -200,9 +200,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -214,7 +213,7 @@ items: spec: containers: - name: todolist - image: quay.io/migtools/oadp-ci-todolist-mongo-go-4 + image: quay.io/migtools/oadp-ci-todolist-mongo-go-1 env: - name: foo value: bar diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml index b94b7c25582..bf1b3b07864 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml @@ -113,9 +113,11 @@ items: startupProbe: exec: command: - - /bin/bash - - -c - - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + - mongosh + - admin + - -u $(MONGO_INITDB_ROOT_USERNAME) + - -p $(MONGO_INITDB_ROOT_PASSWORD) + - --eval 'printjson(db.getCollectionNames())' initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 @@ -145,8 +147,8 @@ items: port: 27017 selector: app: mongo - - apiVersion: apps/v1 - kind: Deployment + - apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig metadata: name: todolist namespace: mongo-persistent @@ -157,9 +159,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -171,7 +172,7 @@ items: spec: containers: - name: todolist - image: quay.io/migtools/oadp-ci-todolist-mongo-go-4 + image: quay.io/migtools/oadp-ci-todolist-mongo-go-1 env: - name: foo value: bar diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml index 5176d33fcec..ab149be7801 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml @@ -126,9 +126,11 @@ items: startupProbe: exec: command: - - /bin/bash - - -c - - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + - mongosh + - admin + - -u $(MONGO_INITDB_ROOT_USERNAME) + - -p $(MONGO_INITDB_ROOT_PASSWORD) + - --eval 'printjson(db.getCollectionNames())' initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 @@ -158,8 +160,8 @@ items: port: 27017 selector: app: mongo - - apiVersion: apps/v1 - kind: Deployment + - apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig metadata: name: todolist namespace: mongo-persistent @@ -170,9 +172,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -184,7 +185,7 @@ items: spec: containers: - name: todolist - image: quay.io/migtools/oadp-ci-todolist-mongo-go-4 + image: quay.io/migtools/oadp-ci-todolist-mongo-go-1 env: - name: foo value: bar diff --git a/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-csi.yaml b/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-csi.yaml index 481434a7db1..08cbf922f15 100644 --- a/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-csi.yaml +++ b/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-csi.yaml @@ -104,40 +104,12 @@ items: volumeMounts: - name: mysql-data mountPath: /var/lib/mysql - readinessProbe: - exec: - command: - - /usr/bin/timeout - - 1s - - /usr/bin/mysql - - $(MYSQL_DATABASE) - - -h - - 127.0.0.1 - - -u$(MYSQL_USER) - - -p$(MYSQL_PASSWORD) - - -e - - SELECT 1 - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 2 - failureThreshold: 3 livenessProbe: - exec: - command: - - /usr/bin/timeout - - 1s - - /usr/bin/mysql - - $(MYSQL_DATABASE) - - -h - - 127.0.0.1 - - -u$(MYSQL_USER) - - -p$(MYSQL_PASSWORD) - - -e - - SELECT 1 + tcpSocket: + port: mysql initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 - failureThreshold: 3 startupProbe: exec: command: @@ -179,8 +151,8 @@ items: selector: app: todolist service: todolist - - apiVersion: apps/v1 - kind: Deployment + - apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig metadata: name: todolist namespace: mysql-persistent @@ -191,9 +163,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -212,18 +183,6 @@ items: ports: - containerPort: 8000 protocol: TCP - livenessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 30 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 5 initContainers: - name: init-myservice image: docker.io/curlimages/curl:8.5.0 diff --git a/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml b/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml index 634a9a14e33..e7b758e2711 100644 --- a/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml +++ b/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml @@ -96,40 +96,12 @@ items: volumeMounts: - name: mysql-data mountPath: /var/lib/mysql - readinessProbe: - exec: - command: - - /usr/bin/timeout - - 1s - - /usr/bin/mysql - - $(MYSQL_DATABASE) - - -h - - 127.0.0.1 - - -u$(MYSQL_USER) - - -p$(MYSQL_PASSWORD) - - -e - - SELECT 1 - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 2 - failureThreshold: 3 livenessProbe: - exec: - command: - - /usr/bin/timeout - - 1s - - /usr/bin/mysql - - $(MYSQL_DATABASE) - - -h - - 127.0.0.1 - - -u$(MYSQL_USER) - - -p$(MYSQL_PASSWORD) - - -e - - SELECT 1 + tcpSocket: + port: mysql initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 - failureThreshold: 3 startupProbe: exec: command: @@ -170,8 +142,8 @@ items: selector: app: todolist service: todolist - - apiVersion: apps/v1 - kind: Deployment + - apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig metadata: name: todolist namespace: mysql-persistent @@ -182,9 +154,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -203,18 +174,6 @@ items: ports: - containerPort: 8000 protocol: TCP - livenessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 30 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 5 volumeMounts: - name: applog mountPath: /tmp/log/todoapp/ diff --git a/tests/e2e/sample-applications/mysql-persistent/mysql-persistent.yaml b/tests/e2e/sample-applications/mysql-persistent/mysql-persistent.yaml index 465b8734584..d658c9e0823 100644 --- a/tests/e2e/sample-applications/mysql-persistent/mysql-persistent.yaml +++ b/tests/e2e/sample-applications/mysql-persistent/mysql-persistent.yaml @@ -117,40 +117,12 @@ items: volumeMounts: - name: mysql-data mountPath: /var/lib/mysql - readinessProbe: - exec: - command: - - /usr/bin/timeout - - 1s - - /usr/bin/mysql - - $(MYSQL_DATABASE) - - -h - - 127.0.0.1 - - -u$(MYSQL_USER) - - -p$(MYSQL_PASSWORD) - - -e - - SELECT 1 - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 2 - failureThreshold: 3 livenessProbe: - exec: - command: - - /usr/bin/timeout - - 1s - - /usr/bin/mysql - - $(MYSQL_DATABASE) - - -h - - 127.0.0.1 - - -u$(MYSQL_USER) - - -p$(MYSQL_PASSWORD) - - -e - - SELECT 1 - initialDelaySeconds: 30 + tcpSocket: + port: mysql + initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 - failureThreshold: 3 startupProbe: exec: command: @@ -192,8 +164,8 @@ items: selector: app: todolist service: todolist - - apiVersion: apps/v1 - kind: Deployment + - apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig metadata: name: todolist namespace: mysql-persistent @@ -204,9 +176,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -225,18 +196,6 @@ items: ports: - containerPort: 8000 protocol: TCP - livenessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 30 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 5 initContainers: - name: init-myservice image: docker.io/curlimages/curl:8.5.0 From fa64a39859b32259de94acc494a9c1d6139c8d0b Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Tue, 16 Dec 2025 11:43:09 -0700 Subject: [PATCH 5/5] =?UTF-8?q?=C2=AF\=5F(=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mongo-persistent/mongo-persistent-block.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml index d03632137ff..abe18e9f235 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml @@ -156,9 +156,11 @@ items: startupProbe: exec: command: - - /bin/bash - - -c - - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + - mongosh + - admin + - -u $(MONGO_INITDB_ROOT_USERNAME) + - -p $(MONGO_INITDB_ROOT_PASSWORD) + - --eval 'printjson(db.getCollectionNames())' initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5