未验证 提交 c208f8c0 编写于 作者: Q Qianqian Zhu 提交者: GitHub

Merge pull request #1477 from sitoliu/timerdevice_fix

timerdevice_clock_drift_with_sleep: fix error
- timerdevice:
no Host_RHEL.m5, Host_RHEL.m6
no Host_RHEL.m5 Host_RHEL.m6
restart_vm = yes
host_cpu_cnt_cmd = "cat /proc/cpuinfo | grep "physical id" | wc -l"
variants:
- tscwrite:
only Fedora.19, RHEL.7
only Fedora.19 RHEL.7
type = timerdevice_tscwrite
msr_tools_install_cmd = "yum install -y msr-tools"
msr_tools_cmd = "a=$(rdmsr -d 0x00000010); echo -e ibase=16\\n $a | tail -n 1 | while read n; do wrmsr 0x00000010 $(($n+100000000000)); echo $n; done"
......@@ -13,21 +14,25 @@
type = timerdevice_clock_drift_with_sleep
rtc_base = utc
rtc_clock = host
rtc_drift = slew
i386, x86_64:
rtc_drift = slew
ntp_sync_cmd = "(systemctl stop chronyd || service ntpdate stop)"
ntp_sync_cmd += " && chronyd -q 'server clock.redhat.com iburst'"
- clock_drift_with_ntp:
only Fedora.19, RHEL.7
only Fedora.19 RHEL.7
type = timerdevice_clock_drift_with_ntp
host_cpu_cnt_cmd = "cat /proc/cpuinfo | grep "physical id" | wc -l"
test_run_timeout = 7200
- change_guest_clksource:
only RHEL
type = timerdevice_change_guest_clksource
rtc_base = utc
rtc_clock = host
rtc_drift = slew
i386, x86_64:
rtc_drift = slew
- boot_test:
type = timerdevice_boot
rtc_drift = slew
i386, x86_64:
rtc_drift = slew
timerdevice_drift_threshold = 3
variants:
- clock_host:
......@@ -46,7 +51,7 @@
only Windows
timerdevice_clksource = ""
- clksource_kvm-clock:
only Fedora.19, RHEL
only Fedora.19 RHEL
timerdevice_clksource = "kvm-clock"
- clksource_tsc:
# Fedora guest can't bootup without '-kvmclock' option.
......@@ -54,7 +59,7 @@
only RHEL
timerdevice_clksource = "tsc"
- clksource_pit:
only RHEL.3, RHEL.4, RHEL.5
only RHEL.3 RHEL.4 RHEL.5
timerdevice_clksource = "pit"
timerdevice_file_operation = "yes"
variants:
......@@ -73,7 +78,7 @@
- reboot_after_sleep:
timerdevice_sleep_time = 3600
- tscsync:
only Fedora.19, RHEL.7
only Fedora.19 RHEL.7
variants:
- change_host_clksource:
type = timerdevice_tscsync_change_host_clksource
......@@ -90,11 +95,12 @@
vcpu_socket = 2
- newer_msrs_support_check:
only Linux
no Host_RHEL.m5, Host_RHEL.m6.u0
no RHEL.6.0, RHEL.6.1, RHEL.6.2, RHEL.6.3
no Host_RHEL.m5 Host_RHEL.m6.u0
no RHEL.6.0 RHEL.6.1 RHEL.6.2 RHEL.6.3
type = timerdevice_kvmclock_newer_msrs_support
rtc_base = utc
rtc_clock = host
rtc_drift = slew
i386, x86_64:
rtc_drift = slew
msrs = "4b564d01 4b564d00"
msrs_catch_re = "kvm-clock: Using msrs (\w+) and (\w+)"
......@@ -37,15 +37,16 @@ def run(test, params, env):
output = session.cmd_output(get_time_cmd, timeout=timeout)
times_list = output.splitlines()[1:]
times_list = [_ for _ in times_list if _ > 10.0 or _ < 11.0]
times_list = [_ for _ in times_list if float(_) < 10.0 or float(_) > 11.0]
if times_list:
test.fail("Unexpected time drift found: Detail: '%s'" % output)
test.fail("Unexpected time drift found: Detail: '%s' \n timeslist: %s"
% (output, times_list))
error_context.context("Sync the host system time with ntp server",
logging.info)
process.system("yum install -y ntpdate; ntpdate clock.redhat.com",
shell=True)
ntp_sync_cmd = params.get("ntp_sync_cmd")
process.system(ntp_sync_cmd, shell=True)
error_context.context("Boot the guest", logging.info)
vm = env.get_vm(params["main_vm"])
......@@ -104,8 +105,7 @@ def run(test, params, env):
session.cmd_status_output(cmd)
error_context.context("Sync time from guest to ntpserver", logging.info)
session.cmd("yum install -y ntpdate; ntpdate clock.redhat.com",
timeout=timeout)
session.cmd(ntp_sync_cmd, timeout=timeout)
error_context.context("Sleep a while and check the time drift on guest"
" (without any pinned vcpu)", logging.info)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册