Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
ef275497
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 搜索 >>
未验证
提交
ef275497
编写于
3月 20, 2020
作者:
X
Xu Tian
提交者:
GitHub
3月 20, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2122 from luckyh/drop-52lts-compat
Remove usage of 52lts compatiblity layer
上级
ae95bcfe
caf5e0a5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
42 deletion
+37
-42
qemu/tests/ksm_base.py
qemu/tests/ksm_base.py
+12
-13
qemu/tests/numa_memdev_options.py
qemu/tests/numa_memdev_options.py
+3
-3
qemu/tests/smbios_table.py
qemu/tests/smbios_table.py
+6
-7
qemu/tests/timedrift.py
qemu/tests/timedrift.py
+8
-8
qemu/tests/timerdevice_host_time_back.py
qemu/tests/timerdevice_host_time_back.py
+2
-3
qemu/tests/timerdevice_time_jump_check.py
qemu/tests/timerdevice_time_jump_check.py
+2
-3
qemu/tests/x86_cpu_model.py
qemu/tests/x86_cpu_model.py
+4
-5
未找到文件。
qemu/tests/ksm_base.py
浏览文件 @
ef275497
...
...
@@ -11,7 +11,6 @@ from avocado.utils import process
from
virttest
import
data_dir
from
virttest
import
error_context
from
virttest
import
utils_misc
from
virttest.compat_52lts
import
decode_to_text
TMPFS_OVERHEAD
=
0.0022
...
...
@@ -102,10 +101,10 @@ def run(test, params, env):
query_cmd
=
re
.
sub
(
"QEMU_PID"
,
str
(
vm
.
process
.
get_pid
()),
query_cmd
)
sharing_page_0
=
decode_to_text
(
process
.
system_output
(
query_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
))
sharing_page_0
=
process
.
run
(
query_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
).
stdout_text
if
query_regex
:
sharing_page_0
=
re
.
findall
(
query_regex
,
sharing_page_0
)[
0
]
...
...
@@ -118,10 +117,10 @@ def run(test, params, env):
_execute_allocator
(
cmd
,
vm
,
session
,
fill_timeout
)
time
.
sleep
(
120
)
sharing_page_1
=
decode_to_text
(
process
.
system_output
(
query_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
))
sharing_page_1
=
process
.
run
(
query_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
).
stdout_text
if
query_regex
:
sharing_page_1
=
re
.
findall
(
query_regex
,
sharing_page_1
)[
0
]
...
...
@@ -136,10 +135,10 @@ def run(test, params, env):
_execute_allocator
(
cmd
,
vm
,
session
,
fill_timeout
)
time
.
sleep
(
120
)
sharing_page_2
=
decode_to_text
(
process
.
system_output
(
query_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
))
sharing_page_2
=
process
.
run
(
query_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
).
stdout_text
if
query_regex
:
sharing_page_2
=
re
.
findall
(
query_regex
,
sharing_page_2
)[
0
]
...
...
qemu/tests/numa_memdev_options.py
浏览文件 @
ef275497
import
logging
import
re
from
avocado.utils
import
astring
from
avocado.utils
import
process
from
virttest
import
error_context
from
virttest
import
utils_misc
from
virttest
import
env_process
from
virttest.staging
import
utils_memory
from
virttest.compat_52lts
import
decode_to_text
from
virttest.utils_numeric
import
normalize_data_size
...
...
@@ -77,7 +77,7 @@ def check_memory_in_procfs(test, params, vm):
mem_size
=
int
(
float
(
utils_misc
.
normalize_data_size
(
mem_size
,
"K"
)))
smaps
=
process
.
system_output
(
"grep -1 %d /proc/%d/smaps"
%
(
mem_size
,
qemu_pid
))
smaps
=
decode_
to_text
(
smaps
).
strip
()
smaps
=
astring
.
to_text
(
smaps
).
strip
()
mem_path
=
memdev_params
.
get
(
"mem-path"
)
if
mem_path
and
(
mem_path
not
in
smaps
):
test
.
fail
(
"memdev = %s: mem-path '%s' is not in smaps '%s'!"
...
...
@@ -85,7 +85,7 @@ def check_memory_in_procfs(test, params, vm):
mem_start
=
smaps
.
split
(
'-'
)[
0
]
numa_maps
=
process
.
system_output
(
"grep %s /proc/%d/numa_maps"
%
(
mem_start
,
qemu_pid
))
numa_maps
=
decode_
to_text
(
numa_maps
).
strip
()
numa_maps
=
astring
.
to_text
(
numa_maps
).
strip
()
if
mem_path
and
(
mem_path
not
in
numa_maps
):
test
.
fail
(
"memdev = %s: mem-path '%s' is not in numa_maps '%s'!"
%
(
mem_dev
,
mem_path
,
numa_maps
))
...
...
qemu/tests/smbios_table.py
浏览文件 @
ef275497
...
...
@@ -6,7 +6,6 @@ from avocado.utils import process
from
virttest
import
error_context
from
virttest
import
env_process
from
virttest
import
utils_misc
from
virttest.compat_52lts
import
decode_to_text
@
error_context
.
context_aware
...
...
@@ -41,8 +40,8 @@ def run(test, params, env):
dmidecode_key
=
dmidecode_key
.
split
()
for
key
in
dmidecode_key
:
cmd
=
(
dmidecode_exp
%
(
smbios_type_number
,
key
))
default_key_para
=
decode_to_text
(
process
.
system_output
(
cmd
,
shell
=
True
).
st
rip
()
)
default_key_para
=
process
.
run
(
cmd
,
shell
=
True
).
st
dout_text
.
strip
(
)
smbios_key_para_set
=
params
.
object_params
(
sm_type
).
get
(
key
,
default_key_para
)
smbios
+=
",%s='%s'"
%
(
key
.
lower
(),
smbios_key_para_set
)
...
...
@@ -69,8 +68,8 @@ def run(test, params, env):
rhel_system_version
=
params
.
get
(
'smbios_system_version'
)
==
'rhel'
if
not
rhel_system_version
:
re_pc_lt_2
=
re
.
compile
(
r
'^pc-(i440fx-)?[01].\d+$'
)
host_dmidecode_system_version
=
decode_to_text
(
process
.
system_output
(
"dmidecode -s system-version"
))
host_dmidecode_system_version
=
process
.
run
(
"dmidecode -s system-version"
).
stdout_text
for
m_type
in
support_machine_types
:
if
m_type
in
(
"isapc"
,
"xenfv"
,
"xenpv"
):
continue
...
...
@@ -96,8 +95,8 @@ def run(test, params, env):
for
key
in
dmidecode_key
:
cmd
=
(
dmidecode_exp
%
(
smbios_type_number
,
key
))
smbios_get_para
=
session
.
cmd
(
cmd
).
strip
()
default_key_para
=
decode_to_text
(
process
.
system_output
(
cmd
,
shell
=
True
).
st
rip
()
)
default_key_para
=
process
.
run
(
cmd
,
shell
=
True
).
st
dout_text
.
strip
(
)
if
params
.
get
(
"smbios_type_disable"
,
"no"
)
==
"no"
:
smbios_set_para
=
params
.
object_params
(
sm_type
).
get
(
key
,
default_key_para
)
...
...
qemu/tests/timedrift.py
浏览文件 @
ef275497
...
...
@@ -8,7 +8,6 @@ from avocado.utils import cpu
from
virttest
import
utils_test
from
virttest
import
utils_time
from
virttest.compat_52lts
import
decode_to_text
def
run
(
test
,
params
,
env
):
...
...
@@ -40,17 +39,18 @@ def run(test, params, env):
:param mask: The CPU affinity mask.
:return: A dict containing the previous mask for each thread.
"""
tids
=
decode_to_text
(
process
.
system_output
(
"ps -L --pid=%s -o lwp="
%
pid
,
verbose
=
False
,
ignore_status
=
True
)).
split
()
tids
=
process
.
run
(
"ps -L --pid=%s -o lwp="
%
pid
,
verbose
=
False
,
ignore_status
=
True
).
stdout_text
.
split
()
prev_masks
=
{}
for
tid
in
tids
:
prev_mask
=
decode_to_text
(
process
.
system_output
(
"taskset -p %s"
%
tid
,
verbose
=
False
))
.
split
()[
-
1
]
prev_mask
=
process
.
run
(
"taskset -p %s"
%
tid
,
verbose
=
False
).
stdout_text
.
split
()[
-
1
]
prev_masks
[
tid
]
=
prev_mask
process
.
system
(
"taskset -p %s %s"
%
(
mask
,
tid
),
verbose
=
False
)
children
=
decode_to_text
(
process
.
system_output
(
"ps --ppid=%s -o pid="
%
pid
,
verbose
=
False
,
ignore_status
=
True
))
.
split
()
children
=
process
.
run
(
"ps --ppid=%s -o pid="
%
pid
,
verbose
=
False
,
ignore_status
=
True
).
stdout_text
.
split
()
for
child
in
children
:
prev_masks
.
update
(
set_cpu_affinity
(
child
,
mask
))
return
prev_masks
...
...
qemu/tests/timerdevice_host_time_back.py
浏览文件 @
ef275497
...
...
@@ -5,7 +5,6 @@ import logging
from
avocado.utils
import
process
from
virttest
import
error_context
from
virttest.compat_52lts
import
decode_to_text
@
error_context
.
context_aware
...
...
@@ -37,7 +36,7 @@ def run(test, params, env):
error_context
.
context
(
"Check time difference between host and guest"
,
logging
.
info
)
guest_timestr_
=
session
.
cmd_output
(
epoch_time_cmd
,
timeout
=
120
)
host_timestr_
=
decode_to_text
(
process
.
system_output
(
epoch_time_cmd
,
shell
=
True
))
host_timestr_
=
process
.
run
(
epoch_time_cmd
,
shell
=
True
).
stdout_text
host_epoch_time_
,
guest_epoch_time_
=
map
(
lambda
x
:
re
.
findall
(
r
"epoch:\s+(\d+)"
,
x
)[
0
],
[
host_timestr_
,
guest_timestr_
])
real_difference_
=
abs
(
int
(
host_epoch_time_
)
-
int
(
guest_epoch_time_
))
...
...
@@ -59,7 +58,7 @@ def run(test, params, env):
session
.
close
()
except
Exception
:
test
.
error
(
"Guest error after set host system time back"
)
host_timestr
=
decode_to_text
(
process
.
system_output
(
epoch_time_cmd
,
shell
=
True
))
host_timestr
=
process
.
run
(
epoch_time_cmd
,
shell
=
True
).
stdout_text
host_epoch_time
,
guest_epoch_time
=
map
(
lambda
x
:
re
.
findall
(
r
"epoch:\s+(\d+)"
,
x
)[
0
],
[
host_timestr
,
guest_timestr
])
real_difference
=
abs
(
int
(
host_epoch_time
)
-
int
(
guest_epoch_time
))
...
...
qemu/tests/timerdevice_time_jump_check.py
浏览文件 @
ef275497
...
...
@@ -2,7 +2,6 @@ import logging
import
time
from
virttest
import
error_context
from
virttest.compat_52lts
import
decode_to_text
from
avocado.utils
import
process
...
...
@@ -32,8 +31,8 @@ def run(test, params, env):
error_context
.
context
(
"Pin every vcpu to physical cpu"
,
logging
.
info
)
host_cpu_cnt_cmd
=
params
[
"host_cpu_cnt_cmd"
]
host_cpu_num
=
decode_to_text
(
process
.
system_output
(
host_cpu_cnt_cmd
,
shell
=
True
))
.
strip
()
host_cpu_num
=
process
.
run
(
host_cpu_cnt_cmd
,
shell
=
True
).
stdout_text
.
strip
()
host_cpu_list
=
(
_
for
_
in
range
(
int
(
host_cpu_num
)))
if
len
(
vm
.
vcpu_threads
)
>
int
(
host_cpu_num
):
host_cpu_list
=
[]
...
...
qemu/tests/x86_cpu_model.py
浏览文件 @
ef275497
...
...
@@ -4,7 +4,6 @@ import json
from
avocado.utils
import
cpu
,
process
from
virttest
import
error_context
,
utils_misc
,
env_process
from
virttest.compat_52lts
import
decode_to_text
@
error_context
.
context_aware
...
...
@@ -28,10 +27,10 @@ def run(test, params, env):
'{"execute": "quit"}'
]
cmd
=
"echo -e '{0}' | {1} -qmp stdio -vnc none -M none | grep return |"
\
"grep RAND91"
.
format
(
r
"\n"
.
join
(
qmp_cmds
),
qemu_binary
)
output
=
decode_to_text
(
process
.
system_output
(
cmd
,
timeout
=
10
,
ignore_status
=
True
,
shell
=
True
,
verbose
=
False
))
output
=
process
.
run
(
cmd
,
timeout
=
10
,
ignore_status
=
True
,
shell
=
True
,
verbose
=
False
).
stdout_text
out
=
json
.
loads
(
output
)[
"return"
]
model
=
params
[
"model"
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录