Skip to content

Commit deb9adc

Browse files
committed
fix(test): clean up some open coded == SnapshotType.DIFF comparisons
Have them use the correct needs_rebase/needs_dirty_tracking helpers instead. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
1 parent d76e25f commit deb9adc

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tests/integration_tests/functional/test_snapshot_basic.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import host_tools.drive as drive_tools
2020
import host_tools.network as net_tools
2121
from framework import utils
22-
from framework.microvm import SnapshotType
2322
from framework.properties import global_props
2423
from framework.utils import check_filesystem, check_output
2524
from framework.utils_vsock import (
@@ -132,14 +131,13 @@ def test_cycled_snapshot_restore(
132131
cycles = 3
133132

134133
logger = logging.getLogger("snapshot_sequence")
135-
diff_snapshots = snapshot_type == SnapshotType.DIFF
136134

137135
vm = microvm_factory.build(guest_kernel, rootfs)
138136
vm.spawn()
139137
vm.basic_config(
140138
vcpu_count=2,
141139
mem_size_mib=512,
142-
track_dirty_pages=diff_snapshots,
140+
track_dirty_pages=snapshot_type.needs_dirty_page_tracking,
143141
)
144142
vm.set_cpu_template(cpu_template_any)
145143
vm.add_net_iface()

tests/integration_tests/performance/test_snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212

1313
import host_tools.drive as drive_tools
14-
from framework.microvm import HugePagesConfig, Microvm, SnapshotType
14+
from framework.microvm import HugePagesConfig, Microvm
1515

1616
USEC_IN_MSEC = 1000
1717
NS_IN_MSEC = 1_000_000
@@ -266,7 +266,7 @@ def test_snapshot_create_latency(
266266
vm.basic_config(
267267
vcpu_count=2,
268268
mem_size_mib=512,
269-
track_dirty_pages=snapshot_type == SnapshotType.DIFF,
269+
track_dirty_pages=snapshot_type.needs_dirty_page_tracking,
270270
)
271271
vm.start()
272272
vm.pin_threads(0)

0 commit comments

Comments
 (0)