未验证 提交 d3367af6 编写于 作者: Y Yanan Fu 提交者: GitHub

Merge pull request #2211 from YanhuiMa/boot_with_load

add timer device case
......@@ -50,6 +50,7 @@
- boot_test:
no RHEL.3 RHEL.4 RHEL.5 RHEL.6
type = timerdevice_boot
start_vm = no
i386, x86_64:
rtc_drift = slew
timerdevice_drift_threshold = 3
......@@ -86,22 +87,35 @@
only RHEL
only ppc64 ppc64le
timerdevice_clksource = "timebase"
variants:
- without_host_load:
- with_host_load:
login_timeout = 600
only clock_host
no clksource_tsc
reboot_immediately:
only Linux
with_boot:
repeat_nums = 6
sleep_time = 600
Linux:
timerdevice_host_load_cmd = "for (( I=0; I<%s; I++ ));"
timerdevice_host_load_cmd += " do taskset -c $I /bin/bash -c"
timerdevice_host_load_cmd += " 'for ((;;)); do X=1; done &'; done"
timerdevice_host_load_stop_cmd = "pkill -f 'do X=1'"
Windows:
stress_install_from_repo = "no"
download_url_stress = 'stress/stress-1.0.4.tar.gz'
timerdevice_host_load_cmd = "--cpu %s --io 4 --vm 2 --vm-bytes 256M"
timerdevice_host_load_stop_cmd = "pkill -9 stress"
variants:
- with_boot:
- with_reboot:
timerdevice_reboot_test = yes
variants:
- without_host_load:
- with_host_load:
only Linux
login_timeout = 600
timerdevice_host_load_cmd = "for (( I=0; I<`grep processor /proc/cpuinfo"
timerdevice_host_load_cmd += " | wc -l`; I++ )); do taskset -c $I /bin/bash -c"
timerdevice_host_load_cmd += " 'for ((;;)); do X=1; done &'; done"
timerdevice_host_load_stop_cmd = "pkill -f 'do X=1'"
variants:
- reboot_immediately:
- reboot_after_sleep:
only with_host_load
timerdevice_sleep_time = 3600
- tscsync:
only Linux
......
......@@ -5,6 +5,7 @@ import re
from avocado.utils import process
from virttest import utils_test
from virttest import utils_time
from virttest import env_process
from virttest import funcatexit
from virttest import error_context
......@@ -134,13 +135,25 @@ def run(test, params, env):
timerdevice_host_load_cmd = params.get("timerdevice_host_load_cmd")
if timerdevice_host_load_cmd:
error_context.context("Add some load on host", logging.info)
process.system(timerdevice_host_load_cmd, shell=True,
ignore_bg_processes=True)
host_cpu_cnt_cmd = params["host_cpu_cnt_cmd"]
host_cpu_cnt = int(process.system_output(host_cpu_cnt_cmd, shell=True).strip())
if params["os_type"] == "linux":
timerdevice_host_load_cmd = timerdevice_host_load_cmd % host_cpu_cnt
process.system(timerdevice_host_load_cmd, shell=True,
ignore_bg_processes=True)
else:
timerdevice_host_load_cmd = timerdevice_host_load_cmd % int(host_cpu_cnt/2)
stress_bg = utils_test.HostStress("stress", params,
stress_args=timerdevice_host_load_cmd)
stress_bg.load_stress_tool()
host_load_stop_cmd = params.get("timerdevice_host_load_stop_cmd",
"pkill -f 'do X=1'")
funcatexit.register(env, params["type"], _system,
host_load_stop_cmd)
params["start_vm"] = "yes"
env_process.preprocess_vm(test, params, env, params.get("main_vm"))
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
......@@ -169,6 +182,15 @@ def run(test, params, env):
if params["os_type"] == "linux":
verify_timedrift(session, is_hardware=True)
repeat_nums = params.get_numeric("repeat_nums")
if repeat_nums:
sleep_time = params["sleep_time"]
for index in range(repeat_nums):
time.sleep(int(sleep_time))
verify_timedrift(session)
if params["os_type"] == "linux":
verify_timedrift(session, is_hardware=True)
if params.get("timerdevice_reboot_test") == "yes":
sleep_time = params.get("timerdevice_sleep_time")
if sleep_time:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册