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 Jan 12, 2024
1 parent 603d6d5 commit 74b29f1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 272 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 @@ -10,7 +10,6 @@
import pytest

from framework.artifacts import working_version_as_artifact
from framework.properties import global_props
from framework.utils import (
configure_mmds,
generate_mmds_get_request,
Expand Down Expand Up @@ -612,39 +611,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,
)


def test_mmds_v2_negative(test_microvm_with_api):
"""
Test invalid MMDS GET/PUT requests when using V2.
Expand Down
156 changes: 0 additions & 156 deletions tests/integration_tests/functional/test_snapshot_advanced.py

This file was deleted.

82 changes: 0 additions & 82 deletions tests/integration_tests/performance/test_snapshot_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
"""Basic tests scenarios for snapshot save/restore."""

import pytest

from framework.properties import global_props

# How many latencies do we sample per test.
SAMPLE_COUNT = 3
USEC_IN_MSEC = 1000
Expand All @@ -23,84 +19,6 @@ def snapshot_create_producer(vm):
return value


def snapshot_resume_producer(microvm_factory, snapshot):
"""Produce results for snapshot resume tests."""

microvm = microvm_factory.build()
microvm.spawn()
microvm.restore_from_snapshot(snapshot, resume=True)

# Attempt to connect to resumed microvm.
# Verify if guest can run commands.
exit_code, _, _ = microvm.ssh.run("ls")
assert exit_code == 0

value = 0
# Parse all metric data points in search of load_snapshot time.
metrics = microvm.get_all_metrics()
for data_point in metrics:
cur_value = data_point["latencies_us"]["load_snapshot"] / USEC_IN_MSEC
if cur_value > 0:
value = cur_value
break

print("Latency {value} ms")
return value


def test_older_snapshot_resume_latency(
microvm_factory,
guest_kernel_linux_4_14,
rootfs,
firecracker_release,
io_engine,
metrics,
):
"""
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")

vm = microvm_factory.build(
guest_kernel_linux_4_14,
rootfs,
monitor_memory=False,
fc_binary_path=firecracker_release.path,
jailer_binary_path=firecracker_release.jailer,
)
vm.spawn()
vm.basic_config(vcpu_count=2, mem_size_mib=512)
vm.add_net_iface()
vm.start()
# Check if guest works.
exit_code, _, _ = vm.ssh.run("ls")
assert exit_code == 0
snapshot = vm.snapshot_full()

metrics.set_dimensions(
{
**vm.dimensions,
"io_engine": io_engine,
"performance_test": "test_older_snapshot_resume_latency",
"firecracker_version": firecracker_release.name,
}
)

for _ in range(SAMPLE_COUNT):
metrics.put_metric(
"latency",
snapshot_resume_producer(microvm_factory, snapshot),
"Milliseconds",
)


def test_snapshot_create_latency(
microvm_factory,
guest_kernel_linux_4_14,
Expand Down

0 comments on commit 74b29f1

Please sign in to comment.