Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
9c09db67
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,发现更多精彩内容 >>
未验证
提交
9c09db67
编写于
4月 13, 2018
作者:
X
Xu Han
提交者:
GitHub
4月 13, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1332 from luckyh/qemu-python3-file-cmp
[qemu] Python 3: Update file() and cmp()
上级
dc467c6a
90e915b1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
12 deletion
+27
-12
qemu/tests/boot_order_check.py
qemu/tests/boot_order_check.py
+7
-0
qemu/tests/netperf_udp.py
qemu/tests/netperf_udp.py
+2
-1
qemu/tests/qemu_nobody.py
qemu/tests/qemu_nobody.py
+7
-0
qemu/tests/timedrift_monotonicity.py
qemu/tests/timedrift_monotonicity.py
+7
-9
qemu/tests/trace_cmd_boot.py
qemu/tests/trace_cmd_boot.py
+2
-1
qemu/tests/win_virtio_serial_data_transfer_reboot.py
qemu/tests/win_virtio_serial_data_transfer_reboot.py
+2
-1
未找到文件。
qemu/tests/boot_order_check.py
浏览文件 @
9c09db67
...
...
@@ -7,6 +7,13 @@ from avocado.utils import process
from
virttest
import
error_context
try
:
cmp
except
NameError
:
def
cmp
(
x
,
y
):
return
(
x
>
y
)
-
(
x
<
y
)
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
...
...
qemu/tests/netperf_udp.py
浏览文件 @
9c09db67
...
...
@@ -172,7 +172,8 @@ def run(test, params, env):
finally
:
netperf_server
.
stop
()
file
(
os
.
path
.
join
(
test
.
debugdir
,
"udp_results"
),
"w"
).
write
(
msg
)
with
open
(
os
.
path
.
join
(
test
.
debugdir
,
"udp_results"
),
"w"
)
as
result_file
:
result_file
.
write
(
msg
)
failratio
=
float
(
params
.
get
(
"failratio"
,
0.3
))
error_context
.
context
(
"Compare UDP performance."
,
logging
.
info
)
for
i
in
range
(
len
(
throughput
)
-
1
):
...
...
qemu/tests/qemu_nobody.py
浏览文件 @
9c09db67
...
...
@@ -7,6 +7,13 @@ from virttest import env_process
from
virttest
import
error_context
try
:
cmp
except
NameError
:
def
cmp
(
x
,
y
):
return
(
x
>
y
)
-
(
x
<
y
)
@
env_process
.
context_aware
def
run
(
test
,
params
,
env
):
"""
...
...
qemu/tests/timedrift_monotonicity.py
浏览文件 @
9c09db67
...
...
@@ -38,9 +38,8 @@ def run(test, params, env):
if
float
(
tv
)
<
float
(
lasttv
):
p_tv
=
"time value = "
+
tv
+
"
\n
"
p_lasttv
=
"last time value = "
+
lasttv
+
"
\n
"
time_log
=
file
(
host_path
,
'a'
)
time_log
.
write
(
"time went backwards:
\n
"
+
p_tv
+
p_lasttv
)
time_log
.
close
()
with
open
(
host_path
,
'a'
)
as
time_log
:
time_log
.
write
(
"time went backwards:
\n
"
+
p_tv
+
p_lasttv
)
lasttv
=
tv
time
.
sleep
(
0.1
)
...
...
@@ -86,12 +85,11 @@ def run(test, params, env):
log_dir
=
os
.
path
.
join
(
test
.
outputdir
,
"timedrift-monotonicity-result.txt"
)
shutil
.
copyfile
(
host_path
,
log_dir
)
myfile
=
file
(
host_path
,
'r'
)
for
line
in
myfile
:
if
"time went backwards"
in
line
:
myfile
.
close
()
test
.
fail
(
"Failed Time Monotonicity testing, "
"Please check log %s"
%
host_path
)
with
open
(
host_path
,
'r'
)
as
myfile
:
for
line
in
myfile
:
if
"time went backwards"
in
line
:
test
.
fail
(
"Failed Time Monotonicity testing, "
"Please check log %s"
%
host_path
)
finally
:
session1
.
close
()
# remove flags add for this test.
...
...
qemu/tests/trace_cmd_boot.py
浏览文件 @
9c09db67
...
...
@@ -75,7 +75,8 @@ def run(test, params, env):
logging
.
warn
(
"trace-cmd could not finish after 120s."
)
trace_job
=
None
process
.
system
(
trace_report_cmd
,
shell
=
True
)
report_txt
=
file
(
report_file
).
read
()
with
open
(
report_file
)
as
report_f
:
report_txt
=
report_f
.
read
()
txt
=
"Check whether the trace.txt includes the error log."
error_context
.
context
(
txt
,
logging
.
info
)
if
re
.
findall
(
re_trace
,
report_txt
,
re
.
S
):
...
...
qemu/tests/win_virtio_serial_data_transfer_reboot.py
浏览文件 @
9c09db67
...
...
@@ -39,7 +39,8 @@ def run(test, params, env):
def
receive_data
(
test
,
session
,
serial_receive_cmd
,
data_file
):
output
=
session
.
cmd_output
(
serial_receive_cmd
,
timeout
=
30
)
ori_data
=
file
(
data_file
,
"r"
).
read
()
with
open
(
data_file
,
"r"
)
as
data_file
:
ori_data
=
data_file
.
read
()
if
ori_data
.
strip
()
!=
output
.
strip
():
err
=
"Data lost during transfer. Origin data is:
\n
%s"
%
ori_data
err
+=
"Guest receive data:
\n
%s"
%
output
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录