Skip to content

Commit 56ca763

Browse files
committed
test: run all parametrized snapshot tests with mincore snapshots
Now that the test framework correctly differentiates between the need for rebase and the need for dirty page tracking, start running tests with mincore snapshots. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
1 parent c8b6dc0 commit 56ca763

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ def io_engine(request):
411411
return request.param
412412

413413

414-
@pytest.fixture(params=[SnapshotType.DIFF, SnapshotType.FULL])
414+
@pytest.fixture(
415+
params=[SnapshotType.DIFF, SnapshotType.DIFF_MINCORE, SnapshotType.FULL]
416+
)
415417
def snapshot_type(request):
416418
"""All possible snapshot types"""
417419
return request.param

tests/framework/microvm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class SnapshotType(Enum):
5151

5252
FULL = auto()
5353
DIFF = auto()
54+
DIFF_MINCORE = auto()
5455

5556
def __repr__(self):
5657
cls_name = self.__class__.__name__
@@ -59,7 +60,7 @@ def __repr__(self):
5960
@property
6061
def needs_rebase(self) -> bool:
6162
"""Does this snapshot type need rebasing on top of a base snapshot before restoration?"""
62-
return self == SnapshotType.DIFF
63+
return self in [SnapshotType.DIFF, SnapshotType.DIFF_MINCORE]
6364

6465
@property
6566
def needs_dirty_page_tracking(self) -> bool:
@@ -72,7 +73,7 @@ def api_type(self) -> str:
7273
match self:
7374
case SnapshotType.FULL:
7475
return "Full"
75-
case SnapshotType.DIFF:
76+
case SnapshotType.DIFF | SnapshotType.DIFF_MINCORE:
7677
return "Diff"
7778

7879

0 commit comments

Comments
 (0)