-
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.
Signed-off-by: Pablo Barbáchano <pablob@amazon.com> Signed-off-by: Roman Kovtyukh <HelloDearGrandma@gmail.com>
- Loading branch information
1 parent
2043ebf
commit 41ac44d
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