diff --git a/libvirt/tests/src/bios/virsh_boot_sysinfo.py b/libvirt/tests/src/bios/virsh_boot_sysinfo.py
index 9e12fbff70..54ca80d35b 100644
--- a/libvirt/tests/src/bios/virsh_boot_sysinfo.py
+++ b/libvirt/tests/src/bios/virsh_boot_sysinfo.py
@@ -122,12 +122,19 @@ def run(test, params, env):
if not status_error:
# Check result in dumpxml and qemu cmdline
if with_file:
- expect_xml_line = "" % (entry_file, entry_name)
+ xpaths = [
+ ".//entry[@file='%s']" % entry_file,
+ ".//entry[@name='%s']" % entry_name
+ ]
+ text = None
expect_qemu_line = "-fw_cfg name=%s,file=%s" % (entry_name, entry_file)
if with_value:
- expect_xml_line = "%s" % (entry_name, value_string)
+ xpaths = [
+ ".//entry[@name='%s']" % entry_name
+ ]
+ text = value_string
expect_qemu_line = "-fw_cfg name=%s,string=%s" % (entry_name, value_string)
- libvirt.check_dumpxml(vm, expect_xml_line)
+ libvirt.check_xpaths(vmxml, xpaths, text)
libvirt.check_qemu_cmd_line(expect_qemu_line)
# Check result in guest
diff --git a/libvirt/tests/src/virtual_device/input_devices.py b/libvirt/tests/src/virtual_device/input_devices.py
index e9aa3f4467..3c98cc923b 100644
--- a/libvirt/tests/src/virtual_device/input_devices.py
+++ b/libvirt/tests/src/virtual_device/input_devices.py
@@ -5,6 +5,7 @@
from virttest.libvirt_xml.devices.input import Input
from virttest.libvirt_xml.vm_xml import VMXML
+from virttest.utils_test import libvirt
from virttest import virsh
from virttest import libvirt_version
@@ -27,15 +28,16 @@ def check_dumpxml():
"""
Check whether the added devices are shown in the guest xml
"""
- pattern = "" % (input_type, bus_type)
+ expected = [
+ ".//input[@type='%s']" % input_type,
+ ".//input[@bus='%s']" % bus_type
+ ]
if with_packed:
- pattern = "