Skip to content

Commit

Permalink
guest_os_booting: fix the unsupported version issues
Browse files Browse the repository at this point in the history
Fix two version issues in this PR:
1) --reset-nvram option is not supported in RHEL8 but we need to test
   this auto case. So don't use it in the test steps.
2) The stateless is supported from libvirt-8.6.0. So test it from this
   version.

Signed-off-by: Meina Li <[email protected]>
  • Loading branch information
meinaLi committed Jul 4, 2023
1 parent bd1a200 commit bfc95db
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
loader_dict = {'loader': '${loader_path}', 'nvram': '${nvram_path}', 'nvram_attrs': {'template': '${nvram_template}'}, 'secure': 'no', 'loader_readonly': 'yes', 'loader_type': 'pflash'}
- stateless_yes:
stateless = "yes"
func_supported_since_libvirt_ver = (8, 6, 0)
loader_path = "/usr/share/edk2/ovmf/OVMF.amdsev.fd"
loader_dict = {'os_firmware': 'efi', 'loader_stateless': 'yes'}
loader_xpath = [{'element_attrs': ["./os/loader[@stateless='yes']"], 'text': '${loader_path}'}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import os

from virttest import libvirt_version
from virttest import virsh
from virttest.libvirt_xml import vm_xml
from virttest.utils_libvirt import libvirt_vmxml
Expand All @@ -31,6 +32,7 @@ def run(test, params, env):
incorrect_loader_path = params.get("incorrect_loader_path", "")
use_file = "yes" == params.get("use_file", "no")
stateless = "yes" == params.get("stateless", "no")
libvirt_version.is_libvirt_feature_supported(params)

vm = env.get_vm(vm_name)
vmxml = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name)
Expand Down
2 changes: 1 addition & 1 deletion provider/guest_os_booting/guest_os_booting_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def check_vm_startup(vm, vm_name, error_msg):
:params vm: vm object
:params vm_name: the name of guest
"""
ret = virsh.start(vm_name, "--reset-nvram", timeout=30, debug=True)
ret = virsh.start(vm_name, timeout=30, debug=True)
vmxml = vm_xml.VMXML.new_from_dumpxml(vm_name)
libvirt.check_result(ret, expected_fails=error_msg)
if not error_msg:
Expand Down

0 comments on commit bfc95db

Please sign in to comment.