Skip to content

Commit 29e6ea3

Browse files
author
Roman Sysoev
committed
test(vmrestore): skip all containers if critical error
Signed-off-by: Roman Sysoev <[email protected]>
1 parent 3495a08 commit 29e6ea3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/e2e/vm_restore_force_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ var _ = Describe("VirtualMachineRestoreForce", SIGRestoration(), ginkgoutil.Comm
4949
testCaseLabel = map[string]string{"testcase": "vm-restore-force"}
5050
additionalDiskLabel = map[string]string{"additionalDisk": "vm-restore-force"}
5151
originalVMNetworks map[string][]virtv2.NetworksStatus
52+
criticalError string
5253
)
5354

5455
BeforeAll(func() {
@@ -61,6 +62,9 @@ var _ = Describe("VirtualMachineRestoreForce", SIGRestoration(), ginkgoutil.Comm
6162
})
6263

6364
BeforeEach(func() {
65+
if criticalError != "" {
66+
Skip(criticalError)
67+
}
6468
ctx, cancel = context.WithCancel(context.Background())
6569
})
6670

@@ -255,7 +259,8 @@ var _ = Describe("VirtualMachineRestoreForce", SIGRestoration(), ginkgoutil.Comm
255259

256260
msg := "A virtual machine cannot be restored from the pending phase with `Forced` mode; you can delete the virtual machine and restore it with `Safe` mode."
257261
if vmRestoreObj.Status.Phase == virtv2.VirtualMachineRestorePhaseFailed && readyCondition.Message == msg {
258-
Skip("A bug has occurred with a virtual machine in the \"Pending\" phase.")
262+
criticalError = "A bug has occurred with a virtual machine in the \"Pending\" phase."
263+
Skip(criticalError)
259264
}
260265

261266
if vmRestoreObj.Status.Phase != virtv2.VirtualMachineRestorePhaseReady {

0 commit comments

Comments
 (0)