From 760a0ac539ae70947904eca8fcfb5536720c4e08 Mon Sep 17 00:00:00 2001 From: Anushree Mathur Date: Wed, 23 Aug 2023 12:07:42 +0530 Subject: [PATCH 1/2] Cancelling all the testcases for virsh iface-* Cancelling all the testcases regarding virsh iface-* for distro version rhel 9 and above as it is unsupported now in rhel 9! Documentation for Reference : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/considerations_in_adopting_rhel_9/assembly_virtualization_considerations-in-adopting-rhel-9 Signed-off-by: Anushree Mathur --- libvirt/tests/src/virsh_cmd/interface/virsh_iface.py | 7 +++++++ .../tests/src/virsh_cmd/interface/virsh_iface_bridge.py | 8 +++++++- libvirt/tests/src/virsh_cmd/interface/virsh_iface_edit.py | 6 ++++++ libvirt/tests/src/virsh_cmd/interface/virsh_iface_list.py | 6 ++++++ .../tests/src/virsh_cmd/interface/virsh_iface_trans.py | 7 +++++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/libvirt/tests/src/virsh_cmd/interface/virsh_iface.py b/libvirt/tests/src/virsh_cmd/interface/virsh_iface.py index a41272607d..eafe0aa41a 100644 --- a/libvirt/tests/src/virsh_cmd/interface/virsh_iface.py +++ b/libvirt/tests/src/virsh_cmd/interface/virsh_iface.py @@ -3,6 +3,7 @@ from avocado.utils import process from avocado.utils import path as utils_path +from avocado.utils import distro from virttest import utils_net from virttest import virsh @@ -127,6 +128,12 @@ def run(test, params, env): device by default. You can specify the interface which you want, but be careful. """ + """ + Cancelling testcase if distro version is rhel 9 and above + """ + detected_distro = distro.detect() + if detected_distro.name == "rhel" and int(detected_distro.version) >= 9: + test.cancel("virsh iface-* commands are unsupported in rhel 9") iface_name = params.get("iface_name", "ENTER.BRIDGE.NAME") iface_xml = params.get("iface_xml") diff --git a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_bridge.py b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_bridge.py index adcfeb1457..2884f2bf8a 100644 --- a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_bridge.py +++ b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_bridge.py @@ -2,7 +2,7 @@ import logging as log from avocado.utils import process - +from avocado.utils import distro from avocado.utils import path as utils_path from virttest import utils_net @@ -27,6 +27,12 @@ def run(test, params, env): (1) Bridge an existing network device(iface-bridge). (2) Unbridge a network device(iface-unbridge). """ + """ + Cancelling the testcase if distro version is rhel 9 and above + """ + detected_distro = distro.detect() + if detected_distro.name == "rhel" and int(detected_distro.version) >= 9: + test.cancel("virsh iface-* commands are unsupported in rhel 9") bridge_name = params.get("bridge_name") ping_ip = params.get("ping_ip", "") diff --git a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_edit.py b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_edit.py index d45ed6236f..2562df32c3 100644 --- a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_edit.py +++ b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_edit.py @@ -5,6 +5,7 @@ import aexpect from avocado.utils import process +from avocado.utils import distro from virttest import remote from virttest import data_dir @@ -58,6 +59,11 @@ def run(test, params, env): Edit interface start mode in this case. """ + """Cancelling testcase if distro version is rhel 9 and above""" + detected_distro = distro.detect() + if detected_distro.name == "rhel" and int(detected_distro.version) >= 9: + test.cancel("virsh iface-* commands are unsupported in rhel 9") + iface_name = params.get("iface_name", "lo") status_error = "yes" == params.get("status_error", "no") if not libvirt.check_iface(iface_name, "exists", "--all"): diff --git a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_list.py b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_list.py index 292f1e8905..b0d0d35d29 100644 --- a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_list.py +++ b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_list.py @@ -8,6 +8,7 @@ import re from avocado.utils import process, astring +from avocado.utils import distro from virttest import virsh @@ -33,6 +34,11 @@ def run(test, params, env): (3) Get interface MAC address by interface name (4) Get interface name by interface MAC address """ + """Cancelling testcase if distro version is rhel 9 and above""" + detected_distro = distro.detect() + if detected_distro.name == "rhel" and int(detected_distro.version) >= 9: + test.cancel("virsh iface-* commands are unsupported in rhel 9") + vm_name = params.get("main_vm") vm = env.get_vm(vm_name) opt = params.get('opt', '') diff --git a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_trans.py b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_trans.py index bec8c0fdd4..5412057a84 100644 --- a/libvirt/tests/src/virsh_cmd/interface/virsh_iface_trans.py +++ b/libvirt/tests/src/virsh_cmd/interface/virsh_iface_trans.py @@ -5,6 +5,7 @@ from avocado.utils import process from avocado.utils import path as utils_path from avocado.core import exceptions +from avocado.utils import distro from virttest import virsh from virttest import utils_libvirtd @@ -195,6 +196,12 @@ def run(test, params, env): 2.3.1 begin and commit testing with libvirtd restart 2.3.2 begin and rollback testing with libvirtd restart """ + """ + Cancelling testcase if distro version is rhel 9 and above + """ + detected_distro = distro.detect() + if detected_distro.name == "rhel" and int(detected_distro.version) >= 9: + test.cancel("virsh iface-* commands are unsupported in rhel 9") if not utils_package.package_install(["mlocate"]): test.cancel("Failed to install dependency package mlocate" From 67f2698e313b4c4c56d779c59576730ba7a03421 Mon Sep 17 00:00:00 2001 From: Anushree Mathur Date: Wed, 13 Sep 2023 00:43:23 +0530 Subject: [PATCH 2/2] External snapshot deletion failure modification! In libvirt version lesser than 9.0.0 external snapshot deletion was unsupported, but the testcase is failing now with the error message as "Snapshot delete succeed but expect fail" because the deletion is supported now with external disk. For reference : https://libvirt.org/news.html#v9-0-0-2023-01-16 Signed-off-by: Anushree Mathur --- libvirt/tests/src/virsh_cmd/snapshot/virsh_snapshot_disk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt/tests/src/virsh_cmd/snapshot/virsh_snapshot_disk.py b/libvirt/tests/src/virsh_cmd/snapshot/virsh_snapshot_disk.py index 3f7a26e414..3fcbc88331 100644 --- a/libvirt/tests/src/virsh_cmd/snapshot/virsh_snapshot_disk.py +++ b/libvirt/tests/src/virsh_cmd/snapshot/virsh_snapshot_disk.py @@ -422,7 +422,7 @@ def run(test, params, env): session.close() # Test delete snapshot without "--metadata", delete external disk - # snapshot will fail for now. + # snapshot deletion with external disk unsupported in libvirt version lower than 9.0.0 # Only do this when snapshot create succeed which filtered in cfg file. if snapshot_del_test: if snapshot_name: @@ -439,7 +439,7 @@ def run(test, params, env): test.fail("Snapshot xml file %s missing" % snap_xml_path) else: - if status_error: + if (not libvirt_version.version_compare(9,0,0)) and status_error: err_msg = "Snapshot delete succeed but expect fail." test.fail(err_msg) else: