Skip to content

Commit

Permalink
Support to specify virtio-win's version range
Browse files Browse the repository at this point in the history
Add a checkpoint here to check the virtio-win version,
if the version is in the specified range, test will
continue, if not, cancel the test.

Signed-off-by: Leidong Wang <[email protected]>
  • Loading branch information
leidwang committed Dec 4, 2023
1 parent 71382b8 commit 3acccf7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions virttest/env_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,22 @@ def preprocess(test, params, env):
test.cancel("Got host qemu version:%s, which is not in %s" %
(host_qemu, required_qemu))

# Checking required virtio driver version, if not satisfied, cancel test
if params.get("required_virtio") and params.get("cdrom_virtio"):
required_virtio = params.get("required_virtio")
LOG.info("Test requires virtio driver version: %s" % required_virtio)
cdrom_virtio = params["cdrom_virtio"]
if re.search('prewhql', cdrom_virtio):
match = re.search("\d+.\d+-\d+", cdrom_virtio)
else:
match = re.search("\d+.\d+\d+-\d+", cdrom_virtio)
if match is None:
test.cancel("Can not get virtio driver version")
cdrom_virtio_version = re.sub('-', '.', match.group(0))
if cdrom_virtio_version not in VersionInterval(required_virtio):
test.cancel("Got virtio driver version:%s, which is not in %s" %
(cdrom_virtio_version, required_virtio))

# Get the Libvirt version
if vm_type == "libvirt":
libvirt_ver_cmd = params.get("libvirt_ver_cmd", "libvirtd -V|awk -F' ' '{print $3}'")
Expand Down

0 comments on commit 3acccf7

Please sign in to comment.