提交 a6f330d9 编写于 作者: S Shuping Cui

qemu.tests: Bug fix about drift for timedrift_with_stop

kvm guests CLOCK_MONOTONIC not count when guest is paused,
so drift need to subtract stop_time.

starting from Win2012 Windows no longer relies on number of
injected RTC interrupts for time keeping, and the time drift
is seen because "stop" monitor command also stops PM timer,
so this is unsupported scenario from Win2012 and disabled this
case from Win2012.

changes from v1:
    add some comments for windows guest.
changes from v2:
    add check rtc_clock for windows
changes from v3:
    add new scenario rtc_clock = host and rtc_clock = vm for this case.
Signed-off-by: NShuping Cui <scui@redhat.com>
上级 783a6d60
......@@ -43,6 +43,7 @@ def run(test, params, env):
time_filter_re = params["time_filter_re"]
# Time format for time.strptime()
time_format = params["time_format"]
rtc_clock = params.get("rtc_clock", "host")
drift_threshold = float(params.get("drift_threshold", "10"))
drift_threshold_single = float(params.get("drift_threshold_single", "3"))
stop_iterations = int(params.get("stop_iterations", 1))
......@@ -88,6 +89,12 @@ def run(test, params, env):
host_delta = ht1_ - ht0_
guest_delta = gt1_ - gt0_
drift = abs(host_delta - guest_delta)
# kvm guests CLOCK_MONOTONIC not count when guest is paused,
# so drift need to subtract stop_time.
if not stop_with_signal:
drift = abs(drift - stop_time)
if params.get("os_type") == "windows" and rtc_clock == "host":
drift = abs(host_delta - guest_delta)
logging.info("Host duration (iteration %d): %.2f",
(i + 1), host_delta)
logging.info("Guest duration (iteration %d): %.2f",
......@@ -116,6 +123,12 @@ def run(test, params, env):
host_delta = ht1 - ht0
guest_delta = gt1 - gt0
drift = abs(host_delta - guest_delta)
# kvm guests CLOCK_MONOTONIC not count when guest is paused,
# so drift need to subtract stop_time.
if not stop_with_signal:
drift = abs(drift - stop_time)
if params.get("os_type") == "windows" and rtc_clock == "host":
drift = abs(host_delta - guest_delta)
logging.info("Host duration (%d stops): %.2f",
stop_iterations, host_delta)
logging.info("Guest duration (%d stops): %.2f",
......
......@@ -35,10 +35,21 @@
drift_threshold = 10
drift_threshold_single = 3
- with_stop:
# starting from Win2012 Windows no longer relies on number of injected RTC interrupts for time keeping,
# and the time drift is seen because "stop" monitor command also stops PM timer,
# so this is unsupported scenario from Win2012.
Windows:
only Win2000, WinXP, Win2003, WinVista, Win7, Win2008
type = timedrift_with_stop
stop_interations = 1
stop_time = 60
drift_threshold = 10
drift_threshold_single = 3
variants:
- clock_host:
rtc_clock = host
- clock_vm:
rtc_clock = vm
variants:
- ntp:
no JeOS
......@@ -66,11 +77,23 @@
test_duration = 600
smp_min =2
- with_signal_stop:
no RHEL.3.9
no RHEL.4
# starting from Win2012 Windows no longer relies on number of injected RTC interrupts for time keeping,
# and the time drift is seen because "stop" monitor command also stops PM timer,
# so this is unsupported scenario from Win2012.
Windows:
only Win2000, WinXP, Win2003, WinVista, Win7, Win2008
no RHEL.3.9, RHEL.4
type = timedrift_with_stop
stop_interations = 1
stop_with_signal = yes
stop_time = 60
drift_threshold = 10
drift_threshold_single = 3
variants:
- clock_host:
rtc_clock = host
- clock_vm:
rtc_clock = vm
variants:
- no_pvclock:
no RHEL.5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册