Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
0d461bc4
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,发现更多精彩内容 >>
提交
0d461bc4
编写于
9月 20, 2012
作者:
V
Vimal Patel
提交者:
Lucas Meneghel Rodrigues
10月 08, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virt.spice: Adding the full screen option for the Remote-Viewer Test
Signed-off-by:
N
Vimal Patel
<
vipatel@redhat.com
>
上级
b6f9079d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
17 deletion
+23
-17
tests/rv_connect.py
tests/rv_connect.py
+23
-17
未找到文件。
tests/rv_connect.py
浏览文件 @
0d461bc4
...
...
@@ -5,9 +5,9 @@ Requires: binaries remote-viewer, Xorg, netstat
Use example kickstart RHEL-6-spice.ks
"""
import
logging
,
os
,
time
from
virttest.aexpect
import
ShellCmdError
from
virttest
import
utils_misc
,
remote
import
logging
,
os
from
virttest.aexpect
import
ShellCmdError
,
ShellStatusError
from
virttest
import
utils_misc
,
utils_spice
,
remote
class
RVConnectError
(
Exception
):
...
...
@@ -28,15 +28,6 @@ def send_ticket(client_vm, ticket):
client_vm
.
send_key
(
"kp_enter"
)
# send enter
def
wait_timeout
(
timeout
=
5
):
"""
time.sleep(timeout) + logging.debug(timeout)
@param timeout=5
"""
logging
.
debug
(
"Waiting (timeout=%ss)"
,
timeout
)
time
.
sleep
(
timeout
)
def
verify_established
(
client_session
,
host
,
port
,
rv_binary
):
"""
Parses netstat output for established connection on host:port
...
...
@@ -98,6 +89,7 @@ def launch_rv(client_vm, guest_vm, params):
rv_binary
=
params
.
get
(
"rv_binary"
,
"remote-viewer"
)
host_ip
=
utils_misc
.
get_host_ip_address
(
params
)
host_port
=
None
full_screen
=
params
.
get
(
"full_screen"
)
display
=
params
.
get
(
"display"
)
cmd
=
rv_binary
+
" --display=:0.0"
ticket
=
None
...
...
@@ -142,26 +134,40 @@ def launch_rv(client_vm, guest_vm, params):
else
:
raise
Exception
(
"Unsupported display value"
)
# Check to see if the test is using the full screen option.
if
full_screen
==
"yes"
:
logging
.
info
(
"Remote Viewer Set to use Full Screen"
)
cmd
+=
" --full-screen"
cmd
=
"nohup "
+
cmd
+
" &> /dev/null &"
# Launch it on background
# Launching the actual set of commands
try
:
client_session
.
cmd
(
"startx &"
,
timeout
=
15
)
except
ShellCmdError
:
except
(
ShellCmdError
,
ShellStatusError
)
:
logging
.
debug
(
"Ignoring an Exception that Occurs from calling startx"
)
wait_timeout
(
15
)
print_rv_version
(
client_session
,
rv_binary
)
utils_spice
.
wait_timeout
(
15
)
try
:
print_rv_version
(
client_session
,
rv_binary
)
except
ShellStatusError
:
# Sometimes It fails with Status error, ingore it and continue.
# It's not that important to have printed versions in the log.
logging
.
debug
(
"Ignoring a Status Exception that occurs from calling "
\
+
"print versions of remote-viewer or spice-gtk"
)
logging
.
info
(
"Launching %s on the client (virtual)"
,
cmd
)
client_session
.
cmd
(
cmd
)
# client waits for user entry (authentication) if spice_password is set
if
ticket
:
wait_timeout
(
)
# Wait for remote-viewer to launch
utils_spice
.
wait_timeout
(
5
)
# Wait for remote-viewer to launch
send_ticket
(
client_vm
,
ticket
)
wait_timeout
(
)
# Wait for conncetion to establish
utils_spice
.
wait_timeout
(
5
)
# Wait for conncetion to establish
verify_established
(
client_session
,
host_ip
,
host_port
,
rv_binary
)
#prevent from kill remote-viewer after test finish
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录