Skip to content

Commit 561068a

Browse files
committed
fix: fail physical counter test if phy counter reg isn't in snapshot
Right now the test would pass on stock AL kernels, because without the commits from 6.4 [1] backported the CNTPCT_EL0 register won't even be included in the snapshot, and thus the assert is never reached. Fix this by failing the test if the register isnt found. [1]: https://lore.kernel.org/all/[email protected]/ Fixes: 525e686 Signed-off-by: Patrick Roy <[email protected]>
1 parent 0975cd4 commit 561068a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/integration_tests/functional/test_snapshot_basic.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def test_vmgenid(guest_kernel_linux_6_1, rootfs, microvm_factory, snapshot_type)
552552
platform.machine() != "aarch64" or global_props.host_linux_version_tpl < (6, 4),
553553
reason="This is aarch64 specific test and should only be run on 6.4 and later kernels",
554554
)
555-
def test_physical_couter_reset_aarch64(uvm_nano):
555+
def test_physical_counter_reset_aarch64(uvm_nano):
556556
"""
557557
Test that the CNTPCT_EL0 register is reset on VM boot.
558558
We assume the smallest VM will not consume more than
@@ -597,3 +597,6 @@ def test_physical_couter_reset_aarch64(uvm_nano):
597597
reg_id, reg_value = parts
598598
if reg_id == cntpct_el0:
599599
assert int(reg_value, 16) < max_value
600+
break
601+
else:
602+
raise RuntimeError("Did not find CNTPCT_EL0 register in snapshot")

0 commit comments

Comments
 (0)