Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
2f587edc
T
tp-qemu
项目概览
openeuler
/
tp-qemu
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2f587edc
编写于
4月 30, 2014
作者:
L
Lucas Meneghel Rodrigues
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tp-qemu: Mass PEP8 E713 fixes
Signed-off-by:
N
Lucas Meneghel Rodrigues
<
lmr@redhat.com
>
上级
720418bf
变更
32
隐藏空白更改
内联
并排
Showing
32 changed file
with
50 addition
and
50 deletion
+50
-50
generic/tests/autotest_regression.py
generic/tests/autotest_regression.py
+3
-3
generic/tests/netstress_kill_guest.py
generic/tests/netstress_kill_guest.py
+1
-1
generic/tests/pxe_boot.py
generic/tests/pxe_boot.py
+1
-1
qemu/tests/cpuflags.py
qemu/tests/cpuflags.py
+2
-2
qemu/tests/cpuinfo_query.py
qemu/tests/cpuinfo_query.py
+1
-1
qemu/tests/floppy.py
qemu/tests/floppy.py
+6
-6
qemu/tests/migration_multi_host_downtime_and_speed.py
qemu/tests/migration_multi_host_downtime_and_speed.py
+1
-1
qemu/tests/migration_multi_host_firewall_block.py
qemu/tests/migration_multi_host_firewall_block.py
+1
-1
qemu/tests/migration_multi_host_timedrift.py
qemu/tests/migration_multi_host_timedrift.py
+1
-1
qemu/tests/migration_multi_host_with_speed_measurement.py
qemu/tests/migration_multi_host_with_speed_measurement.py
+1
-1
qemu/tests/migration_with_dst_problem.py
qemu/tests/migration_with_dst_problem.py
+1
-1
qemu/tests/migration_with_speed_measurement.py
qemu/tests/migration_with_speed_measurement.py
+1
-1
qemu/tests/mq_change_qnum.py
qemu/tests/mq_change_qnum.py
+1
-1
qemu/tests/pci_hotplug.py
qemu/tests/pci_hotplug.py
+1
-1
qemu/tests/pci_hotplug_check.py
qemu/tests/pci_hotplug_check.py
+1
-1
qemu/tests/physical_resources_check.py
qemu/tests/physical_resources_check.py
+2
-2
qemu/tests/qemu_img.py
qemu/tests/qemu_img.py
+4
-4
qemu/tests/qmp_basic.py
qemu/tests/qmp_basic.py
+1
-1
qemu/tests/qmp_basic_rhel6.py
qemu/tests/qmp_basic_rhel6.py
+1
-1
qemu/tests/rv_input.py
qemu/tests/rv_input.py
+1
-1
qemu/tests/rv_smartcard.py
qemu/tests/rv_smartcard.py
+2
-2
qemu/tests/sr_iov_hotplug.py
qemu/tests/sr_iov_hotplug.py
+1
-1
qemu/tests/timedrift_adjust_time.py
qemu/tests/timedrift_adjust_time.py
+1
-1
qemu/tests/timedrift_no_net.py
qemu/tests/timedrift_no_net.py
+1
-1
qemu/tests/timerdevice_boot.py
qemu/tests/timerdevice_boot.py
+1
-1
qemu/tests/timerdevice_change_guest_clksource.py
qemu/tests/timerdevice_change_guest_clksource.py
+2
-2
qemu/tests/timerdevice_clock_drift_with_ntp.py
qemu/tests/timerdevice_clock_drift_with_ntp.py
+1
-1
qemu/tests/timerdevice_clock_drift_with_sleep.py
qemu/tests/timerdevice_clock_drift_with_sleep.py
+1
-1
qemu/tests/timerdevice_tscsync_change_host_clksource.py
qemu/tests/timerdevice_tscsync_change_host_clksource.py
+3
-3
qemu/tests/timerdevice_tscsync_longtime.py
qemu/tests/timerdevice_tscsync_longtime.py
+1
-1
qemu/tests/timerdevice_tscwrite.py
qemu/tests/timerdevice_tscwrite.py
+3
-3
qemu/tests/usb_storage.py
qemu/tests/usb_storage.py
+1
-1
未找到文件。
generic/tests/autotest_regression.py
浏览文件 @
2f587edc
...
...
@@ -164,7 +164,7 @@ def run(test, params, env):
list_labels_output
=
session_server
.
cmd
(
list_labels_cmd
)
for
line
in
list_labels_output
.
splitlines
():
logging
.
debug
(
line
)
if
not
label_name
in
list_labels_output
:
if
label_name
not
in
list_labels_output
:
raise
ValueError
(
"No label %s in the output of %s"
%
(
label_name
,
list_labels_cmd
))
...
...
@@ -178,10 +178,10 @@ def run(test, params, env):
list_hosts_output
=
session_server
.
cmd
(
list_hosts_cmd
)
for
line
in
list_hosts_output
.
splitlines
():
logging
.
debug
(
line
)
if
not
client_ip
in
list_hosts_output
:
if
client_ip
not
in
list_hosts_output
:
raise
ValueError
(
"No client %s in the output of %s"
%
(
client_ip
,
create_label_cmd
))
if
not
label_name
in
list_hosts_output
:
if
label_name
not
in
list_hosts_output
:
raise
ValueError
(
"No label %s in the output of %s"
%
(
label_name
,
create_label_cmd
))
...
...
generic/tests/netstress_kill_guest.py
浏览文件 @
2f587edc
...
...
@@ -40,7 +40,7 @@ def run(test, params, env):
cmd
=
params
.
get
(
"nic_module_cmd"
)
out
=
session
.
cmd
(
cmd
)
for
module
in
out
.
split
(
"
\n
"
):
if
not
cmd
in
module
:
if
cmd
not
in
module
:
modules
.
append
(
module
.
split
(
"/"
)[
-
1
])
modules
.
remove
(
""
)
return
set
(
modules
)
...
...
generic/tests/pxe_boot.py
浏览文件 @
2f587edc
...
...
@@ -26,7 +26,7 @@ def run(test, params, env):
logging
.
debug
,
"(pxe capture) "
,
timeout
)[
1
]
error
.
context
(
"Analyzing the tcpdump result"
,
logging
.
info
)
if
not
"tftp"
in
output
:
if
"tftp"
not
in
output
:
raise
error
.
TestFail
(
"Couldn't find any TFTP packets after %s seconds"
%
timeout
)
...
...
qemu/tests/cpuflags.py
浏览文件 @
2f587edc
...
...
@@ -517,7 +517,7 @@ def run(test, params, env):
missing
=
[]
cpu_models
=
map
(
separe_cpu_model
,
cpu_models
)
for
cpu_model
in
cpu_models
:
if
not
cpu_model
in
result
.
stdout
:
if
cpu_model
not
in
result
.
stdout
:
missing
.
append
(
cpu_model
)
if
missing
:
raise
error
.
TestFail
(
"CPU models %s are not in output "
...
...
@@ -537,7 +537,7 @@ def run(test, params, env):
cpu_models
=
map
(
separe_cpu_model
,
cpu_models
)
missing
=
[]
for
cpu_model
in
cpu_models
:
if
not
cpu_model
in
result
.
stdout
:
if
cpu_model
not
in
result
.
stdout
:
missing
.
append
(
cpu_model
)
if
missing
:
raise
error
.
TestFail
(
"CPU models %s are not in output "
...
...
qemu/tests/cpuinfo_query.py
浏览文件 @
2f587edc
...
...
@@ -26,7 +26,7 @@ def run(test, params, env):
cpuinfos
=
params
.
get
(
"cpu_info"
,
"Conroe"
).
split
(
","
)
missing
=
[]
for
cpuinfo
in
cpuinfos
:
if
not
cpuinfo
in
output
:
if
cpuinfo
not
in
output
:
missing
.
append
(
cpuinfo
)
if
missing
:
raise
error
.
TestFail
(
"%s is missing in the output
\n
%s"
%
...
...
qemu/tests/floppy.py
浏览文件 @
2f587edc
...
...
@@ -112,7 +112,7 @@ def run(test, params, env):
# needs time to load and init floppy driver
if
self
.
dest_dir
:
lsmod
=
self
.
session
.
cmd
(
"lsmod"
)
if
not
'floppy'
in
lsmod
:
if
'floppy'
not
in
lsmod
:
self
.
session
.
cmd
(
"modprobe floppy"
)
else
:
time
.
sleep
(
20
)
...
...
@@ -234,7 +234,7 @@ def run(test, params, env):
error
.
context
(
"Prepare floppy for writing."
)
if
self
.
mount_dir
:
lsmod
=
session
.
cmd
(
"lsmod"
)
if
not
'floppy'
in
lsmod
:
if
'floppy'
not
in
lsmod
:
session
.
cmd
(
"modprobe floppy"
)
else
:
time
.
sleep
(
20
)
...
...
@@ -265,7 +265,7 @@ def run(test, params, env):
error
.
context
(
"Wait for copy finishing."
)
status
=
int
(
session
.
cmd_status
(
"kill %s"
%
pid
,
timeout
=
copy_timeout
))
if
not
status
in
[
0
]:
if
status
not
in
[
0
]:
raise
error
.
TestFail
(
"Copy process was terminatted with"
" error code %s"
%
(
status
))
...
...
@@ -338,12 +338,12 @@ def run(test, params, env):
error
.
context
(
"Prepare floppy for writing."
)
if
self
.
mount_dir
:
# If linux
lsmod
=
session
.
cmd
(
"lsmod"
)
if
not
'floppy'
in
lsmod
:
if
'floppy'
not
in
lsmod
:
session
.
cmd
(
"modprobe floppy"
)
else
:
time
.
sleep
(
20
)
if
not
floppy
in
vm
.
monitor
.
info
(
"block"
):
if
floppy
not
in
vm
.
monitor
.
info
(
"block"
):
raise
error
.
TestFail
(
"Wrong floppy image is placed in vm."
)
try
:
...
...
@@ -387,7 +387,7 @@ def run(test, params, env):
session
.
cmd
(
"mount -t vfat %s %s"
%
(
guest_floppy_path
,
self
.
mount_dir
),
timeout
=
30
)
if
not
second_floppy
in
vm
.
monitor
.
info
(
"block"
):
if
second_floppy
not
in
vm
.
monitor
.
info
(
"block"
):
raise
error
.
TestFail
(
"Wrong floppy image is placed in vm."
)
sync
=
SyncData
(
self
.
mig
.
master_id
(),
self
.
mig
.
hostid
,
...
...
qemu/tests/migration_multi_host_downtime_and_speed.py
浏览文件 @
2f587edc
...
...
@@ -68,7 +68,7 @@ def run(test, params, env):
ret
=
s
.
get
(
"migrated"
)
==
"true"
o
=
vm
.
monitor
.
info
(
"migrate"
)
if
isinstance
(
o
,
str
):
return
ret
and
(
not
"status: active"
in
o
)
return
ret
and
(
"status: active"
not
in
o
)
else
:
return
ret
and
(
o
.
get
(
"status"
)
!=
"active"
)
...
...
qemu/tests/migration_multi_host_firewall_block.py
浏览文件 @
2f587edc
...
...
@@ -39,7 +39,7 @@ def run(test, params, env):
ret
=
s
.
get
(
"migrated"
)
==
"true"
o
=
vm
.
monitor
.
info
(
"migrate"
)
if
isinstance
(
o
,
str
):
return
ret
and
(
not
"status: active"
in
o
)
return
ret
and
(
"status: active"
not
in
o
)
else
:
return
ret
and
(
o
.
get
(
"status"
)
!=
"active"
)
...
...
qemu/tests/migration_multi_host_timedrift.py
浏览文件 @
2f587edc
...
...
@@ -61,7 +61,7 @@ def run(test, params, env):
self
.
time_filter_re
,
self
.
time_format
)
session
.
cmd
(
self
.
create_file
)
if
not
vm
.
name
in
self
.
start_ht
.
keys
():
if
vm
.
name
not
in
self
.
start_ht
.
keys
():
(
self
.
start_ht
[
vm
.
name
],
self
.
start_gt
[
vm
.
name
])
=
(
ht
,
gt
)
if
abs
(
ht
-
gt
)
>
self
.
diff_limit
:
logging
.
warning
(
"Host and %s time diff %s is greater "
...
...
qemu/tests/migration_multi_host_with_speed_measurement.py
浏览文件 @
2f587edc
...
...
@@ -59,7 +59,7 @@ def run(test, params, env):
fail_msg
=
(
"Could not determine the transferred memory from"
" monitor data: %s"
%
o
)
if
isinstance
(
o
,
str
):
if
not
"status: active"
in
o
:
if
"status: active"
not
in
o
:
raise
error
.
TestWarn
(
warning_msg
)
try
:
transfered_mem
=
int
(
get_mig_speed
.
search
(
o
).
groups
()[
0
])
...
...
qemu/tests/migration_with_dst_problem.py
浏览文件 @
2f587edc
...
...
@@ -260,7 +260,7 @@ def run(test, params, env):
session
.
cmd
(
"dd if=/dev/zero of=%s bs=1M count=%s"
%
(
disk_path
,
disk_size
))
status
,
output
=
session
.
cmd_status_output
(
"setenforce 0"
)
if
not
status
in
[
0
,
127
]:
if
status
not
in
[
0
,
127
]:
logging
.
warn
(
"Function setenforce fails.
\n
%s"
%
(
output
))
config
=
self
.
config
%
(
self
.
server_name
,
disk_path
,
...
...
qemu/tests/migration_with_speed_measurement.py
浏览文件 @
2f587edc
...
...
@@ -56,7 +56,7 @@ def run(test, params, env):
fail_msg
=
(
"Could not determine the transferred memory from"
" monitor data: %s"
%
o
)
if
isinstance
(
o
,
str
):
if
not
"status: active"
in
o
:
if
"status: active"
not
in
o
:
raise
error
.
TestWarn
(
warning_msg
)
try
:
transfered_mem
=
int
(
get_mig_speed
.
search
(
o
).
groups
()[
0
])
...
...
qemu/tests/mq_change_qnum.py
浏览文件 @
2f587edc
...
...
@@ -96,7 +96,7 @@ def run(test, params, env):
error
.
context
(
"Change queues number repeatly"
,
logging
.
info
)
repeat_counts
=
int
(
params
.
get
(
"repeat_counts"
,
10
))
for
nic_index
,
nic
in
enumerate
(
vm
.
virtnet
):
if
not
"virtio"
in
nic
[
'nic_model'
]:
if
"virtio"
not
in
nic
[
'nic_model'
]:
continue
queues
=
int
(
vm
.
virtnet
[
nic_index
].
queues
)
if
queues
==
1
:
...
...
qemu/tests/pci_hotplug.py
浏览文件 @
2f587edc
...
...
@@ -44,7 +44,7 @@ def run(test, params, env):
add_output
=
vm
.
monitor
.
send_args_cmd
(
pci_add_cmd
,
convert
=
False
)
pci_info
.
append
([
''
,
''
,
add_output
,
pci_model
])
if
not
"OK domain"
in
add_output
:
if
"OK domain"
not
in
add_output
:
raise
error
.
TestFail
(
"Add PCI device failed. "
"Monitor command is: %s, Output: %r"
%
(
pci_add_cmd
,
add_output
))
...
...
qemu/tests/pci_hotplug_check.py
浏览文件 @
2f587edc
...
...
@@ -86,7 +86,7 @@ def run(test, params, env):
add_output
=
vm
.
monitor
.
send_args_cmd
(
pci_add_cmd
,
convert
=
False
)
guest_device
=
find_new_device
(
chk_cmd
,
guest_devices
)
pci_info
.
append
([
''
,
''
,
add_output
,
pci_model
,
guest_device
])
if
not
"OK domain"
in
add_output
:
if
"OK domain"
not
in
add_output
:
raise
error
.
TestFail
(
"Add PCI device failed. "
"Monitor command is: %s, Output: %r"
%
(
pci_add_cmd
,
add_output
))
...
...
qemu/tests/physical_resources_check.py
浏览文件 @
2f587edc
...
...
@@ -271,7 +271,7 @@ def run(test, params, env):
if
expected_vendor_id
and
cpu_vendor_id_chk_cmd
:
output
=
session
.
cmd_output
(
cpu_vendor_id_chk_cmd
)
if
not
expected_vendor_id
in
output
:
if
expected_vendor_id
not
in
output
:
fail_log
=
"CPU vendor id check failed.
\n
"
fail_log
+=
" Assigned to VM: '%s'
\n
"
%
expected_vendor_id
fail_log
+=
" Reported by OS: '%s'"
%
output
...
...
@@ -333,7 +333,7 @@ def run(test, params, env):
num_nics
=
len
(
params
.
objects
(
"nics"
))
for
nic_index
in
range
(
num_nics
):
mac
=
vm
.
get_mac_address
(
nic_index
)
if
not
string
.
lower
(
mac
)
in
found_mac_addresses
:
if
string
.
lower
(
mac
)
not
in
found_mac_addresses
:
fail_log
=
"MAC address mismatch:
\n
"
fail_log
+=
" Assigned to VM (not found): %s"
%
mac
n_fail
.
append
(
fail_log
)
...
...
qemu/tests/qemu_img.py
浏览文件 @
2f587edc
...
...
@@ -240,10 +240,10 @@ def run(test, params, env):
"""
img_info
=
_info
(
cmd
,
image_name
)
logging
.
info
(
"Info of image '%s':
\n
%s"
,
image_name
,
img_info
)
if
not
image_forma
t
in
img_info
:
if
image_format
no
t
in
img_info
:
raise
error
.
TestFail
(
"Got unexpected format of image '%s'"
" in info test"
%
image_name
)
if
not
image_size
in
img_info
:
if
image_size
not
in
img_info
:
raise
error
.
TestFail
(
"Got unexpected size of image '%s'"
" in info test"
%
image_name
)
...
...
@@ -424,7 +424,7 @@ def run(test, params, env):
:param cmd: qemu-img base command.
"""
if
not
'rebase'
in
utils
.
system_output
(
cmd
+
' --help'
,
if
'rebase'
not
in
utils
.
system_output
(
cmd
+
' --help'
,
ignore_status
=
True
):
raise
error
.
TestNAError
(
"Current kvm user space version does not"
" support 'rebase' subcommand"
)
...
...
@@ -453,7 +453,7 @@ def run(test, params, env):
# Check sn2's format and backing_file
actual_base_img
=
_info
(
cmd
,
sn2
,
"backing file"
)
base_img_name
=
os
.
path
.
basename
(
base_img
)
if
not
base_img_name
in
actual_base_img
:
if
base_img_name
not
in
actual_base_img
:
raise
error
.
TestFail
(
"After rebase the backing_file of 'sn2' is "
"'%s' which is not expected as '%s'"
%
(
actual_base_img
,
base_img_name
))
...
...
qemu/tests/qmp_basic.py
浏览文件 @
2f587edc
...
...
@@ -34,7 +34,7 @@ def run(test, params, env):
if
not
isinstance
(
qmp_dict
,
dict
):
raise
error
.
TestFail
(
"qmp_dict is not a dict (it's '%s')"
%
type
(
qmp_dict
))
if
not
key
in
qmp_dict
:
if
key
not
in
qmp_dict
:
raise
error
.
TestFail
(
"'%s' key doesn't exist in dict ('%s')"
%
(
key
,
str
(
qmp_dict
)))
...
...
qemu/tests/qmp_basic_rhel6.py
浏览文件 @
2f587edc
...
...
@@ -35,7 +35,7 @@ def run(test, params, env):
if
not
isinstance
(
qmp_dict
,
dict
):
raise
error
.
TestFail
(
"qmp_dict is not a dict (it's '%s')"
%
type
(
qmp_dict
))
if
not
key
in
qmp_dict
:
if
key
not
in
qmp_dict
:
raise
error
.
TestFail
(
"'%s' key doesn't exist in dict ('%s')"
%
(
key
,
str
(
qmp_dict
)))
...
...
qemu/tests/rv_input.py
浏览文件 @
2f587edc
...
...
@@ -94,7 +94,7 @@ def test_type_and_func_keys(client_vm, guest_session, params):
logging
.
info
(
"Sending typewriter and functional keys to client machine"
)
for
i
in
range
(
1
,
69
):
# Avoid Ctrl, RSH, LSH, PtScr, Alt, CpsLk
if
not
(
i
in
[
29
,
42
,
54
,
55
,
56
,
58
])
:
if
i
not
in
[
29
,
42
,
54
,
55
,
56
,
58
]
:
client_vm
.
send_key
(
str
(
hex
(
i
)))
utils_spice
.
wait_timeout
(
0.3
)
...
...
qemu/tests/rv_smartcard.py
浏览文件 @
2f587edc
...
...
@@ -84,8 +84,8 @@ def run(test, params, env):
raise
error
.
TestFail
(
"Certificate %s was not found as a listed"
" cert in the guest"
%
subj_string
)
elif
smartcard_testtype
==
"pklogin_finder"
:
# pkcs11_listcerts not installed until
# Smart Card Support is installed
# pkcs11_listcerts not installed until
# Smart Card Support is installed
try
:
certsinfo_output
=
guest_session
.
cmd
(
"pklogin_finder debug"
)
except
aexpect
.
ShellTimeoutError
:
...
...
qemu/tests/sr_iov_hotplug.py
浏览文件 @
2f587edc
...
...
@@ -51,7 +51,7 @@ def run(test, params, env):
error
.
context
(
"Adding pci device with command 'pci_add'"
)
add_output
=
vm
.
monitor
.
send_args_cmd
(
pci_add_cmd
,
convert
=
False
)
pci_info
.
append
([
''
,
add_output
])
if
not
"OK domain"
in
add_output
:
if
"OK domain"
not
in
add_output
:
raise
error
.
TestFail
(
"Add PCI device failed. "
"Monitor command is: %s, Output: %r"
%
(
pci_add_cmd
,
add_output
))
...
...
qemu/tests/timedrift_adjust_time.py
浏览文件 @
2f587edc
...
...
@@ -149,7 +149,7 @@ class TimedriftTest(object):
read_clock_cmd
=
"cat /sys/devices/system/clocksource/"
read_clock_cmd
+=
"clocksource0/current_clocksource"
current_clocksource
=
session
.
cmd_output
(
read_clock_cmd
)
if
not
clock_source
in
current_clocksource
:
if
clock_source
not
in
current_clocksource
:
raise
error
.
TestFail
(
"Guest didn't use'%s'"
%
clock_source
+
"clocksource, current clocksoure "
+
"is %s;"
%
current_clocksource
)
...
...
qemu/tests/timedrift_no_net.py
浏览文件 @
2f587edc
...
...
@@ -120,7 +120,7 @@ def run(test, params, env):
session
=
vm
.
wait_for_serial_login
(
timeout
=
login_timeout
)
out
=
session
.
cmd_output
(
"cat /sys/devices/system/clocksource/"
"clocksource0/current_clocksource"
)
if
not
guest_clock_source
in
out
:
if
guest_clock_source
not
in
out
:
raise
error
.
TestFail
(
"Clock source %s missing in guest clock "
"sources %s."
%
(
guest_clock_source
,
out
))
...
...
qemu/tests/timerdevice_boot.py
浏览文件 @
2f587edc
...
...
@@ -32,7 +32,7 @@ def run(test, params, env):
error
.
context
(
"Check the current clocksource in guest"
,
logging
.
info
)
cmd
=
"cat /sys/devices/system/clocksource/"
cmd
+=
"clocksource0/current_clocksource"
if
not
expected
in
session
.
cmd
(
cmd
):
if
expected
not
in
session
.
cmd
(
cmd
):
raise
error
.
TestFail
(
"Guest didn't use '%s' clocksource"
%
expected
)
...
...
qemu/tests/timerdevice_change_guest_clksource.py
浏览文件 @
2f587edc
...
...
@@ -24,7 +24,7 @@ def run(test, params, env):
error
.
context
(
"Check the current clocksource in guest"
,
logging
.
info
)
cmd
=
"cat /sys/devices/system/clocksource/"
cmd
+=
"clocksource0/current_clocksource"
if
not
expected
in
session
.
cmd
(
cmd
):
if
expected
not
in
session
.
cmd
(
cmd
):
raise
error
.
TestFail
(
"Guest didn't use '%s' clocksource"
%
expected
)
...
...
@@ -38,7 +38,7 @@ def run(test, params, env):
error
.
context
(
"Check the current clocksource in guest"
,
logging
.
info
)
cmd
=
"cat /sys/devices/system/clocksource/"
cmd
+=
"clocksource0/current_clocksource"
if
not
"kvm-clock"
in
session
.
cmd
(
cmd
):
if
"kvm-clock"
not
in
session
.
cmd
(
cmd
):
grub_file
=
params
.
get
(
"grub_file"
,
"/boot/grub2/grub.cfg"
)
if
"clocksource="
not
in
session
.
cmd
(
"cat %s"
%
grub_file
):
raise
error
.
TestFail
(
"Guest didn't use 'kvm-clock' clocksource"
)
...
...
qemu/tests/timerdevice_clock_drift_with_ntp.py
浏览文件 @
2f587edc
...
...
@@ -36,7 +36,7 @@ def run(test, params, env):
error
.
context
(
"Check for an appropriate clocksource on host"
,
logging
.
info
)
host_cmd
=
"cat /sys/devices/system/clocksource/"
host_cmd
+=
"clocksource0/current_clocksource"
if
not
"tsc"
in
utils
.
system_output
(
host_cmd
):
if
"tsc"
not
in
utils
.
system_output
(
host_cmd
):
raise
error
.
TestNAError
(
"Host must use 'tsc' clocksource"
)
error
.
context
(
"Boot the guest"
,
logging
.
info
)
...
...
qemu/tests/timerdevice_clock_drift_with_sleep.py
浏览文件 @
2f587edc
...
...
@@ -53,7 +53,7 @@ def run(test, params, env):
logging
.
info
)
cmd
=
"cat /sys/devices/system/clocksource/"
cmd
+=
"clocksource0/current_clocksource"
if
not
"kvm-clock"
in
session
.
cmd
(
cmd
):
if
"kvm-clock"
not
in
session
.
cmd
(
cmd
):
grub_file
=
params
.
get
(
"grub_file"
,
"/boot/grub2/grub.cfg"
)
if
"clocksource="
not
in
session
.
cmd
(
"cat %s"
%
grub_file
):
raise
error
.
TestFail
(
"Guest didn't use 'kvm-clock' clocksource"
)
...
...
qemu/tests/timerdevice_tscsync_change_host_clksource.py
浏览文件 @
2f587edc
...
...
@@ -27,7 +27,7 @@ def run(test, params, env):
error
.
context
(
"Check for an appropriate clocksource on host"
,
logging
.
info
)
host_cmd
=
"cat /sys/devices/system/clocksource/"
host_cmd
+=
"clocksource0/current_clocksource"
if
not
"tsc"
in
utils
.
system_output
(
host_cmd
):
if
"tsc"
not
in
utils
.
system_output
(
host_cmd
):
raise
error
.
TestNAError
(
"Host must use 'tsc' clocksource"
)
error
.
context
(
"Boot the guest with one cpu socket"
,
logging
.
info
)
...
...
@@ -40,7 +40,7 @@ def run(test, params, env):
error
.
context
(
"Check the guest is using vsyscall"
,
logging
.
info
)
date_cmd
=
"strace date 2>&1|egrep 'clock_gettime|gettimeofday'|wc -l"
output
=
session
.
cmd
(
date_cmd
)
if
not
'0'
in
output
:
if
'0'
not
in
output
:
raise
error
.
TestFail
(
"Failed to check vsyscall. Output: '%s'"
%
output
)
error
.
context
(
"Copy time-warp-test.c to guest"
,
logging
.
info
)
...
...
@@ -99,7 +99,7 @@ def run(test, params, env):
" Output (last 5 lines): '%s'"
%
msg
)
output
=
session
.
cmd
(
date_cmd
)
if
not
"1"
in
output
:
if
"1"
not
in
output
:
raise
error
.
TestFail
(
"Failed to check vsyscall."
" Output: '%s'"
%
output
)
finally
:
...
...
qemu/tests/timerdevice_tscsync_longtime.py
浏览文件 @
2f587edc
...
...
@@ -25,7 +25,7 @@ def run(test, params, env):
error
.
context
(
"Check for an appropriate clocksource on host"
,
logging
.
info
)
host_cmd
=
"cat /sys/devices/system/clocksource/"
host_cmd
+=
"clocksource0/current_clocksource"
if
not
"tsc"
in
utils
.
system_output
(
host_cmd
):
if
"tsc"
not
in
utils
.
system_output
(
host_cmd
):
raise
error
.
TestNAError
(
"Host must use 'tsc' clocksource"
)
error
.
context
(
"Check host has more than one cpu socket"
,
logging
.
info
)
...
...
qemu/tests/timerdevice_tscwrite.py
浏览文件 @
2f587edc
...
...
@@ -20,7 +20,7 @@ def run(test, params, env):
error
.
context
(
"Check for an appropriate clocksource on host"
,
logging
.
info
)
host_cmd
=
"cat /sys/devices/system/clocksource/"
host_cmd
+=
"clocksource0/current_clocksource"
if
not
"tsc"
in
utils
.
system_output
(
host_cmd
):
if
"tsc"
not
in
utils
.
system_output
(
host_cmd
):
raise
error
.
TestNAError
(
"Host must use 'tsc' clocksource"
)
error
.
context
(
"Boot the guest"
,
logging
.
info
)
...
...
@@ -40,7 +40,7 @@ def run(test, params, env):
date_cmd
=
"strace date 2>&1 | egrep 'clock_gettime|gettimeofday' | wc -l"
output
=
session
.
cmd
(
date_cmd
)
if
not
'0'
in
output
:
if
'0'
not
in
output
:
raise
error
.
TestFail
(
"Test failed before run msr tools."
" Output: '%s'"
%
output
)
...
...
@@ -51,6 +51,6 @@ def run(test, params, env):
session
.
cmd
(
cmd
)
output
=
session
.
cmd
(
date_cmd
)
if
not
"1"
in
output
:
if
"1"
not
in
output
:
raise
error
.
TestFail
(
"Test failed after run msr tools."
" Output: '%s'"
%
output
)
qemu/tests/usb_storage.py
浏览文件 @
2f587edc
...
...
@@ -115,7 +115,7 @@ def run(test, params, env):
error
.
context
(
"Check serial option in guest"
,
logging
.
info
)
session
=
_login
()
output
=
session
.
cmd
(
"lsusb -v"
)
if
not
(
"EMPTY_STRING"
in
serial
or
"NO_EQUAL_STRING"
in
serial
)
:
if
"EMPTY_STRING"
not
in
serial
or
"NO_EQUAL_STRING"
not
in
serial
:
# Verify in guest when serial is set to empty/null is meaningless.
_verify_string
(
serial
,
output
,
[
serial
])
_do_io_test_guest
(
session
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录