Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions tests/e2e/virt_backup_restore_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ func vmPoweredOff(vmnamespace, vmname string) VerificationFunction {

type VmBackupRestoreCase struct {
BackupRestoreCase
Template string
InitDelay time.Duration
PowerState string
Template string
InitDelay time.Duration
StartupTimeout time.Duration
PowerState string
}

func runVmBackupAndRestore(brCase VmBackupRestoreCase, updateLastBRcase func(brCase VmBackupRestoreCase), v *lib.VirtOperator) {
Expand All @@ -98,7 +99,11 @@ func runVmBackupAndRestore(brCase VmBackupRestoreCase, updateLastBRcase func(brC
// Wait for VM to start, then give some time for cloud-init to run.
// Afterward, run through the standard application verification to make sure
// the application itself is working correctly.
err = wait.PollUntilContextTimeout(context.Background(), 10*time.Second, 10*time.Minute, true, func(ctx context.Context) (bool, error) {
startupTimeout := brCase.StartupTimeout
if startupTimeout == 0 {
startupTimeout = 10 * time.Minute
}
err = wait.PollUntilContextTimeout(context.Background(), 10*time.Second, startupTimeout, true, func(ctx context.Context) (bool, error) {
status, err := v.GetVmStatus(brCase.Namespace, brCase.Name)
return status == "Running", err
})
Expand Down Expand Up @@ -349,8 +354,9 @@ var _ = ginkgo.Describe("VM backup and restore tests", ginkgo.Ordered, func() {
}, nil),

ginkgo.Entry("todolist CSI backup and restore, in a Fedora VM", ginkgo.Label("virt"), VmBackupRestoreCase{
Template: "./sample-applications/virtual-machines/fedora-todolist/fedora-todolist.yaml",
InitDelay: 3 * time.Minute, // For cloud-init
Template: "./sample-applications/virtual-machines/fedora-todolist/fedora-todolist.yaml",
InitDelay: 3 * time.Minute, // For cloud-init
StartupTimeout: 20 * time.Minute,
BackupRestoreCase: BackupRestoreCase{
Namespace: "mysql-persistent",
Name: "fedora-todolist",
Expand Down