forked from mgencur/oadp-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup_restore_suite_test.go
More file actions
458 lines (396 loc) · 19.9 KB
/
backup_restore_suite_test.go
File metadata and controls
458 lines (396 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
package e2e_test
import (
"fmt"
"log"
"os"
"strings"
"time"
"github.com/google/uuid"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/openshift/oadp-operator/tests/e2e/lib"
)
type VerificationFunction func(client.Client, string) error
type BackupRestoreCase struct {
Namespace string
Name string
BackupRestoreType lib.BackupRestoreType
PreBackupVerify VerificationFunction
PostRestoreVerify VerificationFunction
SkipVerifyLogs bool // TODO remove
BackupTimeout time.Duration
}
type ApplicationBackupRestoreCase struct {
BackupRestoreCase
ApplicationTemplate string
PvcSuffixName string
}
func todoListReady(preBackupState bool, twoVol bool, database 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())
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
}
err = lib.VerifyBackupRestoreData(runTimeClientForSuiteRun, kubernetesClientForSuiteRun, kubeConfig, artifact_dir, namespace, "todolist-route", "todolist", "todolist", preBackupState, twoVol)
return err
})
}
func waitOADPReadiness(backupRestoreType lib.BackupRestoreType) {
err := dpaCR.CreateOrUpdate(dpaCR.Build(backupRestoreType))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
log.Print("Checking if DPA is reconciled")
gomega.Eventually(dpaCR.IsReconciledTrue(), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
log.Printf("Waiting for Velero Pod to be running")
gomega.Eventually(lib.VeleroPodIsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
if backupRestoreType == lib.RESTIC || backupRestoreType == lib.KOPIA || backupRestoreType == lib.CSIDataMover {
log.Printf("Waiting for Node Agent pods to be running")
gomega.Eventually(lib.AreNodeAgentPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
}
// Velero does not change status of VSL objects. Users can only confirm if VSLs are correct configured when running a native snapshot backup/restore
log.Print("Checking if BSL is available")
gomega.Eventually(dpaCR.BSLsAreAvailable(), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
}
func prepareBackupAndRestore(brCase BackupRestoreCase, updateLastInstallTime func()) (string, string) {
updateLastInstallTime()
waitOADPReadiness(brCase.BackupRestoreType)
if brCase.BackupRestoreType == lib.CSI || brCase.BackupRestoreType == lib.CSIDataMover {
if provider == "aws" || provider == "ibmcloud" || provider == "gcp" || provider == "azure" || provider == "openstack" {
log.Printf("Creating VolumeSnapshotClass for CSI backuprestore of %s", brCase.Name)
snapshotClassPath := fmt.Sprintf("./sample-applications/snapclass-csi/%s.yaml", provider)
err := lib.InstallApplication(dpaCR.Client, snapshotClassPath)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
}
// TODO: check registry deployments are deleted
// TODO: check S3 for images
backupUid, _ := uuid.NewUUID()
restoreUid, _ := uuid.NewUUID()
backupName := fmt.Sprintf("%s-%s", brCase.Name, backupUid.String())
restoreName := fmt.Sprintf("%s-%s", brCase.Name, restoreUid.String())
return backupName, restoreName
}
func runApplicationBackupAndRestore(brCase ApplicationBackupRestoreCase, updateLastBRcase func(brCase ApplicationBackupRestoreCase), updateLastInstallTime func()) {
updateLastBRcase(brCase)
// create DPA
backupName, restoreName := prepareBackupAndRestore(brCase.BackupRestoreCase, updateLastInstallTime)
// Ensure that an existing backup repository is deleted
brerr := lib.DeleteBackupRepositories(runTimeClientForSuiteRun, namespace)
gomega.Expect(brerr).ToNot(gomega.HaveOccurred())
// install app
updateLastInstallTime()
log.Printf("Installing application for case %s", brCase.Name)
err := lib.InstallApplication(dpaCR.Client, brCase.ApplicationTemplate)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
if brCase.BackupRestoreType == lib.CSI || brCase.BackupRestoreType == lib.CSIDataMover {
log.Printf("Creating pvc for case %s", brCase.Name)
var pvcName string
var pvcPath string
pvcName = provider
if brCase.PvcSuffixName != "" {
pvcName += brCase.PvcSuffixName
}
pvcPathFormat := "./sample-applications/%s/pvc/%s.yaml"
if strings.Contains(brCase.Name, "twovol") {
pvcPathFormat = "./sample-applications/%s/pvc-twoVol/%s.yaml"
}
pvcPath = fmt.Sprintf(pvcPathFormat, brCase.Namespace, pvcName)
err = lib.InstallApplication(dpaCR.Client, pvcPath)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
// Run optional custom verification
if brCase.PreBackupVerify != nil {
log.Printf("Running pre-backup custom function for case %s", brCase.Name)
err := brCase.PreBackupVerify(dpaCR.Client, brCase.Namespace)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
// do the backup for real
nsRequiredResticDCWorkaround := runBackup(brCase.BackupRestoreCase, backupName)
// uninstall app
log.Printf("Uninstalling app for case %s", brCase.Name)
err = lib.UninstallApplication(dpaCR.Client, brCase.ApplicationTemplate)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
// Wait for namespace to be deleted
gomega.Eventually(lib.IsNamespaceDeleted(kubernetesClientForSuiteRun, brCase.Namespace), time.Minute*4, time.Second*5).Should(gomega.BeTrue())
updateLastInstallTime()
// run restore
runRestore(brCase.BackupRestoreCase, backupName, restoreName, nsRequiredResticDCWorkaround)
// Run optional custom verification
if brCase.PostRestoreVerify != nil {
log.Printf("Running post-restore custom function for case %s", brCase.Name)
err = brCase.PostRestoreVerify(dpaCR.Client, brCase.Namespace)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
}
func runBackup(brCase BackupRestoreCase, backupName string) bool {
nsRequiresResticDCWorkaround, err := lib.NamespaceRequiresResticDCWorkaround(dpaCR.Client, brCase.Namespace)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
if strings.Contains(brCase.Name, "twovol") {
volumeSyncDelay := 30 * time.Second
log.Printf("Sleeping for %v to allow volume to be in sync with /tmp/log/ for case %s", volumeSyncDelay, brCase.Name)
// TODO this should be a function, not an arbitrary sleep
time.Sleep(volumeSyncDelay)
}
// create backup
log.Printf("Creating backup %s for case %s", backupName, brCase.Name)
err = lib.CreateBackupForNamespaces(dpaCR.Client, namespace, backupName, []string{brCase.Namespace}, brCase.BackupRestoreType == lib.RESTIC || brCase.BackupRestoreType == lib.KOPIA, brCase.BackupRestoreType == lib.CSIDataMover)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
// wait for backup to not be running
gomega.Eventually(lib.IsBackupDone(dpaCR.Client, namespace, backupName), brCase.BackupTimeout, time.Second*10).Should(gomega.BeTrue())
// TODO only log on fail?
describeBackup := lib.DescribeBackup(dpaCR.Client, namespace, backupName)
ginkgo.GinkgoWriter.Println(describeBackup)
backupLogs := lib.BackupLogs(kubernetesClientForSuiteRun, dpaCR.Client, namespace, backupName)
backupErrorLogs := lib.BackupErrorLogs(kubernetesClientForSuiteRun, dpaCR.Client, namespace, backupName)
accumulatedTestLogs = append(accumulatedTestLogs, describeBackup, backupLogs)
if !brCase.SkipVerifyLogs {
gomega.Expect(backupErrorLogs).Should(gomega.Equal([]string{}))
}
// check if backup succeeded
succeeded, err := lib.IsBackupCompletedSuccessfully(kubernetesClientForSuiteRun, dpaCR.Client, namespace, backupName)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
gomega.Expect(succeeded).To(gomega.Equal(true))
log.Printf("Backup for case %s succeeded", brCase.Name)
return nsRequiresResticDCWorkaround
}
func runRestore(brCase BackupRestoreCase, backupName, restoreName string, nsRequiresResticDCWorkaround bool) {
log.Printf("Creating restore %s for case %s", restoreName, brCase.Name)
err := lib.CreateRestoreFromBackup(dpaCR.Client, namespace, backupName, restoreName)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
gomega.Eventually(lib.IsRestoreDone(dpaCR.Client, namespace, restoreName), time.Minute*60, time.Second*10).Should(gomega.BeTrue())
// TODO only log on fail?
describeRestore := lib.DescribeRestore(dpaCR.Client, namespace, restoreName)
ginkgo.GinkgoWriter.Println(describeRestore)
restoreLogs := lib.RestoreLogs(kubernetesClientForSuiteRun, dpaCR.Client, namespace, restoreName)
restoreErrorLogs := lib.RestoreErrorLogs(kubernetesClientForSuiteRun, dpaCR.Client, namespace, restoreName)
accumulatedTestLogs = append(accumulatedTestLogs, describeRestore, restoreLogs)
if !brCase.SkipVerifyLogs {
gomega.Expect(restoreErrorLogs).Should(gomega.Equal([]string{}))
}
// Check if restore succeeded
succeeded, err := lib.IsRestoreCompletedSuccessfully(kubernetesClientForSuiteRun, dpaCR.Client, namespace, restoreName)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
gomega.Expect(succeeded).To(gomega.Equal(true))
if nsRequiresResticDCWorkaround {
// We run the dc-post-restore.sh script for both restic and
// kopia backups and for any DCs with attached volumes,
// regardless of whether it was restic or kopia backup.
// The script is designed to work with labels set by the
// openshift-velero-plugin and can be run without pre-conditions.
log.Printf("Running dc-post-restore.sh script.")
err = lib.RunDcPostRestoreScript(restoreName)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
}
func getFailedTestLogs(oadpNamespace string, appNamespace string, installTime time.Time, report ginkgo.SpecReport) {
baseReportDir := artifact_dir + "/" + report.LeafNodeText
err := os.MkdirAll(baseReportDir, 0755)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
log.Println("Printing OADP namespace events")
lib.PrintNamespaceEventsAfterTime(kubernetesClientForSuiteRun, oadpNamespace, installTime)
err = lib.SavePodLogs(kubernetesClientForSuiteRun, oadpNamespace, baseReportDir)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if appNamespace != "" {
log.Println("Printing app namespace events")
lib.PrintNamespaceEventsAfterTime(kubernetesClientForSuiteRun, appNamespace, installTime)
err = lib.SavePodLogs(kubernetesClientForSuiteRun, appNamespace, baseReportDir)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}
func tearDownBackupAndRestore(brCase BackupRestoreCase, installTime time.Time, report ginkgo.SpecReport) {
log.Println("Post backup and restore state: ", report.State.String())
if report.Failed() {
knownFlake = lib.CheckIfFlakeOccurred(accumulatedTestLogs)
accumulatedTestLogs = nil
getFailedTestLogs(namespace, brCase.Namespace, installTime, report)
}
if brCase.BackupRestoreType == lib.CSI || brCase.BackupRestoreType == lib.CSIDataMover {
log.Printf("Deleting VolumeSnapshot for CSI backuprestore of %s", brCase.Name)
snapshotClassPath := fmt.Sprintf("./sample-applications/snapclass-csi/%s.yaml", provider)
err := lib.UninstallApplication(dpaCR.Client, snapshotClassPath)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
err := dpaCR.Delete()
gomega.Expect(err).ToNot(gomega.HaveOccurred())
err = lib.DeleteNamespace(kubernetesClientForSuiteRun, brCase.Namespace)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
gomega.Eventually(lib.IsNamespaceDeleted(kubernetesClientForSuiteRun, brCase.Namespace), time.Minute*5, time.Second*5).Should(gomega.BeTrue())
}
var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() {
var lastBRCase ApplicationBackupRestoreCase
var lastInstallTime time.Time
updateLastBRcase := func(brCase ApplicationBackupRestoreCase) {
lastBRCase = brCase
}
updateLastInstallTime := func() {
lastInstallTime = time.Now()
}
var _ = ginkgo.AfterEach(func(ctx ginkgo.SpecContext) {
tearDownBackupAndRestore(lastBRCase.BackupRestoreCase, lastInstallTime, ctx.SpecReport())
})
var _ = ginkgo.AfterAll(func() {
// DPA just needs to have BSL so gathering of backups/restores logs/describe work
// using kopia to collect more info (DaemonSet)
waitOADPReadiness(lib.KOPIA)
log.Printf("Creating real DataProtectionTest before must-gather")
bsls, err := dpaCR.ListBSLs()
gomega.Expect(err).ToNot(gomega.HaveOccurred())
bslName := bsls.Items[0].Name
err = lib.CreateUploadTestOnlyDPT(dpaCR.Client, dpaCR.Namespace, bslName)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
log.Printf("skipMustGather: %v", skipMustGather)
if !skipMustGather {
log.Printf("Running OADP must-gather")
err = lib.RunMustGather(artifact_dir, dpaCR.Client)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
err = dpaCR.Delete()
gomega.Expect(err).ToNot(gomega.HaveOccurred())
})
ginkgo.DescribeTable("Backup and restore applications",
func(brCase ApplicationBackupRestoreCase, expectedErr error) {
if ginkgo.CurrentSpecReport().NumAttempts > 1 && !knownFlake {
ginkgo.Fail("No known FLAKE found in a previous run, marking test as failed.")
}
runApplicationBackupAndRestore(brCase, updateLastBRcase, updateLastInstallTime)
},
ginkgo.Entry("MySQL application CSI", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-csi.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mysql-persistent",
Name: "mysql-csi-e2e",
BackupRestoreType: lib.CSI,
PreBackupVerify: todoListReady(true, false, "mysql"),
PostRestoreVerify: todoListReady(false, false, "mysql"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("Mongo application CSI", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-csi.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mongo-persistent",
Name: "mongo-csi-e2e",
BackupRestoreType: lib.CSI,
PreBackupVerify: todoListReady(true, false, "mongo"),
PostRestoreVerify: todoListReady(false, false, "mongo"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("MySQL application two Vol CSI", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-twovol-csi.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mysql-persistent",
Name: "mysql-twovol-csi-e2e",
BackupRestoreType: lib.CSI,
PreBackupVerify: todoListReady(true, true, "mysql"),
PostRestoreVerify: todoListReady(false, true, "mysql"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("Mongo application RESTIC", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mongo-persistent",
Name: "mongo-restic-e2e",
BackupRestoreType: lib.RESTIC,
PreBackupVerify: todoListReady(true, false, "mongo"),
PostRestoreVerify: todoListReady(false, false, "mongo"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("MySQL application RESTIC", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mysql-persistent",
Name: "mysql-restic-e2e",
BackupRestoreType: lib.RESTIC,
PreBackupVerify: todoListReady(true, false, "mysql"),
PostRestoreVerify: todoListReady(false, false, "mysql"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("Mongo application KOPIA", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mongo-persistent",
Name: "mongo-kopia-e2e",
BackupRestoreType: lib.KOPIA,
PreBackupVerify: todoListReady(true, false, "mongo"),
PostRestoreVerify: todoListReady(false, false, "mongo"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("MySQL application KOPIA", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mysql-persistent",
Name: "mysql-kopia-e2e",
BackupRestoreType: lib.KOPIA,
PreBackupVerify: todoListReady(true, false, "mysql"),
PostRestoreVerify: todoListReady(false, false, "mysql"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("Mongo application DATAMOVER", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-csi.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mongo-persistent",
Name: "mongo-datamover-e2e",
BackupRestoreType: lib.CSIDataMover,
PreBackupVerify: todoListReady(true, false, "mongo"),
PostRestoreVerify: todoListReady(false, false, "mongo"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("MySQL application DATAMOVER", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent-csi.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mysql-persistent",
Name: "mysql-datamover-e2e",
BackupRestoreType: lib.CSIDataMover,
PreBackupVerify: todoListReady(true, false, "mysql"),
PostRestoreVerify: todoListReady(false, false, "mysql"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("Mongo application BlockDevice DATAMOVER", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-block.yaml",
PvcSuffixName: "-block-mode",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mongo-persistent",
Name: "mongo-blockdevice-e2e",
BackupRestoreType: lib.CSIDataMover,
PreBackupVerify: todoListReady(true, false, "mongo"),
PostRestoreVerify: todoListReady(false, false, "mongo"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("MySQL application Native-Snapshots", ginkgo.FlakeAttempts(flakeAttempts), ginkgo.Label("aws", "azure", "gcp"), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mysql-persistent/mysql-persistent.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mysql-persistent",
Name: "mysql-native-snapshots-e2e",
BackupRestoreType: lib.NativeSnapshots,
PreBackupVerify: todoListReady(true, false, "mysql"),
PostRestoreVerify: todoListReady(false, false, "mysql"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
ginkgo.Entry("Mongo application Native-Snapshots", ginkgo.FlakeAttempts(flakeAttempts), ginkgo.Label("aws", "azure", "gcp"), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mongo-persistent",
Name: "mongo-native-snapshots-e2e",
BackupRestoreType: lib.NativeSnapshots,
PreBackupVerify: todoListReady(true, false, "mongo"),
PostRestoreVerify: todoListReady(false, false, "mongo"),
BackupTimeout: 20 * time.Minute,
},
}, nil),
)
})