Skip to content

Commit

Permalink
Add skip logic for cpu frequency checking on aarch64
Browse files Browse the repository at this point in the history
Signed-off-by: liang-cong-red-hat <[email protected]>
  • Loading branch information
liang-cong-red-hat committed Jan 2, 2025
1 parent 7e2ac1c commit b83f444
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 6 additions & 5 deletions libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit b83f444

Please sign in to comment.