Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
5f25b6ab
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,发现更多精彩内容 >>
提交
5f25b6ab
编写于
12月 06, 2013
作者:
L
Lucas Meneghel Rodrigues
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1208 from autotest/pep8-fix
PEP8 mass auto fix
上级
f8379f68
b88f89fe
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
25 deletion
+17
-25
qemu/tests/ksm_base.py
qemu/tests/ksm_base.py
+1
-1
qemu/tests/pci_devices.py
qemu/tests/pci_devices.py
+2
-0
qemu/tests/qemu_option_check.py
qemu/tests/qemu_option_check.py
+5
-6
qemu/tests/set_link.py
qemu/tests/set_link.py
+3
-10
qemu/tests/sr_iov_sanity.py
qemu/tests/sr_iov_sanity.py
+1
-1
qemu/tests/suspend_under_stress.py
qemu/tests/suspend_under_stress.py
+3
-3
qemu/tests/zero_copy.py
qemu/tests/zero_copy.py
+2
-4
未找到文件。
qemu/tests/ksm_base.py
浏览文件 @
5f25b6ab
...
...
@@ -84,7 +84,7 @@ def run_ksm_base(test, params, env):
"grep MemFree /proc/meminfo"
)
free_mem
=
vm
.
get_memory_size
(
get_free_mem_cmd
)
max_mem
=
int
(
free_mem
/
(
1
+
TMPFS_OVERHEAD
)
-
guest_script_overhead
)
# Keep test from OOM killer
if
max_mem
<
shared_mem
:
shared_mem
=
max_mem
...
...
qemu/tests/pci_devices.py
浏览文件 @
5f25b6ab
...
...
@@ -14,9 +14,11 @@ import re
class
PCIBusInfo
:
"""
Structured info about PCI bus
"""
def
__init__
(
self
,
device
):
self
.
name
=
device
.
aobject
if
device
.
child_bus
:
...
...
qemu/tests/qemu_option_check.py
浏览文件 @
5f25b6ab
...
...
@@ -4,6 +4,7 @@ from autotest.client import utils
from
autotest.client.shared
import
error
from
virttest
import
utils_misc
@
error
.
context_aware
def
run_qemu_option_check
(
test
,
params
,
env
):
"""
...
...
@@ -22,8 +23,8 @@ def run_qemu_option_check(test, params, env):
Get qemu support device list
"""
support_device
=
utils
.
system_output
(
"%s -device ? 2>&1"
%
qemu_binary
,
timeout
=
10
,
ignore_status
=
True
)
%
qemu_binary
,
timeout
=
10
,
ignore_status
=
True
)
if
not
support_device
:
raise
error
.
TestNAError
(
"Can not get qemu support device list"
)
device_list
=
re
.
findall
(
r
'name\s+"(.*)",'
,
support_device
)
...
...
@@ -31,7 +32,6 @@ def run_qemu_option_check(test, params, env):
device_list
.
extend
(
device_list_alias
)
return
device_list
def
get_device_option
(
qemu_binary
,
device_name
):
"""
Get qemu device 'device_name' support options
...
...
@@ -42,8 +42,8 @@ def run_qemu_option_check(test, params, env):
raise
error
.
TestNAError
(
err_msg
%
device_name
)
device_support_option
=
utils
.
run
(
"%s -device %s,? 2>&1"
%
(
qemu_binary
,
device_name
),
timeout
=
10
,
ignore_status
=
True
)
timeout
=
10
,
ignore_status
=
True
)
if
device_support_option
.
exit_status
:
raise
error
.
TestError
(
"Oops, output status is wrong"
)
if
not
re
.
findall
(
r
"%s\.(.*)=(.*)"
%
device_name
,
...
...
@@ -52,7 +52,6 @@ def run_qemu_option_check(test, params, env):
logging
.
info
(
"Qemu options check successfull. output is:
\n
%s"
%
device_support_option
.
stdout
)
device_name
=
params
.
get
(
"device_name"
)
qemu_binary
=
utils_misc
.
get_qemu_binary
(
params
)
...
...
qemu/tests/set_link.py
浏览文件 @
5f25b6ab
...
...
@@ -41,7 +41,6 @@ def run_set_link(test, params, env):
err_msg
+=
"Error info: '%s'"
%
err
raise
error
.
TestFail
(
err_msg
)
def
change_queues_number_repeatly
(
guest_ifname
):
"""
Change queues repeatedly, only for mq test
...
...
@@ -49,7 +48,7 @@ def run_set_link(test, params, env):
session
=
vm
.
wait_for_serial_login
()
try
:
queues
=
params
.
get
(
"queues"
,
1
)
change_list
=
xrange
(
1
,
int
(
queues
)
+
1
)
change_list
=
xrange
(
1
,
int
(
queues
)
+
1
)
env
[
"run_change_queues"
]
=
True
change_queues_number
(
session
,
guest_ifname
,
queues
)
while
env
[
"run_change_queues"
]:
...
...
@@ -60,7 +59,6 @@ def run_set_link(test, params, env):
del
env
[
"run_change_queues"
]
session
.
close
()
def
guest_reboot
(
reboot_method
,
link_up
):
"""
Reboot guest by different method (shell/system_reset)
...
...
@@ -71,7 +69,6 @@ def run_set_link(test, params, env):
if
not
link_up
:
logging
.
info
(
"Login error is expected when net link is down"
)
def
guest_netwok_connecting_check
(
guest_ip
,
link_up
,
change_queues
=
False
):
"""
Check whether guest network is connective by ping
...
...
@@ -102,7 +99,6 @@ def run_set_link(test, params, env):
env
[
"run_change_queues"
]
=
False
bg_thread
.
join
()
def
operstate_check
(
session
,
expect_status
,
guest_ifname
=
""
):
"""
Check Guest interface operstate
...
...
@@ -112,7 +108,7 @@ def run_set_link(test, params, env):
session
.
cmd
)
else
:
if_operstate
=
utils_net
.
get_windows_nic_attribute
(
session
,
"macaddress"
,
vm
.
get_mac_address
(),
"netconnectionstatus"
)
"macaddress"
,
vm
.
get_mac_address
(),
"netconnectionstatus"
)
if
if_operstate
!=
expect_status
:
err_msg
=
"Guest interface %s status error, "
%
guest_ifname
...
...
@@ -122,7 +118,6 @@ def run_set_link(test, params, env):
logging
.
info
(
"Guest interface operstate '%s' is exactly as expected"
%
if_operstate
)
def
guest_interface_operstate_check
(
expect_status
,
guest_ifname
=
""
,
change_queues
=
False
):
"""
...
...
@@ -132,7 +127,7 @@ def run_set_link(test, params, env):
try
:
if
change_queues
:
queues
=
params
.
get
(
"queues"
,
1
)
change_list
=
xrange
(
1
,
int
(
queues
)
+
1
)
change_list
=
xrange
(
1
,
int
(
queues
)
+
1
)
for
q_number
in
change_list
:
change_queues_number
(
session
,
guest_ifname
,
q_number
)
operstate_check
(
session
,
expect_status
,
guest_ifname
)
...
...
@@ -141,7 +136,6 @@ def run_set_link(test, params, env):
finally
:
session
.
close
()
def
set_link_test
(
linkid
,
link_up
,
expect_status
,
operstate_always_up
=
False
,
change_queues
=
False
):
"""
...
...
@@ -182,7 +176,6 @@ def run_set_link(test, params, env):
reboot_method
,
logging
.
info
)
guest_netwok_connecting_check
(
guest_ip
,
link_up
,
change_queues
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
login_timeout
=
float
(
params
.
get
(
"login_timeout"
,
360
))
...
...
qemu/tests/sr_iov_sanity.py
浏览文件 @
5f25b6ab
...
...
@@ -134,7 +134,7 @@ def run_sr_iov_sanity(test, params, env):
if
device_type
==
"vf"
:
post_device_num
=
pci_assignable
.
get_vfs_count
()
else
:
post_device_num
=
len
(
pci_assignable
.
get_pf_vf_info
())
post_device_num
=
len
(
pci_assignable
.
get_pf_vf_info
())
if
post_device_num
!=
device_num
:
msg
=
"lspci cannot report the correct PF/VF number."
msg
+=
" Correct number is '%s'"
%
device_num
...
...
qemu/tests/suspend_under_stress.py
浏览文件 @
5f25b6ab
...
...
@@ -34,10 +34,10 @@ def run_suspend_under_stress(test, params, env):
bg_stress_run_flag
=
params
.
get
(
"bg_stress_run_flag"
)
env
[
bg_stress_run_flag
]
=
False
stress_thread
=
utils
.
InterruptedThread
(
utils_test
.
run_virt_sub_test
,
(
test
,
params
,
env
),
{
"sub_type"
:
bg_stress_test
})
utils_test
.
run_virt_sub_test
,
(
test
,
params
,
env
),
{
"sub_type"
:
bg_stress_test
})
stress_thread
.
start
()
if
not
utils_misc
.
wait_for
(
lambda
:
env
.
get
(
bg_stress_run_flag
),
if
not
utils_misc
.
wait_for
(
lambda
:
env
.
get
(
bg_stress_run_flag
),
wait_time
,
0
,
5
,
"Wait %s test start"
%
bg_stress_test
):
raise
error
.
TestError
(
"Run stress test error"
)
...
...
qemu/tests/zero_copy.py
浏览文件 @
5f25b6ab
...
...
@@ -30,7 +30,6 @@ def run_zero_copy(test, params, env):
else
:
return
True
def
enable_zerocopytx_in_host
(
enable
=
True
):
"""
Enable or disable vhost_net zero copy in host
...
...
@@ -40,10 +39,9 @@ def run_zero_copy(test, params, env):
cmd
+=
"modprobe vhost-net experimental_zcopytx=1"
else
:
cmd
+=
"modprobe vhost-net experimental_zcopytx=0"
if
utils
.
system
(
cmd
)
or
enable
!=
zerocp_enable_status
():
if
utils
.
system
(
cmd
)
or
enable
!=
zerocp_enable_status
():
raise
error
.
TestNAError
(
"Set vhost_net zcopytx failed"
)
error
.
context
(
"Set host vhost_net experimental_zcopytx"
,
logging
.
info
)
if
params
.
get
(
"enable_zerocp"
,
'yes'
)
==
'yes'
:
enable_zerocopytx_in_host
()
...
...
@@ -69,6 +67,6 @@ def run_zero_copy(test, params, env):
err_msg
=
"All packets lost during ping guest %s."
%
guest_ip
raise
error
.
TestFail
(
err_msg
)
#in vm.verify_alive will check whether have userspace or kernel crash
#
in vm.verify_alive will check whether have userspace or kernel crash
error
.
context
(
"Check guest is alive and have no crash"
,
logging
.
info
)
vm
.
verify_alive
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录