Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
93dcd1d8
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 搜索 >>
提交
93dcd1d8
编写于
2月 19, 2020
作者:
M
Micky Yun Chan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
induce throttling by opening chardev but not reading data from it
Signed-off-by:
N
Micky Yun Chan
<
michan@redhat.com
>
上级
2a5fa2ba
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
70 addition
and
0 deletion
+70
-0
qemu/tests/cfg/virtio_serial_throttling.cfg
qemu/tests/cfg/virtio_serial_throttling.cfg
+5
-0
qemu/tests/virtio_serial_throttling.py
qemu/tests/virtio_serial_throttling.py
+65
-0
未找到文件。
qemu/tests/cfg/virtio_serial_throttling.cfg
0 → 100644
浏览文件 @
93dcd1d8
- virtio_serial_throttling:
type = virtio_serial_throttling
serials += ' vs1 '
serial_type_vs1 = virtserialport
chardev_backend_vs1 = unix_socket
qemu/tests/virtio_serial_throttling.py
0 → 100644
浏览文件 @
93dcd1d8
import
logging
from
virttest
import
error_context
,
env_process
from
virttest.utils_virtio_port
import
VirtioPortTest
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Induce throttling by opening chardev but not reading data from it:
1) Start guest with virtio-serial with unix option
2) On the host, open the chardev but don't read from it
3) In the guest, write to the virtio-serial port.
4) transfer data from host to guest but do not read in guest
5) repeat step 1 to 4 with tcp option.
:param test: QEMU test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
@
error_context
.
context_aware
def
send_data_from_guest_to_host
():
session
=
vm
.
wait_for_login
()
port
.
open
()
error_context
.
context
(
"send data from guest to host"
,
logging
.
info
)
if
params
[
'os_type'
]
==
'windows'
:
vport_name
=
'
\\\\
.
\\
Global
\\
'
+
port
.
name
cmd
=
'dd if=/dev/zero of=%s bs=1024 count=1'
%
vport_name
else
:
cmd
=
'dd if=/dev/zero of=/dev/virtio-ports/%s bs=1024 count=1'
%
port
.
name
session
.
cmd
(
cmd
)
session
.
close
()
@
error_context
.
context_aware
def
send_data_from_host_to_guest
():
port
.
open
()
error_context
.
context
(
"send data from host to guest"
,
logging
.
info
)
data
=
'Hello world
\n
'
*
100
data
=
data
.
encode
()
port
.
sock
.
send
(
data
)
guest_worker
.
cmd
(
"virt.open('%s')"
%
port
.
name
)
serial_id
=
params
.
objects
(
'serials'
)[
-
1
]
try
:
virtio_test
=
VirtioPortTest
(
test
,
env
,
params
)
(
vm
,
guest_worker
,
port
)
=
virtio_test
.
get_vm_with_single_port
()
vm
.
verify_alive
()
send_data_from_guest_to_host
()
send_data_from_host_to_guest
()
vm
.
verify_alive
()
finally
:
virtio_test
.
cleanup
()
vm
.
destroy
()
params
[
'chardev_backend_%s'
%
serial_id
]
=
'tcp_socket'
vm_name
=
params
[
'main_vm'
]
env_process
.
preprocess_vm
(
test
,
params
,
env
,
vm_name
)
try
:
virtio_test
=
VirtioPortTest
(
test
,
env
,
params
)
(
vm
,
guest_worker
,
port
)
=
virtio_test
.
get_vm_with_single_port
()
vm
.
verify_alive
()
send_data_from_guest_to_host
()
send_data_from_host_to_guest
()
vm
.
verify_alive
()
finally
:
virtio_test
.
cleanup
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录