-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into vmgenid_x86_64
- Loading branch information
Showing
5 changed files
with
68 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/integration_tests/functional/test_dirty_pages_in_full_snapshot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
"""Test scenario for reseting dirty pages after making a full snapshot.""" | ||
|
||
|
||
def test_dirty_pages_after_full_snapshot(uvm_plain): | ||
""" | ||
Test if dirty pages are erased after making a full snapshot of a VM | ||
""" | ||
|
||
vm_mem_size = 128 | ||
uvm = uvm_plain | ||
uvm.spawn() | ||
uvm.basic_config(mem_size_mib=vm_mem_size, track_dirty_pages=True) | ||
uvm.add_net_iface() | ||
uvm.start() | ||
uvm.ssh.run("true") | ||
|
||
snap_full = uvm.snapshot_full(vmstate_path="vmstate_full", mem_path="mem_full") | ||
snap_diff = uvm.snapshot_diff(vmstate_path="vmstate_diff", mem_path="mem_diff") | ||
snap_diff2 = uvm.snapshot_diff(vmstate_path="vmstate_diff2", mem_path="mem_diff2") | ||
|
||
# file size is the same, but the `diff` snapshot is actually a sparse file | ||
assert snap_full.mem.stat().st_size == snap_diff.mem.stat().st_size | ||
|
||
# diff -> diff there should be no differences | ||
assert snap_diff2.mem.stat().st_blocks == 0 | ||
|
||
# full -> diff there should be no differences | ||
assert snap_diff.mem.stat().st_blocks == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters