-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: integ test for being able to resnapshot dirty pages ater failure
After having a failure during snapshot we're trying to do it again and expect all the dirty pages to be snapshotted on the second attempt if it succeeds. Co-authored-by: Pablo Barbáchano <pablob@amazon.com> Signed-off-by: Roman Kovtyukh <HelloDearGrandma@gmail.com>
- Loading branch information
1 parent
61b8ff0
commit be5e263
Showing
2 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import subprocess | ||
import time | ||
from pathlib import Path | ||
|
||
|
||
def test_FC_DEV_1903(uvm_plain, microvm_factory): | ||
""" | ||
https://sim.amazon.com/issues/FC-DEV-1903 | ||
Make the test pass | ||
./tools/devtool test_debug integration_tests/test_FC-DEV-1903.py | ||
file:../../src/vmm/src/persist.rs::.dump_dirty(&mut file, &dirty_bitmap) | ||
Around here we would have to handle an error: | ||
file:../../src/vmm/src/vstate/memory.rs:285 | ||
""" | ||
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") | ||
|
||
chroot = Path(uvm.chroot()) | ||
|
||
# Create a large file, so we run out of space (ENOSPC) during the snapshot | ||
# Assumes a Docker /srv tmpfs of 1G, derived by trial and error | ||
fudge = chroot / "fudge" | ||
subprocess.check_call(f"fallocate -l 550M {fudge}", shell=True) | ||
|
||
try: | ||
uvm.snapshot_diff() | ||
except RuntimeError: | ||
msg = "No space left on device" | ||
uvm.check_log_message(msg) | ||
else: | ||
assert False, "This should fail" | ||
|
||
fudge.unlink() | ||
|
||
# Now there is enough space for it to work | ||
snap2 = uvm.snapshot_diff() | ||
|
||
vm2 = microvm_factory.build() | ||
vm2.spawn() | ||
vm2.restore_from_snapshot(snap2, resume=True) | ||
vm2.ssh.run("true") |
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