From b83f4440463c301c48d02ee08e790f2e5b2914a5 Mon Sep 17 00:00:00 2001 From: liang-cong-red-hat Date: Wed, 1 Jan 2025 21:07:54 -0500 Subject: [PATCH] Add skip logic for cpu frequency checking on aarch64 Signed-off-by: liang-cong-red-hat --- libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg | 3 +++ libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg b/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg index 025034b28d..fa07d7c02a 100644 --- a/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg +++ b/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg @@ -4,6 +4,9 @@ start_vm = no virsh_node_options = "" status_error = "no" + check_frequency = yes + aarch64: + check_frequency = no variants test_case: - no_option: libvirtd = "on" diff --git a/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py b/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py index eea3b34688..56a8421a58 100644 --- a/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py +++ b/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py @@ -106,11 +106,12 @@ def output_check(nodeinfo_output): # that it's within 20 percent of each value to give us enough of # a "fudge" factor to declare "close enough". Don't return a failure # just print a debug message and move on. - diffval = abs(int(cpu_frequency_nodeinfo) - int(cpu_frequency_os)) - if (float(diffval) / float(cpu_frequency_nodeinfo) > 0.20 or - float(diffval) / float(cpu_frequency_os) > 0.20): - logging.debug("Virsh nodeinfo output didn't match CPU " - "frequency within 20 percent") + if 'yes' == params.get('check_frequency', 'no'): + diffval = abs(int(cpu_frequency_nodeinfo) - int(cpu_frequency_os)) + if (float(diffval) / float(cpu_frequency_nodeinfo) > 0.20 or + float(diffval) / float(cpu_frequency_os) > 0.20): + logging.debug("Virsh nodeinfo output didn't match CPU " + "frequency within 20 percent") # Get CPU topology from virsh capabilities xml cpu_topology = capability_xml.CapabilityXML()['cpu_topology']