未验证 提交 108428ef 编写于 作者: X Xu Han 提交者: GitHub

Merge pull request #1238 from sitoliu/timerdevice

timerdevice: fix error to get hardware time
- timedrift_adjust_time:
no RHEL.3,4,5 WinXp Win2000 Win2003 WinVista
no WinXp, Win2000, Win2003, WinVista
virt_test_type = qemu libvirt
clock_source = 'kvm-clock'
type = timedrift_adjust_time
......@@ -69,7 +69,7 @@
workaround_timeout = 360
guest_epoch_time_cmd = 'powershell -command "& {$datetime=get-date -uformat "%c";'
guest_epoch_time_cmd += '$epoch=[int](get-date (get-date).touniversaltime() -uformat "%s");'
guest_epoch_time_cmd += 'write-host "datetime: ${datetime} epoch: ${epoch}"}'
guest_epoch_time_cmd += 'write-host "datetime: ${datetime} epoch: ${epoch}"}"'
timedrift_adjust_time.guest_pause_resume.clock_host.adjust_host_clock:
time_difference = 3600
timedrift_adjust_time.guest_reboot.clock_host.adjust_guest_clock:
......
......@@ -7,7 +7,7 @@
Linux:
type = timedrift_no_net
date_time_command = date -u +'TIME: %a %m/%d/%Y %H:%M:%S.%N'
date_time_filter_re = "(?:TIME: \w\w\w )(.{19})(.+)"
date_time_filter_re = "(?:TIME: \w\w\w )(.{19})(?:.+)"
date_time_format = "%m/%d/%Y %H:%M:%S"
hwclock_time_command = LC_TIME=C hwclock -u
hwclock_time_filter_re = "(.+)"
......@@ -18,7 +18,7 @@
Windows:
type = timedrift_no_net_win
date_time_command = "echo TIME: %date% %time%"
date_time_filter_re = "(?:TIME: \w\w\w )(.{19})(.+)"
date_time_filter_re = "(?:TIME: \w\w\w )(.{19})(?:.+)"
date_time_format = "%m/%d/%Y %H:%M:%S"
nettype = user # It is enough to avoid ntpdate or similar update
# guest time
......
......@@ -90,8 +90,8 @@
vcpu_socket = 2
- newer_msrs_support_check:
only Linux
no Host_RHEL.m3,m4,m5 Host_RHEL.m6.u0
no RHEL.3,4,5 RHEL.6.0,1,2,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
......
......@@ -117,7 +117,7 @@ class TimedriftTest(object):
try:
guest_timestr = session.cmd_output(
guest_epoch_time_cmd,
timeout=120)
timeout=240)
host_timestr = process.system_output(host_epoch_time_cmd,
shell=True)
epoch_host, epoch_guest = list(
......
......@@ -148,7 +148,7 @@ def run(test, params, env):
session.close()
if sub_work in globals(): # Try to find sub work function.
globals()[sub_work](params, vm, session)
globals()[sub_work](test, params, vm, session)
else:
test.cancel("Unable to found subwork %s in %s test file." %
(sub_work, __file__))
......
......@@ -143,7 +143,7 @@ def run(test, params, env):
session.close()
if sub_work in globals(): # Try to find sub work function.
globals()[sub_work](params, vm, session)
globals()[sub_work](test, params, vm, session)
else:
test.cancel("Unable to found subwork %s in %s test file." %
(sub_work, __file__))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册