Skip to content

Commit

Permalink
test: add a new, more complete boottime test
Browse files Browse the repository at this point in the history
Test with all supported guest kernels, and a few different guest
configurations.

In addition, boot 10 times instead of a single datapoint.

Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o committed Sep 11, 2023
1 parent 78ffb8a commit e29f7e6
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/integration_tests/performance/test_boottime.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,36 @@ def _configure_and_run_vm(microvm, network=False, initrd=False):
if network:
microvm.add_net_iface()
microvm.start()


@pytest.mark.parametrize(
"vcpu_count,mem_size_mib",
[(1, 128), (1, 1024), (2, 2024), (4, 4096)],
)
def test_boottime(
microvm_factory, guest_kernel, rootfs, vcpu_count, mem_size_mib, metrics
):
"""Test boot time with different guest configurations"""

metrics.set_dimensions(
{
**DIMENSIONS,
"guest_kernel": guest_kernel.name,
"vcpus": str(vcpu_count),
"mem_size_mib": str(mem_size_mib),
}
)

for _ in range(10):
vm = microvm_factory.build(guest_kernel, rootfs)
vm.jailer.extra_args.update({"boot-timer": None})
vm.spawn()
vm.basic_config(
vcpu_count=vcpu_count,
mem_size_mib=mem_size_mib,
boot_args=DEFAULT_BOOT_ARGS + " init=/usr/local/bin/init",
)
vm.add_net_iface()
vm.start()
boottime_us = _get_microvm_boottime(vm)
metrics.put_metric("boot_time", boottime_us, unit="Microseconds")

0 comments on commit e29f7e6

Please sign in to comment.