Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
1cfba46a
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,发现更多精彩内容 >>
未验证
提交
1cfba46a
编写于
1月 03, 2018
作者:
B
Balamuruhan S
提交者:
GitHub
1月 03, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1178 from huangyum/numa_1503402
numa_basic: Check node free memory before test
上级
c5b5aa59
bd70448c
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
13 deletion
+14
-13
qemu/tests/numa_basic.py
qemu/tests/numa_basic.py
+14
-13
未找到文件。
qemu/tests/numa_basic.py
浏览文件 @
1cfba46a
import
logging
import
logging
from
autotest.client.shared
import
error
from
virttest
import
env_process
from
virttest
import
env_process
from
virttest
import
utils_misc
from
virttest
import
utils_misc
from
virttest
import
utils_test
from
virttest
import
utils_test
from
virttest
import
error_context
from
virttest.staging
import
utils_memory
from
virttest.staging
import
utils_memory
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
def
run
(
test
,
params
,
env
):
"""
"""
Qemu numa basic test:
Qemu numa basic test:
...
@@ -23,23 +22,27 @@ def run(test, params, env):
...
@@ -23,23 +22,27 @@ def run(test, params, env):
:param params: Dictionary with the test parameters
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
:param env: Dictionary with test environment.
"""
"""
error
.
context
(
"Get host numa topological structure"
,
logging
.
info
)
error
_context
.
context
(
"Get host numa topological structure"
,
logging
.
info
)
timeout
=
float
(
params
.
get
(
"login_timeout"
,
240
))
timeout
=
float
(
params
.
get
(
"login_timeout"
,
240
))
host_numa_node
=
utils_misc
.
NumaInfo
()
host_numa_node
=
utils_misc
.
NumaInfo
()
node_list
=
host_numa_node
.
online_nodes
node_list
=
host_numa_node
.
online_nodes
for
node_id
in
node_list
:
for
node_id
in
node_list
:
error
.
base_context
(
"Bind qemu process to numa node %s"
%
node_id
,
error
_context
.
base_context
(
"Bind qemu process to numa node %s"
%
node_id
,
logging
.
info
)
logging
.
info
)
vm
=
"vm_bind_to_%s"
%
node_id
vm
=
"vm_bind_to_%s"
%
node_id
params
[
'qemu_command_prefix'
]
=
"numactl --cpunodebind=%s"
%
node_id
params
[
'qemu_command_prefix'
]
=
"numactl --cpunodebind=%s"
%
node_id
utils_memory
.
drop_caches
()
utils_memory
.
drop_caches
()
node_MemFree
=
int
(
host_numa_node
.
read_from_node_meminfo
(
node_id
,
"MemFree"
))
if
node_MemFree
<
int
(
params
[
"mem"
])
*
1024
:
test
.
cancel
(
"No enough free memory in node %d."
%
node_id
)
env_process
.
preprocess_vm
(
test
,
params
,
env
,
vm
)
env_process
.
preprocess_vm
(
test
,
params
,
env
,
vm
)
vm
=
env
.
get_vm
(
vm
)
vm
=
env
.
get_vm
(
vm
)
vm
.
verify_alive
()
vm
.
verify_alive
()
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
session
.
close
()
session
.
close
()
error
.
context
(
"Check the memory use status of qemu process"
,
error
_context
.
context
(
"Check the memory use status of qemu process"
,
logging
.
info
)
logging
.
info
)
memory_status
,
_
=
utils_test
.
qemu
.
get_numa_status
(
host_numa_node
,
memory_status
,
_
=
utils_test
.
qemu
.
get_numa_status
(
host_numa_node
,
vm
.
get_pid
())
vm
.
get_pid
())
...
@@ -52,9 +55,7 @@ def run(test, params, env):
...
@@ -52,9 +55,7 @@ def run(test, params, env):
logging
.
debug
(
"Qemu used %s pages in node"
logging
.
debug
(
"Qemu used %s pages in node"
" %s"
%
(
memory_status
[
index
],
node_list
[
index
]))
" %s"
%
(
memory_status
[
index
],
node_list
[
index
]))
if
node_used_most
!=
node_id
:
if
node_used_most
!=
node_id
:
raise
error
.
TestFail
(
"Qemu still use memory from other node."
test
.
fail
(
"Qemu still use memory from other node. "
" Expect: %s, used: %s"
%
(
node_id
,
"Expect: %s, used: %s"
%
(
node_id
,
node_used_most
))
node_used_most
))
error_context
.
context
(
"Destroy guest."
,
logging
.
info
)
error
.
context
(
"Destroy guest."
,
logging
.
info
)
vm
.
destroy
()
vm
.
destroy
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录