Skip to content

Commit e2b2944

Browse files
committed
test: introduce snapshot_type fixture
We have a few tests that are parametrized to run with both full and diff snapshots enabled, so let's move this into a fixture. Signed-off-by: Patrick Roy <[email protected]>
1 parent 27fc9ed commit e2b2944

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from framework import defs, utils
3535
from framework.artifacts import disks, kernel_params
3636
from framework.defs import DEFAULT_BINARY_DIR
37-
from framework.microvm import MicroVMFactory
37+
from framework.microvm import MicroVMFactory, SnapshotType
3838
from framework.properties import global_props
3939
from framework.utils_cpu_templates import (
4040
custom_cpu_templates_params,
@@ -411,6 +411,12 @@ def io_engine(request):
411411
return request.param
412412

413413

414+
@pytest.fixture(params=[SnapshotType.DIFF, SnapshotType.FULL])
415+
def snapshot_type(request):
416+
"""All possible snapshot types"""
417+
return request.param
418+
419+
414420
@pytest.fixture
415421
def results_dir(request, pytestconfig):
416422
"""

tests/integration_tests/functional/test_snapshot_basic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def test_snapshot_current_version(uvm_nano):
111111
# - Rootfs: Ubuntu 18.04
112112
# - Microvm: 2vCPU with 512 MB RAM
113113
# TODO: Multiple microvm sizes must be tested in the async pipeline.
114-
@pytest.mark.parametrize("snapshot_type", [SnapshotType.DIFF, SnapshotType.FULL])
115114
@pytest.mark.parametrize("use_snapshot_editor", [False, True])
116115
def test_cycled_snapshot_restore(
117116
bin_vsock_path,
@@ -500,7 +499,6 @@ def test_snapshot_overwrite_self(guest_kernel, rootfs, microvm_factory):
500499
# restored, with a new snapshot of this vm, does not break the VM
501500

502501

503-
@pytest.mark.parametrize("snapshot_type", [SnapshotType.DIFF, SnapshotType.FULL])
504502
def test_vmgenid(guest_kernel_linux_6_1, rootfs, microvm_factory, snapshot_type):
505503
"""
506504
Test VMGenID device upon snapshot resume

0 commit comments

Comments
 (0)