Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
f34e602f
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,发现更多精彩内容 >>
提交
f34e602f
编写于
10月 28, 2016
作者:
Z
Zhengtong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add windows guest agent installation method
上级
e2d83abe
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
108 addition
and
0 deletion
+108
-0
qemu/deps/windows_ga_install/get_package.py
qemu/deps/windows_ga_install/get_package.py
+102
-0
qemu/tests/cfg/qemu_guest_agent.cfg
qemu/tests/cfg/qemu_guest_agent.cfg
+1
-0
qemu/tests/qemu_guest_agent.py
qemu/tests/qemu_guest_agent.py
+5
-0
未找到文件。
qemu/deps/windows_ga_install/get_package.py
0 → 100644
浏览文件 @
f34e602f
#!/bin/env python
import
sys
import
re
import
commands
from
argparse
import
ArgumentParser
class
GuestAgentPkg
(
object
):
"""
A guest agent package class
"""
def
__init__
(
self
,
build_tag
,
build_name
,
url
,
authtype
=
''
,
server
=
''
,
topdir
=
''
,
weburl
=
''
,
topurl
=
''
):
self
.
build_tag
=
build_tag
self
.
build_name
=
build_name
self
.
server_url
=
url
self
.
authtype
=
authtype
self
.
server
=
server
self
.
topdir
=
topdir
self
.
weburl
=
weburl
self
.
topurl
=
topurl
def
_run_brew_cmd
(
self
,
cmd
):
brew_cmd
=
'brew '
if
self
.
authtype
:
brew_cmd
+=
'--authtype=%s '
%
self
.
authtype
if
self
.
server
:
brew_cmd
+=
'--server=%s '
%
self
.
server
if
self
.
topdir
:
brew_cmd
+=
'--topdir=%s '
%
self
.
topdir
if
self
.
weburl
:
brew_cmd
+=
'--weburl=%s '
%
self
.
weburl
if
self
.
topurl
:
brew_cmd
+=
'--topurl=%s '
%
self
.
topurl
brew_cmd
+=
cmd
(
status
,
output
)
=
commands
.
getstatusoutput
(
brew_cmd
)
if
status
:
raise
Exception
(
"the cmd %s didn't run successfully"
%
brew_cmd
)
return
(
status
,
output
)
def
get_latest_build
(
self
):
cmd
=
'latest-build %s %s'
%
(
self
.
build_tag
,
self
.
build_name
)
(
status
,
output
)
=
self
.
_run_brew_cmd
(
cmd
)
for
line
in
output
.
splitlines
():
if
self
.
build_name
in
line
:
return
line
.
split
()[
0
]
raise
Exception
(
"didn't get latest build name"
)
def
get_build_url
(
self
):
build_name
=
self
.
get_latest_build
()
cmd
=
'buildinfo %s | grep msi'
%
build_name
(
status
,
output
)
=
self
.
_run_brew_cmd
(
cmd
)
url_list
=
[]
for
package
in
output
.
splitlines
():
url
=
re
.
sub
(
r
'/mnt/redhat'
,
self
.
server_url
,
package
)
url_list
.
append
(
url
)
return
url_list
def
download_package
(
self
):
url_list
=
self
.
get_build_url
()
if
not
url_list
:
raise
Exception
(
"url list is empty"
)
cmd
=
"wget %s -P /tmp/"
for
url
in
url_list
:
(
status
,
output
)
=
commands
.
getstatusoutput
(
cmd
%
url
)
if
status
:
raise
Exception
(
"the download from %s didn't run successfully"
%
url
)
print
(
"
\033
[32m %s download successfully
\033
[0m"
%
url
)
def
parse_params
(
program
):
"""
parse the params passed to the application
"""
parser
=
ArgumentParser
(
prog
=
program
)
option_list
=
[(
'build_tag'
,
"the tag of the build"
),
(
'build_name'
,
"the name of the build"
)]
brew_conf_list
=
[(
'-s'
,
'--server'
,
"url of XMLRPC server"
),
(
'-a'
,
'--authtype'
,
"the type of authentication"
),
(
'-t'
,
'--topdir'
,
"specify topdir"
),
(
'-w'
,
'--weburl'
,
"url of the Koji web interface"
),
(
'-T'
,
'--topurl'
,
"url for Koji file access"
)]
for
option
in
option_list
:
parser
.
add_argument
(
dest
=
option
[
0
],
help
=
option
[
1
])
for
brew_conf
in
brew_conf_list
:
parser
.
add_argument
(
brew_conf
[
0
],
brew_conf
[
1
],
help
=
brew_conf
[
2
])
parser
.
add_argument
(
'-u'
,
'--url'
,
required
=
True
,
dest
=
'download_url'
,
help
=
'the server url which we can download package'
)
return
parser
.
parse_args
()
if
__name__
==
'__main__'
:
args
=
parse_params
(
sys
.
argv
[
0
])
guestagent
=
GuestAgentPkg
(
args
.
build_tag
,
args
.
build_name
,
args
.
download_url
,
args
.
authtype
,
args
.
server
,
args
.
topdir
,
args
.
weburl
,
args
.
topurl
)
guestagent
.
download_package
()
qemu/tests/cfg/qemu_guest_agent.cfg
浏览文件 @
f34e602f
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
gagent_name = "org.qemu.guest_agent.0"
gagent_name = "org.qemu.guest_agent.0"
gagent_install_cmd = "rpm -q qemu-guest-agent || yum install -y qemu-guest-agent"
gagent_install_cmd = "rpm -q qemu-guest-agent || yum install -y qemu-guest-agent"
Windows:
Windows:
deps = no
i386:
i386:
qemu_ga_pkg = qemu-ga-x86.msi
qemu_ga_pkg = qemu-ga-x86.msi
x86_64:
x86_64:
...
...
qemu/tests/qemu_guest_agent.py
浏览文件 @
f34e602f
...
@@ -13,6 +13,7 @@ from avocado.utils import process
...
@@ -13,6 +13,7 @@ from avocado.utils import process
from
virttest
import
guest_agent
from
virttest
import
guest_agent
from
virttest
import
utils_misc
from
virttest
import
utils_misc
from
virttest
import
env_process
from
virttest
import
env_process
from
virttest
import
data_dir
class
BaseVirtTest
(
object
):
class
BaseVirtTest
(
object
):
...
@@ -757,7 +758,11 @@ class QemuGuestAgentBasicCheckWin(QemuGuestAgentBasicCheck):
...
@@ -757,7 +758,11 @@ class QemuGuestAgentBasicCheckWin(QemuGuestAgentBasicCheck):
@
error
.
context_aware
@
error
.
context_aware
def
setup_gagent_in_host
(
self
,
params
,
vm
):
def
setup_gagent_in_host
(
self
,
params
,
vm
):
error
.
context
(
"download qemu-ga.msi to host"
,
logging
.
info
)
error
.
context
(
"download qemu-ga.msi to host"
,
logging
.
info
)
deps
=
params
[
"deps"
]
gagent_download_cmd
=
params
[
"gagent_download_cmd"
]
gagent_download_cmd
=
params
[
"gagent_download_cmd"
]
if
deps
==
"yes"
:
deps_dir
=
data_dir
.
get_deps_dir
(
"windows_ga_install"
)
gagent_download_cmd
=
gagent_download_cmd
%
deps_dir
utils
.
run
(
gagent_download_cmd
,
utils
.
run
(
gagent_download_cmd
,
float
(
params
.
get
(
"login_timeout"
,
360
)))
float
(
params
.
get
(
"login_timeout"
,
360
)))
gagent_host_path
=
params
[
"gagent_host_path"
]
gagent_host_path
=
params
[
"gagent_host_path"
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录