Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/integration_tests/functional/test_balloon.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,11 @@ def test_stats_update(uvm_plain_any):
assert next_stats["available_memory"] != final_stats["available_memory"]


def test_balloon_snapshot(microvm_factory, guest_kernel, rootfs):
def test_balloon_snapshot(uvm_plain_any, microvm_factory):
"""
Test that the balloon works after pause/resume.
"""
vm = microvm_factory.build(guest_kernel, rootfs)
vm = uvm_plain_any
vm.spawn()
vm.basic_config(
vcpu_count=2,
Expand Down Expand Up @@ -531,11 +531,11 @@ def test_balloon_snapshot(microvm_factory, guest_kernel, rootfs):
assert stats_after_snap["available_memory"] > latest_stats["available_memory"]


def test_memory_scrub(microvm_factory, guest_kernel, rootfs):
def test_memory_scrub(uvm_plain_any):
"""
Test that the memory is zeroed after deflate.
"""
microvm = microvm_factory.build(guest_kernel, rootfs)
microvm = uvm_plain_any
microvm.spawn()
microvm.basic_config(vcpu_count=2, mem_size_mib=256)
microvm.add_net_iface()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ def get_guest_msrs(microvm, msr_index_list):
),
)
def test_cpu_config_dump_vs_actual(
microvm_factory,
guest_kernel,
rootfs,
uvm_plain_any,
cpu_template_helper,
tmp_path,
):
Expand All @@ -277,7 +275,7 @@ def test_cpu_config_dump_vs_actual(
dump_cpu_config = build_cpu_config_dict(cpu_config_path)

# Retrieve actual CPU config from guest
microvm = microvm_factory.build(guest_kernel, rootfs)
microvm = uvm_plain_any
microvm.spawn()
microvm.basic_config(vcpu_count=1)
microvm.add_net_iface()
Expand Down
9 changes: 2 additions & 7 deletions tests/integration_tests/functional/test_feat_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,11 @@ def inst_set_cpu_template_fxt(request):


@pytest.fixture(name="vm")
def vm_fxt(
microvm_factory,
inst_set_cpu_template,
guest_kernel,
rootfs,
):
def vm_fxt(uvm_plain_any, inst_set_cpu_template):
"""
Create a VM, using the normal CPU templates
"""
vm = microvm_factory.build(guest_kernel, rootfs)
vm = uvm_plain_any
vm.spawn()
vm.basic_config(vcpu_count=1, mem_size_mib=1024, cpu_template=inst_set_cpu_template)
vm.add_net_iface()
Expand Down
17 changes: 8 additions & 9 deletions tests/integration_tests/functional/test_snapshot_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ def test_snapshot_current_version(uvm_nano):
def test_cycled_snapshot_restore(
bin_vsock_path,
tmp_path,
uvm_plain_any,
microvm_factory,
guest_kernel,
rootfs,
snapshot_type,
use_snapshot_editor,
cpu_template_any,
Expand All @@ -133,7 +132,7 @@ def test_cycled_snapshot_restore(
logger = logging.getLogger("snapshot_sequence")
diff_snapshots = snapshot_type == SnapshotType.DIFF

vm = microvm_factory.build(guest_kernel, rootfs)
vm = uvm_plain_any
vm.spawn()
vm.basic_config(
vcpu_count=2,
Expand Down Expand Up @@ -249,7 +248,7 @@ def test_load_snapshot_failure_handling(uvm_plain):
vm.mark_killed()


def test_cmp_full_and_first_diff_mem(microvm_factory, guest_kernel, rootfs):
def test_cmp_full_and_first_diff_mem(uvm_plain_any):
"""
Compare memory of 2 consecutive full and diff snapshots.

Expand All @@ -260,7 +259,7 @@ def test_cmp_full_and_first_diff_mem(microvm_factory, guest_kernel, rootfs):
"""
logger = logging.getLogger("snapshot_sequence")

vm = microvm_factory.build(guest_kernel, rootfs)
vm = uvm_plain_any
vm.spawn()
vm.basic_config(
vcpu_count=2,
Expand Down Expand Up @@ -430,12 +429,12 @@ def test_create_large_diff_snapshot(uvm_plain):
# process would have been taken down.


def test_diff_snapshot_overlay(guest_kernel, rootfs, microvm_factory):
def test_diff_snapshot_overlay(uvm_plain_any, microvm_factory):
"""
Tests that if we take a diff snapshot and direct firecracker to write it on
top of an existing snapshot file, it will successfully merge them.
"""
basevm = microvm_factory.build(guest_kernel, rootfs)
basevm = uvm_plain_any
basevm.spawn()
basevm.basic_config(track_dirty_pages=True)
basevm.add_net_iface()
Expand Down Expand Up @@ -467,15 +466,15 @@ def test_diff_snapshot_overlay(guest_kernel, rootfs, microvm_factory):
# Check that the restored VM works


def test_snapshot_overwrite_self(guest_kernel, rootfs, microvm_factory):
def test_snapshot_overwrite_self(uvm_plain_any, microvm_factory):
"""Tests that if we try to take a snapshot that would overwrite the
very file from which the current VM is stored, nothing happens.

Note that even though we map the file as MAP_PRIVATE, the documentation
of mmap does not specify what should happen if the file is changed after being
mmap'd (https://man7.org/linux/man-pages/man2/mmap.2.html). It seems that
these changes can propagate to the mmap'd memory region."""
base_vm = microvm_factory.build(guest_kernel, rootfs)
base_vm = uvm_plain_any
base_vm.spawn()
base_vm.basic_config()
base_vm.add_net_iface()
Expand Down
9 changes: 4 additions & 5 deletions tests/integration_tests/performance/test_huge_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def test_hugetlbfs_boot(uvm_plain):
)


def test_hugetlbfs_snapshot(microvm_factory, guest_kernel_linux_5_10, rootfs):
def test_hugetlbfs_snapshot(microvm_factory, uvm_plain):
"""
Test hugetlbfs snapshot restore via uffd
"""

### Create Snapshot ###
vm = microvm_factory.build(guest_kernel_linux_5_10, rootfs)
vm = uvm_plain
vm.memory_monitor = None
vm.spawn()
vm.basic_config(huge_pages=HugePagesConfig.HUGETLBFS_2MB, mem_size_mib=128)
Expand Down Expand Up @@ -138,8 +138,7 @@ def test_hugetlbfs_diff_snapshot(microvm_factory, uvm_plain):
@pytest.mark.parametrize("huge_pages", HugePagesConfig)
def test_ept_violation_count(
microvm_factory,
guest_kernel_linux_5_10,
rootfs,
uvm_plain,
metrics,
huge_pages,
):
Expand All @@ -149,7 +148,7 @@ def test_ept_violation_count(
"""

### Create Snapshot ###
vm = microvm_factory.build(guest_kernel_linux_5_10, rootfs)
vm = uvm_plain
vm.memory_monitor = None
vm.spawn()
vm.basic_config(huge_pages=huge_pages, mem_size_mib=256)
Expand Down
6 changes: 2 additions & 4 deletions tests/integration_tests/performance/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,13 @@ def test_population_latency(

@pytest.mark.nonci
def test_snapshot_create_latency(
microvm_factory,
guest_kernel_linux_5_10,
rootfs,
uvm_plain,
metrics,
snapshot_type,
):
"""Measure the latency of creating a Full snapshot"""

vm = microvm_factory.build(guest_kernel_linux_5_10, rootfs, monitor_memory=False)
vm = uvm_plain
vm.spawn()
vm.basic_config(
vcpu_count=2,
Expand Down