提交 d634ab83 编写于 作者: Q Qingtang Zhou 提交者: Lucas Meneghel Rodrigues

qemu.tests: Add test for timerdevice with load on host

Signed-off-by: NQingtang Zhou <qzhou@redhat.com>
上级 32947a39
......@@ -61,6 +61,13 @@
- with_boot:
- with_reboot:
timerdevice_reboot_test = yes
variants:
- without_host_load:
- with_host_load:
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:
......
......@@ -2,6 +2,7 @@ import logging, re, time
from autotest.client.shared import error
from autotest.client import utils
from virttest import data_dir, storage, utils_disk, utils_test, env_process
from virttest import funcatexit
@error.context_aware
def run_timerdevice_boot(test, params, env):
......@@ -9,15 +10,16 @@ def run_timerdevice_boot(test, params, env):
Timer device boot guest:
1) Sync the host system time with ntp server
2) Boot the guest with specific clock source
3) Check the clock source currently used on guest
4) Do some file operation on guest (Optional)
5) Check the system time on guest and host (Optional)
6) Check the hardware time on guest and host (Optional)
7) Sleep period of time before reboot (Optional)
8) Reboot guest (Optional)
9) Check the system time on guest and host (Optional)
10) Check the hardware time on guest and host (Optional)
2) Add some load on host (Optional)
3) Boot the guest with specific clock source
4) Check the clock source currently used on guest
5) Do some file operation on guest (Optional)
6) Check the system time on guest and host (Optional)
7) Check the hardware time on guest and host (Optional)
8) Sleep period of time before reboot (Optional)
9) Reboot guest (Optional)
10) Check the system time on guest and host (Optional)
11) Check the hardware time on guest and host (Optional)
@param test: QEMU test object.
@param params: Dictionary with test parameters.
......@@ -34,6 +36,14 @@ def run_timerdevice_boot(test, params, env):
error.context("Sync the host system time with ntp server", logging.info)
utils.system("ntpdate clock.redhat.com")
timerdevice_host_load_cmd = params.get("timerdevice_host_load_cmd")
if timerdevice_host_load_cmd:
error.context("Add some load on host", logging.info)
utils.system(timerdevice_host_load_cmd)
host_load_stop_cmd = params["timerdevice_host_load_stop_cmd"]
funcatexit.register(env, params["type"], utils.system,
host_load_stop_cmd)
error.context("Boot a guest with kvm-clock", logging.info)
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册