From 0bbf3759ddea072d603540749ef778fa19ced52e Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Wed, 12 Feb 2025 13:51:35 +0000 Subject: [PATCH] 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/20230330174800.2677007-8-maz@kernel.org/ Fixes: 525e68639d18 Signed-off-by: Patrick Roy --- tests/integration_tests/functional/test_snapshot_basic.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/functional/test_snapshot_basic.py b/tests/integration_tests/functional/test_snapshot_basic.py index 875ef77dbaf..6fe41f4d5a6 100644 --- a/tests/integration_tests/functional/test_snapshot_basic.py +++ b/tests/integration_tests/functional/test_snapshot_basic.py @@ -552,7 +552,7 @@ def test_vmgenid(guest_kernel_linux_6_1, rootfs, microvm_factory, snapshot_type) platform.machine() != "aarch64" or global_props.host_linux_version_tpl < (6, 4), reason="This is aarch64 specific test and should only be run on 6.4 and later kernels", ) -def test_physical_couter_reset_aarch64(uvm_nano): +def test_physical_counter_reset_aarch64(uvm_nano): """ Test that the CNTPCT_EL0 register is reset on VM boot. We assume the smallest VM will not consume more than @@ -597,3 +597,6 @@ def test_physical_couter_reset_aarch64(uvm_nano): reg_id, reg_value = parts if reg_id == cntpct_el0: assert int(reg_value, 16) < max_value + break + else: + raise RuntimeError("Did not find CNTPCT_EL0 register in snapshot")