From fa60d3e2cc80572c638051c5a0d7af827d27c549 Mon Sep 17 00:00:00 2001 From: Riccardo Mancini Date: Thu, 15 May 2025 15:10:53 +0100 Subject: [PATCH] test(pvtime): split pvtime tests into functional and performance The test contends one physical core to increase the steal time, but if many tests are run in parallel, they all start contending the same core. Move the tests to the performance folder so that they are run serially. Signed-off-by: Riccardo Mancini --- .../functional/test_pvtime.py | 27 +++++++++++++++++++ .../test_steal_time.py | 25 +---------------- 2 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 tests/integration_tests/functional/test_pvtime.py rename tests/integration_tests/{functional => performance}/test_steal_time.py (81%) diff --git a/tests/integration_tests/functional/test_pvtime.py b/tests/integration_tests/functional/test_pvtime.py new file mode 100644 index 00000000000..c71ae14a518 --- /dev/null +++ b/tests/integration_tests/functional/test_pvtime.py @@ -0,0 +1,27 @@ +# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Tests for verifying the PVTime device is enabled on aarch64.""" + +import pytest + +from framework.properties import global_props + + +@pytest.mark.skipif( + global_props.cpu_architecture != "aarch64", reason="Only run in aarch64" +) +def test_guest_has_pvtime_enabled(uvm_plain): + """ + Check that the guest kernel has enabled PV steal time. + """ + vm = uvm_plain + vm.spawn() + vm.basic_config() + vm.add_net_iface() + vm.start() + + _, stdout, _ = vm.ssh.run("dmesg | grep 'stolen time PV'") + assert ( + "stolen time PV" in stdout + ), "Guest kernel did not report PV steal time enabled" diff --git a/tests/integration_tests/functional/test_steal_time.py b/tests/integration_tests/performance/test_steal_time.py similarity index 81% rename from tests/integration_tests/functional/test_steal_time.py rename to tests/integration_tests/performance/test_steal_time.py index 8653cf3f8ec..a3bad923b3a 100644 --- a/tests/integration_tests/functional/test_steal_time.py +++ b/tests/integration_tests/performance/test_steal_time.py @@ -1,14 +1,10 @@ # Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -"""Tests for verifying the PVTime device behavior under contention and across snapshots.""" +"""Tests for verifying the steal time behavior under contention and across snapshots.""" import time -import pytest - -from framework.properties import global_props - def get_steal_time_ms(vm): """Returns total steal time of vCPUs in VM in milliseconds""" @@ -18,25 +14,6 @@ def get_steal_time_ms(vm): return steal_time_tck / clk_tck * 1000 -@pytest.mark.skipif( - global_props.cpu_architecture != "aarch64", reason="Only run in aarch64" -) -def test_guest_has_pvtime_enabled(uvm_plain): - """ - Check that the guest kernel has enabled PV steal time. - """ - vm = uvm_plain - vm.spawn() - vm.basic_config() - vm.add_net_iface() - vm.start() - - _, stdout, _ = vm.ssh.run("dmesg | grep 'stolen time PV'") - assert ( - "stolen time PV" in stdout - ), "Guest kernel did not report PV steal time enabled" - - def test_pvtime_steal_time_increases(uvm_plain): """ Test that PVTime steal time increases when both vCPUs are contended on the same pCPU.