Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to specify virtio-win's version range #3808

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions virttest/env_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,27 @@ def preprocess(test, params, env):
version_info["vm_bootloader_version"] = str(vm_bootloader_ver)
LOG.debug("vm bootloader version: %s", vm_bootloader_ver)

# Checking required virtio-win version, if not satisfied, cancel test
if params.get("required_virtio_win") or params.get("required_virtio_win_prewhql"):
if params.get("cdrom_virtio"):
cdrom_virtio = params["cdrom_virtio"]
cdrom_virtio_path = os.path.basename(utils_misc.get_path(data_dir.get_data_dir(), cdrom_virtio))
virtio_win_range = params.get("required_virtio_win_prewhql") if re.search(
'prewhql', cdrom_virtio_path) else params.get("required_virtio_win")
if virtio_win_range:
LOG.info("Checking required virtio-win version: %s" % virtio_win_range)
match = re.search("virtio-win-(?:prewhql-)?(\d+\.\d+(?:\.\d+)?-\d+)", cdrom_virtio_path)
if match.group(1) is None:
test.error("Can not get virtio-win version from \"cdrom_virtio\": %s" % cdrom_virtio)
cdrom_virtio_version = re.sub('-', '.', match.group(1))
if cdrom_virtio_version not in VersionInterval(virtio_win_range):
test.cancel("Got virtio-win version:%s, which is not in %s" %
(cdrom_virtio_version, virtio_win_range))
leidwang marked this conversation as resolved.
Show resolved Hide resolved
else:
test.error("The limitation for virtio-win is not suitable for the cdrom_virtio")
else:
LOG.warning("required_virtio_win(prewhql) can not take effect without cdrom_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
4 changes: 4 additions & 0 deletions virttest/shared/cfg/virtio-win.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#
# So you have to map the paths of your cd containing the drivers on the config
# variables. More details below.
#
# The parameter required_virtio_win is used to specify a range of virtio-win iso.
# required_virtio_win_prewhql = [0.1.180, 0.1.280]
# required_virtio_win = [1.9.22.3, 1.9.36.0)

unattended_install.cdrom, whql.support_vm_install:
Windows..virtio_blk, Windows..virtio_scsi, Windows..virtio_net:
Expand Down
Loading