Skip to content

Commit 25480f4

Browse files
Manciukicbchalios
authored andcommitted
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 <[email protected]>
1 parent 880e146 commit 25480f4

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
"""Tests for verifying the PVTime device is enabled on aarch64."""
5+
6+
import pytest
7+
8+
from framework.properties import global_props
9+
10+
11+
@pytest.mark.skipif(
12+
global_props.cpu_architecture != "aarch64", reason="Only run in aarch64"
13+
)
14+
def test_guest_has_pvtime_enabled(uvm_plain):
15+
"""
16+
Check that the guest kernel has enabled PV steal time.
17+
"""
18+
vm = uvm_plain
19+
vm.spawn()
20+
vm.basic_config()
21+
vm.add_net_iface()
22+
vm.start()
23+
24+
_, stdout, _ = vm.ssh.run("dmesg | grep 'stolen time PV'")
25+
assert (
26+
"stolen time PV" in stdout
27+
), "Guest kernel did not report PV steal time enabled"

tests/integration_tests/functional/test_steal_time.py renamed to tests/integration_tests/performance/test_steal_time.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
"""Tests for verifying the PVTime device behavior under contention and across snapshots."""
4+
"""Tests for verifying the steal time behavior under contention and across snapshots."""
55

66
import time
77

8-
import pytest
9-
10-
from framework.properties import global_props
11-
128

139
def get_steal_time_ms(vm):
1410
"""Returns total steal time of vCPUs in VM in milliseconds"""
@@ -18,25 +14,6 @@ def get_steal_time_ms(vm):
1814
return steal_time_tck / clk_tck * 1000
1915

2016

21-
@pytest.mark.skipif(
22-
global_props.cpu_architecture != "aarch64", reason="Only run in aarch64"
23-
)
24-
def test_guest_has_pvtime_enabled(uvm_plain):
25-
"""
26-
Check that the guest kernel has enabled PV steal time.
27-
"""
28-
vm = uvm_plain
29-
vm.spawn()
30-
vm.basic_config()
31-
vm.add_net_iface()
32-
vm.start()
33-
34-
_, stdout, _ = vm.ssh.run("dmesg | grep 'stolen time PV'")
35-
assert (
36-
"stolen time PV" in stdout
37-
), "Guest kernel did not report PV steal time enabled"
38-
39-
4017
def test_pvtime_steal_time_increases(uvm_plain):
4118
"""
4219
Test that PVTime steal time increases when both vCPUs are contended on the same pCPU.

0 commit comments

Comments
 (0)