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 86fd3ecbfc4..4c3a691081d 100644 --- a/tests/e2e/backup_restore_suite_test.go +++ b/tests/e2e/backup_restore_suite_test.go @@ -43,31 +43,27 @@ 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 }) } @@ -317,7 +313,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 +399,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 +410,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 +421,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 +432,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 +443,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 +454,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 +466,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 +477,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 +488,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), 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 11ba87f67e4..453d001682c 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 @@ -189,8 +190,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 @@ -201,9 +202,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -215,25 +215,13 @@ 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 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 7eeaca637d5..32657c373ec 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 @@ -146,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 @@ -158,9 +159,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -172,25 +172,13 @@ 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 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 f994337e457..7552690677d 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 @@ -159,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 @@ -171,9 +172,8 @@ items: spec: replicas: 1 selector: - matchLabels: - app: todolist - service: todolist + app: todolist + service: todolist strategy: type: Recreate template: @@ -185,25 +185,13 @@ 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 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/sample-applications/mysql-persistent/mysql-persistent-csi.yaml b/tests/e2e/sample-applications/mysql-persistent/mysql-persistent-csi.yaml index 0d3e7e0d698..cc042c6e94e 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 3dbf1663a6d..705eaa979c1 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 0e2b35bd25c..e38e113faaa 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 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)