Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
dc467c6a
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,发现更多精彩内容 >>
未验证
提交
dc467c6a
编写于
4月 13, 2018
作者:
X
Xu Han
提交者:
GitHub
4月 13, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1325 from hereischen/4-python3-commands
Python 3: [generic] replaced commands
上级
3a7fbb86
7a893589
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
16 deletion
+30
-16
generic/tests/jumbo.py
generic/tests/jumbo.py
+5
-3
generic/tests/netperf.py
generic/tests/netperf.py
+16
-6
generic/tests/ntttcp.py
generic/tests/ntttcp.py
+5
-3
generic/tests/trans_hugepage_relocated.py
generic/tests/trans_hugepage_relocated.py
+4
-4
未找到文件。
generic/tests/jumbo.py
浏览文件 @
dc467c6a
import
logging
import
commands
import
random
from
avocado.utils
import
process
...
...
@@ -177,7 +176,9 @@ def run(test, params, env):
logging
.
info
(
"Waiting for the MTU to be OK"
)
wait_mtu_ok
=
10
if
not
utils_misc
.
wait_for
(
is_mtu_ok
,
wait_mtu_ok
,
0
,
1
):
logging
.
debug
(
commands
.
getoutput
(
"ifconfig -a"
))
logging
.
debug
(
process
.
system_output
(
"ifconfig -a"
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
))
test
.
error
(
"MTU is not as expected even after %s "
"seconds"
%
wait_mtu_ok
)
...
...
@@ -198,7 +199,8 @@ def run(test, params, env):
session
.
close
()
grep_cmd
=
"grep '%s.*%s' /proc/net/arp"
%
(
guest_ip
,
ifname
)
if
process
.
system
(
grep_cmd
,
shell
=
True
)
==
'0'
:
process
.
run
(
"arp -d %s -i %s"
%
(
guest_ip
,
ifname
))
process
.
run
(
"arp -d %s -i %s"
%
(
guest_ip
,
ifname
),
shell
=
True
)
logging
.
info
(
"Removing the temporary ARP entry successfully"
)
logging
.
info
(
"Change back Bridge NICs MTU to %s"
%
mtu_default
)
...
...
generic/tests/netperf.py
浏览文件 @
dc467c6a
import
logging
import
os
import
commands
import
threading
import
re
import
time
...
...
@@ -205,8 +204,12 @@ def run(test, params, env):
restart_network
=
True
)
server_ctl_ip
=
vm
.
wait_for_get_address
(
1
,
timeout
=
5
)
logging
.
debug
(
commands
.
getoutput
(
"numactl --hardware"
))
logging
.
debug
(
commands
.
getoutput
(
"numactl --show"
))
logging
.
debug
(
process
.
system_output
(
"numactl --hardware"
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
))
logging
.
debug
(
process
.
system_output
(
"numactl --show"
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
))
# pin guest vcpus/memory/vhost threads to last numa node of host by default
numa_node
=
_pin_vm_threads
(
vm
,
params
.
get
(
"numa_node"
))
...
...
@@ -339,13 +342,18 @@ def start_test(server, server_ctl, host, clients, resultsdir, test_duration=60,
fd
=
open
(
"%s/netperf-result.%s.RHS"
%
(
resultsdir
,
time
.
time
()),
"w"
)
test
.
write_test_keyval
({
'kvm-userspace-ver'
:
commands
.
getoutput
(
ver_cmd
).
strip
()})
process
.
system_output
(
ver_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
).
strip
()})
test
.
write_test_keyval
({
'guest-kernel-ver'
:
ssh_cmd
(
server_ctl
,
guest_ver_cmd
).
strip
()})
test
.
write_test_keyval
({
'session-length'
:
test_duration
})
fd
.
write
(
'### kvm-userspace-ver : %s
\n
'
%
commands
.
getoutput
(
ver_cmd
).
strip
())
process
.
system_output
(
ver_cmd
,
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
).
strip
())
fd
.
write
(
'### guest-kernel-ver : %s
\n
'
%
ssh_cmd
(
server_ctl
,
guest_ver_cmd
).
strip
())
fd
.
write
(
'### kvm_version : %s
\n
'
%
os
.
uname
()[
2
])
...
...
@@ -436,7 +444,9 @@ def start_test(server, server_ctl, host, clients, resultsdir, test_duration=60,
fd
.
flush
()
logging
.
debug
(
"Remove temporary files"
)
commands
.
getoutput
(
"rm -f /tmp/netperf.%s.nf"
%
ret
[
'pid'
])
process
.
system_output
(
"rm -f /tmp/netperf.%s.nf"
%
ret
[
'pid'
],
verbose
=
False
,
ignore_status
=
True
,
shell
=
True
)
logging
.
info
(
"Netperf thread completed successfully"
)
fd
.
close
()
...
...
generic/tests/ntttcp.py
浏览文件 @
dc467c6a
...
...
@@ -2,7 +2,6 @@ import logging
import
os
import
glob
import
re
import
commands
import
aexpect
...
...
@@ -182,8 +181,11 @@ def run(test, params, env):
raw
=
" buf(k)| throughput(Mbit/s)"
logging
.
info
(
raw
)
f
.
write
(
"#ver# %s
\n
#ver# host kernel: %s
\n
"
%
(
commands
.
getoutput
(
"rpm -q qemu-kvm"
),
os
.
uname
()[
2
]))
desc
=
"""#desc# The tests are sessions of "NTttcp", send buf number is %s. 'throughput' was taken from ntttcp's report.
(
process
.
system_output
(
"rpm -q qemu-kvm"
,
shell
=
True
,
verbose
=
False
,
ignore_status
=
True
),
os
.
uname
()[
2
]))
desc
=
"""#desc# The tests are sessions of "NTttcp", send buf"
" number is %s. 'throughput' was taken from ntttcp's report.
#desc# How to read the results:
#desc# - The Throughput is measured in Mbit/sec.
#desc#
...
...
generic/tests/trans_hugepage_relocated.py
浏览文件 @
dc467c6a
import
logging
import
time
import
commands
import
os
import
re
from
avocado.utils
import
process
from
virttest
import
utils_test
from
virttest.staging
import
utils_memory
...
...
@@ -56,7 +56,7 @@ def run(test, params, env):
# Get dd speed in host
start_time
=
time
.
time
()
cmd
=
"dd if=/dev/urandom of=/tmp/speed_test bs=4K count=256"
s
,
o
=
commands
.
getstatusoutput
(
cmd
)
process
.
run
(
cmd
,
verbose
=
False
,
shell
=
True
)
end_time
=
time
.
time
()
dd_timeout
=
vmsm
*
(
end_time
-
start_time
)
*
2
nr_hugepages
=
[]
...
...
@@ -100,11 +100,11 @@ def run(test, params, env):
cmd
=
"for i in `seq %s`; do dd if=/dev/urandom of=/space/$i"
%
count
cmd
+=
" bs=4K count=1 & done"
logging
.
info
(
"Start to make fragment in host"
)
s
,
o
=
commands
.
getstatusoutput
(
cmd
)
s
=
process
.
system
(
cmd
,
verbose
=
False
,
shell
=
True
)
if
s
!=
0
:
test
.
error
(
"Can not dd in host"
)
finally
:
s
,
o
=
commands
.
getstatusoutput
(
"umount /space"
)
process
.
run
(
"umount /space"
,
verbose
=
False
,
shell
=
True
)
bg
=
utils_test
.
BackgroundTest
(
nr_hugepage_check
,
(
s_time
,
w_time
))
bg
.
start
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录