Skip to content

Commit cf961af

Browse files
committed
cherry-pick openshift#864 to oadp-1.1 for datamover
1 parent 30c4431 commit cf961af

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

tests/e2e/backup_restore_suite_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@ import (
2525

2626
type VerificationFunction func(client.Client, string) error
2727

28-
type appVerificationFunction func(bool, BackupRestoreType) VerificationFunction
29-
30-
func dataMoverReady(preBackupState bool, appVerificationFunction appVerificationFunction) VerificationFunction {
28+
func dataMoverReady(veriFunc VerificationFunction) VerificationFunction {
3129
return VerificationFunction(func(ocClient client.Client, appNamespace string) error {
3230
// check volsync subscription exists
3331
Eventually(InstalledSubscriptionCSV(ocClient, "openshift-operators", "volsync-product"), timeoutMultiplier*time.Minute*10, time.Second*10).ShouldNot(Equal(""))
3432
// check volsync controller is ready
3533
fmt.Printf("waiting for volsync controller readiness")
3634
Eventually(IsDeploymentReady(ocClient, common.VolSyncDeploymentNamespace, common.VolSyncDeploymentName), timeoutMultiplier*time.Minute*10, time.Second*10).Should(BeTrue())
3735
Eventually(IsDeploymentReady(ocClient, namespace, common.DataMover), timeoutMultiplier*time.Minute*10, time.Second*10).Should(BeTrue())
38-
return appVerificationFunction(preBackupState, CSIDataMover)(ocClient, appNamespace)
36+
return veriFunc(ocClient, appNamespace)
3937
})
4038
}
4139

@@ -353,7 +351,7 @@ var _ = Describe("AWS backup restore tests", func() {
353351
PostRestoreVerify: mongoready(false, CSI),
354352
}, nil),
355353
Entry("MySQL application two Vol CSI", Label("ibmcloud", "aws", "gcp", "azure"), BackupRestoreCase{
356-
ApplicationTemplate: fmt.Sprintf("./sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml"),
354+
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml",
357355
ApplicationNamespace: "mysql-persistent",
358356
Name: "mysql-twovol-csi-e2e",
359357
BackupRestoreType: CSI,
@@ -381,17 +379,17 @@ var _ = Describe("AWS backup restore tests", func() {
381379
ApplicationNamespace: "mongo-persistent",
382380
Name: "mongo-datamover-e2e",
383381
BackupRestoreType: CSIDataMover,
384-
PreBackupVerify: dataMoverReady(true, mongoready),
385-
PostRestoreVerify: dataMoverReady(false, mongoready),
382+
PreBackupVerify: dataMoverReady(mongoready(true, CSIDataMover)),
383+
PostRestoreVerify: dataMoverReady(mongoready(false, CSIDataMover)),
386384
}, nil),
387385
// TODO: fix this test
388386
Entry("MySQL application DATAMOVER", BackupRestoreCase{
389-
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-csi.yaml",
387+
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml",
390388
ApplicationNamespace: "mysql-persistent",
391-
Name: "mysql-datamover-e2e",
389+
Name: "mysql-twovol-datamover-e2e",
392390
BackupRestoreType: CSIDataMover,
393-
PreBackupVerify: dataMoverReady(true, mysqlReady),
394-
PostRestoreVerify: dataMoverReady(false, mysqlReady),
391+
PreBackupVerify: dataMoverReady(mysqlReady(true, true, CSIDataMover)),
392+
PostRestoreVerify: dataMoverReady(mysqlReady(false, true, CSIDataMover)),
395393
}, nil),
396394
)
397395
})

0 commit comments

Comments
 (0)