From 0b9aba202861e4c9ba3e3055e8eef34d97c33df8 Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Fri, 4 Aug 2023 17:30:09 +0800 Subject: [PATCH] virsh_nodeinfo: skip on AMD Skip a case on AMD machine because the cpu topology is different between Intel and AMD. Signed-off-by: Dan Zheng --- libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg | 2 +- libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg b/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg index 25608d0584..025034b28d 100644 --- a/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg +++ b/libvirt/tests/cfg/virsh_cmd/host/virsh_nodeinfo.cfg @@ -4,7 +4,7 @@ start_vm = no virsh_node_options = "" status_error = "no" - variants: + variants test_case: - no_option: libvirtd = "on" - disable_enable_vcpu: diff --git a/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py b/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py index 3b5e8cd025..eea3b34688 100644 --- a/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py +++ b/libvirt/tests/src/virsh_cmd/host/virsh_nodeinfo.py @@ -22,6 +22,18 @@ logging = log.getLogger('avocado.' + __name__) +def check_skip_case(params, test): + """ + Check if the case should be run + + :param params: dict, test parameters + :param test: test object + """ + test_case = params.get('test_case') + if test_case == 'no_option' and cputils.get_vendor() == 'amd': + test.cancel("The case does not support AMD machine") + + def run(test, params, env): """ Test the command virsh nodeinfo @@ -236,6 +248,7 @@ def _get_nodeinfo(): "but found '%s'" % (int(cpus_nodeinfo_before), cpus_nodeinfo_after)) + check_skip_case(params, test) # Prepare libvirtd service libvirtd = params.get("libvirtd", "on")