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

Read from guest long time

Read data from /dev/random 10 hours
Signed-off-by: NSuqin Huang <shuang@redhat.com>
上级 b423616e
- rng_read_longtime:
type = rng_bat
kill_vm = yes
virt_test_type = qemu
read_rng_timeout = 3600
no no_virtio_rng
test_duration = 36000
Windows:
# 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 &&"
session_cmd_timeout = 240
read_rng_cmd = for /l %i in (1, 1, 30) do "WIN_UTILS:\random_%PROCESSOR_ARCHITECTURE%.exe"
driver_name = "viorng"
rng_data_rex = "0x\w"
driver_id_pattern = "(.*?):.*?VirtIO RNG Device"
i386:
driver_id_cmd = 'WIN_UTILS:\devcon\wxp_x86\devcon.exe find * | find "VirtIO"'
driver_check_cmd = "WIN_UTILS:\devcon\wxp_x86\devcon.exe status @DRIVER_ID"
x86_64:
driver_id_cmd = 'WIN_UTILS:\devcon\wnet_amd64\devcon.exe find * | find "VirtIO"'
driver_check_cmd = "WIN_UTILS:\devcon\wnet_amd64\devcon.exe status @DRIVER_ID"
Linux:
session_cmd_timeout = 360
read_rng_cmd = "dd if=/dev/random bs=4 count=100 2>/dev/null|hexdump"
driver_verifier_cmd = "cat /sys/devices/virtual/misc/hw_random/rng_current"
driver_name = virtio
rng_data_rex = "\w+"
import re
import logging
import aexpect
import time
from virttest import utils_misc
from virttest import error_context
......@@ -119,6 +120,15 @@ def run(test, params, env):
logging.info("register 'viorngum.dll' into system")
session.cmd(rng_dll_register_cmd, timeout=120)
if params.get("test_duration"):
start_time = time.time()
while (time.time() - start_time) < float(params.get("test_duration")):
output = session.cmd_output(read_rng_cmd,
timeout=read_rng_timeout)
if len(re.findall(rng_data_rex, output, re.M)) < 2:
raise exceptions.TestFail("Unable to read random numbers from"
"guest: %s" % output)
else:
output = session.cmd_output(read_rng_cmd, timeout=read_rng_timeout)
if len(re.findall(rng_data_rex, output, re.M)) < 2:
raise exceptions.TestFail("Unable to read random numbers from"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册