提交 c0244737 编写于 作者: S Suqin Huang

Remove set_winutils_letter from rng_bat

it has been supported upstream
Signed-off-by: NSuqin Huang <shuang@redhat.com>
上级 c04387e1
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
# Please update path of rng_dll_register_cmd to right path which included you driver # Please update path of rng_dll_register_cmd to right path which included you driver
#rng_dll_register_cmd = if not exist "C:\Windows\system32\viorngum.dll" copy PATH:\INCLUDEDRIVER\viorngum.dll C:\Windows\system32\ /y &&" #rng_dll_register_cmd = if not exist "C:\Windows\system32\viorngum.dll" copy PATH:\INCLUDEDRIVER\viorngum.dll C:\Windows\system32\ /y &&"
session_cmd_timeout = 240 session_cmd_timeout = 240
read_rng_cmd = "X:\random_%PROCESSOR_ARCHITECTURE%.exe" read_rng_cmd = "WIN_UTILS:\random_%PROCESSOR_ARCHITECTURE%.exe"
driver_name = "viorng" driver_name = "viorng"
rng_data_rex = "0x\w" rng_data_rex = "0x\w"
driver_id_cmd = X:\devcon\wxp_x86\devcon.exe find * | find "VirtIO" driver_id_cmd = 'WIN_UTILS:\devcon\wxp_x86\devcon.exe find * | find "VirtIO"'
driver_check_cmd = X:\devcon\wxp_x86\devcon.exe status @DRIVER_ID driver_check_cmd = "WIN_UTILS:\devcon\wxp_x86\devcon.exe status @DRIVER_ID"
driver_id_pattern = "(.*?):.*?VirtIO RNG Device" driver_id_pattern = "(.*?):.*?VirtIO RNG Device"
Linux: Linux:
session_cmd_timeout = 360 session_cmd_timeout = 360
......
...@@ -36,16 +36,6 @@ def run(test, params, env): ...@@ -36,16 +36,6 @@ def run(test, params, env):
output = process.system_output(lsof_cmd, ignore_status=True) output = process.system_output(lsof_cmd, ignore_status=True)
return re.search(r"\s+%s\s+" % vm_pid, output, re.M) return re.search(r"\s+%s\s+" % vm_pid, output, re.M)
def set_winutils_letter(cmd, session, params):
"""
Replace 'X:' in command to real cdrom drive letter.
"""
vol = "X:"
if params["os_type"] != "linux":
vol = utils_misc.get_winutils_vol(session)
vol = "%s:" % vol
return cmd.replace("X:", vol)
def check_driver_status(session, check_cmd, driver_id): def check_driver_status(session, check_cmd, driver_id):
""" """
:param session: VM session :param session: VM session
...@@ -96,13 +86,13 @@ def run(test, params, env): ...@@ -96,13 +86,13 @@ def run(test, params, env):
vm, timeout) vm, timeout)
error_context.context("Check driver status", logging.info) error_context.context("Check driver status", logging.info)
session = vm.wait_for_login(timeout=timeout) session = vm.wait_for_login(timeout=timeout)
driver_id_cmd = set_winutils_letter(params.get("driver_id_cmd"), driver_id_cmd = utils_misc.set_winutils_letter(
session, params) session, params["driver_id_cmd"])
driver_id = get_driver_id(session, driver_id_cmd, driver_id = get_driver_id(session, driver_id_cmd,
params["driver_id_pattern"]) params["driver_id_pattern"])
if params.get("driver_check_cmd"): if params.get("driver_check_cmd"):
driver_check_cmd = set_winutils_letter( driver_check_cmd = utils_misc.set_winutils_letter(
params.get("driver_check_cmd"), session, params) session, params.get("driver_check_cmd"))
check_driver_status(session, driver_check_cmd, driver_id) check_driver_status(session, driver_check_cmd, driver_id)
else: else:
error_context.context("verify virtio-rng device driver", logging.info) error_context.context("verify virtio-rng device driver", logging.info)
...@@ -122,8 +112,9 @@ def run(test, params, env): ...@@ -122,8 +112,9 @@ def run(test, params, env):
error_context.context("Read virtio-rng device to get random number", error_context.context("Read virtio-rng device to get random number",
logging.info) logging.info)
read_rng_cmd = set_winutils_letter(params.get("read_rng_cmd"), read_rng_cmd = utils_misc.set_winutils_letter(
session, params) session, params["read_rng_cmd"])
if rng_dll_register_cmd: if rng_dll_register_cmd:
logging.info("register 'viorngum.dll' into system") logging.info("register 'viorngum.dll' into system")
session.cmd(rng_dll_register_cmd, timeout=120) session.cmd(rng_dll_register_cmd, timeout=120)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册