diff --git a/qemu/tests/boot_e1000e_with_cpu_flag.py b/qemu/tests/boot_e1000e_with_cpu_flag.py new file mode 100644 index 0000000000000000000000000000000000000000..5daeec43f7e43644077d8f608f9dc58e47615e79 --- /dev/null +++ b/qemu/tests/boot_e1000e_with_cpu_flag.py @@ -0,0 +1,36 @@ +from virttest import error_context +from virttest import utils_net + + +@error_context.context_aware +def run(test, params, env): + """ + Boot a winodws guest add Vendor ID with name "KVMKVMKVM" to cpu model flag + + 1) Boot a vm with 'e1000e + hv_vendor_id=KVMKVMKVM' on q35 machine + 2) Run the bcdedit command as administrator + 3) reboot guest by shell + 4) do ping test + + :param test: QEMU test object. + :param params: Dictionary with the test parameters. + :param env: Dictionary with test environment. + """ + login_timeout = params.get_numeric("login_timeout", 360) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() + session_serial = vm.wait_for_serial_login(timeout=login_timeout) + bcdedit_debug = params["bcdedit_debug"] + bcdedit_cmd = params["bcdedit_cmd"] + ext_host = params.get("ext_host") + + try: + session_serial.cmd(bcdedit_debug) + session_serial.cmd(bcdedit_cmd) + vm.reboot(timeout=login_timeout) + status, output = utils_net.ping(dest=ext_host, count=10, + session=session_serial, timeout=30) + if status: + test.fail("ping is failed, output %s" % output) + finally: + session_serial.close() diff --git a/qemu/tests/cfg/boot_e1000e_with_cpu_flag.cfg b/qemu/tests/cfg/boot_e1000e_with_cpu_flag.cfg new file mode 100644 index 0000000000000000000000000000000000000000..6c135872293be237d297dbbc3b231a4517031792 --- /dev/null +++ b/qemu/tests/cfg/boot_e1000e_with_cpu_flag.cfg @@ -0,0 +1,9 @@ +- boot_e1000e_with_cpu_flag: + only q35 + only e1000e + only Windows + type = boot_e1000e_with_cpu_flag + cpu_model_flags += ",hv_vendor_id=KVMKVMKVM" + bcdedit_debug = "bcdedit /debug on" + bcdedit_cmd = "bcdedit /dbgsettings net hostip:192.168.0.12 port:50000 key:this.key.isnt.secure" + ext_host = "www.redhat.com"