Skip to content

Commit

Permalink
Merge pull request #6099 from liang-cong-red-hat/virsh_nodeinfo_skip_…
Browse files Browse the repository at this point in the history
…cpu_frequency_checking

Add skip logic for cpu frequency checking on aarch64
  • Loading branch information
dzhengfy authored Jan 6, 2025
2 parents e5f4080 + b83f444 commit 17934ee
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 17934ee

Please sign in to comment.