Skip to content

Commit

Permalink
fix(test): remove tests that are not relevant any more
Browse files Browse the repository at this point in the history
With the new snapshot format we break compatibility with all previous
snapshot format versions. This commits removes all the tests that were
checking functional correctness and performance of loading older
snapshots in the current Firecracker binary.

In the future, it might be that two Firecracker binaries support the
same snapshot versions. When that happens we should thing of a proper
way to test that this works, but the current tests are not fit for
purpose.

Signed-off-by: Babis Chalios <bchalios@amazon.es>
  • Loading branch information
bchalios committed Nov 10, 2023
1 parent 0e4a411 commit 948f6e0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 139 deletions.
34 changes: 0 additions & 34 deletions tests/integration_tests/functional/test_mmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,40 +610,6 @@ def test_mmds_snapshot(uvm_nano, microvm_factory, version):
)


def test_mmds_older_snapshot(
microvm_factory, guest_kernel, rootfs, firecracker_release
):
"""
Test MMDS behavior restoring older snapshots in the current version.
Ensures that the MMDS version is persisted or initialised with the default
if the FC version does not support this feature.
"""

# due to bug fixed in commit 8dab78b
firecracker_version = firecracker_release.version_tuple
if global_props.instance == "m6a.metal" and firecracker_version < (1, 3, 3):
pytest.skip("incompatible with AMD and Firecracker <1.3.3")

microvm = microvm_factory.build(
guest_kernel,
rootfs,
fc_binary_path=firecracker_release.path,
jailer_binary_path=firecracker_release.jailer,
)
microvm.spawn()
microvm.basic_config()
microvm.add_net_iface()

mmds_version = "V2"
_validate_mmds_snapshot(
microvm,
microvm_factory,
mmds_version,
*get_firecracker_binaries(),
)


def test_mmds_v2_negative(test_microvm_with_api):
"""
Test invalid MMDS GET/PUT requests when using V2.
Expand Down
39 changes: 0 additions & 39 deletions tests/integration_tests/functional/test_snapshot_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,6 @@
scratch_drives = ["vdb", "vdc", "vdd", "vde"]


def test_restore_old_to_current(
microvm_factory, guest_kernel, rootfs_ubuntu_22, firecracker_release
):
"""
Restore snapshots from previous supported versions of Firecracker.
For each firecracker release:
1. Snapshot with the past release
2. Restore with the current build
"""

# due to bug fixed in commit 8dab78b
firecracker_version = firecracker_release.version_tuple
if global_props.instance == "m6a.metal" and firecracker_version < (1, 3, 3):
pytest.skip("incompatible with AMD and Firecracker <1.3.3")

# Microvm: 2vCPU 256MB RAM, balloon, 4 disks and 4 net devices.
diff_snapshots = True
vm = microvm_factory.build(
guest_kernel,
rootfs_ubuntu_22,
fc_binary_path=firecracker_release.path,
jailer_binary_path=firecracker_release.jailer,
)
vm.spawn()
vm.basic_config(track_dirty_pages=True)
snapshot = create_snapshot_helper(
vm,
drives=scratch_drives,
diff_snapshots=diff_snapshots,
balloon=diff_snapshots,
)
vm = microvm_factory.build()
vm.spawn()
vm.restore_from_snapshot(snapshot, resume=True)
validate_all_devices(vm, diff_snapshots)
print(vm.log_data)


def validate_all_devices(microvm, balloon):
"""Perform a basic validation for all devices of a microvm."""
# Test that net devices have connectivity after restore.
Expand Down
66 changes: 0 additions & 66 deletions tests/integration_tests/performance/test_snapshot_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,72 +68,6 @@ def snapshot_resume_producer(microvm_factory, snapshot):
return value


@only_one_guest_kernel
def test_older_snapshot_resume_latency(
microvm_factory,
guest_kernel,
rootfs,
firecracker_release,
io_engine,
st_core,
):
"""
Test scenario: Older snapshot load performance measurement.
With each previous firecracker version, create a snapshot and try to
restore in current version.
"""

# due to bug fixed in commit 8dab78b
firecracker_version = firecracker_release.version_tuple
if global_props.instance == "m6a.metal" and firecracker_version < (1, 3, 3):
pytest.skip("incompatible with AMD and Firecracker <1.3.3")

vcpus, guest_mem_mib = 2, 512
microvm_cfg = f"{vcpus}vcpu_{guest_mem_mib}mb.json"
vm = microvm_factory.build(
guest_kernel,
rootfs,
monitor_memory=False,
fc_binary_path=firecracker_release.path,
jailer_binary_path=firecracker_release.jailer,
)
vm.spawn()
vm.basic_config(vcpu_count=vcpus, mem_size_mib=guest_mem_mib)
vm.add_net_iface()
vm.start()
# Check if guest works.
exit_code, _, _ = vm.ssh.run("ls")
assert exit_code == 0
snapshot = vm.snapshot_full()

st_core.name = "older_snapshot_resume_latency"
st_core.iterations = SAMPLE_COUNT
st_core.custom["guest_config"] = microvm_cfg.strip(".json")
st_core.custom["io_engine"] = io_engine
st_core.custom["snapshot_type"] = "FULL"

prod = producer.LambdaProducer(
func=snapshot_resume_producer,
func_kwargs={
"microvm_factory": microvm_factory,
"snapshot": snapshot,
},
)

cons = consumer.LambdaConsumer(
func=lambda cons, result: cons.consume_stat(
st_name="max", ms_name="latency", value=result
),
func_kwargs={},
)
cons.set_measurement_def(LATENCY_MEASUREMENT)

st_core.add_pipe(producer=prod, consumer=cons, tag=microvm_cfg)
# Gather results and verify pass criteria.
st_core.run_exercise()


@only_one_guest_kernel
def test_snapshot_create_latency(
microvm_factory,
Expand Down

0 comments on commit 948f6e0

Please sign in to comment.