Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
c1b0252f
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,发现更多精彩内容 >>
未验证
提交
c1b0252f
编写于
4月 03, 2018
作者:
X
Xu Han
提交者:
GitHub
4月 03, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1287 from luckyh/replace-autotest-qemu-p3
[qemu] Replace autotest modules - de
上级
fa83fcad
19dd7a70
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
92 addition
and
100 deletion
+92
-100
qemu/tests/device_bit_check.py
qemu/tests/device_bit_check.py
+10
-12
qemu/tests/disable_win_update.py
qemu/tests/disable_win_update.py
+3
-12
qemu/tests/drive_mirror.py
qemu/tests/drive_mirror.py
+11
-11
qemu/tests/drive_mirror_cancel.py
qemu/tests/drive_mirror_cancel.py
+14
-9
qemu/tests/drive_mirror_complete.py
qemu/tests/drive_mirror_complete.py
+4
-5
qemu/tests/drive_mirror_powerdown.py
qemu/tests/drive_mirror_powerdown.py
+5
-6
qemu/tests/drive_mirror_simple.py
qemu/tests/drive_mirror_simple.py
+16
-12
qemu/tests/driver_in_use.py
qemu/tests/driver_in_use.py
+4
-6
qemu/tests/eject_media.py
qemu/tests/eject_media.py
+17
-17
qemu/tests/enforce_quit.py
qemu/tests/enforce_quit.py
+8
-10
未找到文件。
qemu/tests/device_bit_check.py
浏览文件 @
c1b0252f
import
logging
import
re
from
autotest.client.shared
import
error
from
virttest
import
error_context
from
virttest
import
env_process
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Device bit check test:
...
...
@@ -45,8 +44,8 @@ def run(test, params, env):
else
:
properties
=
default_value
error
.
context
(
"Boot up guest with properites: %s value as: %s"
%
(
str
(
options
),
properties
),
logging
.
info
)
error
_context
.
context
(
"Boot up guest with properites: %s value as: %s"
%
(
str
(
options
),
properties
),
logging
.
info
)
vm_name
=
params
[
"main_vm"
]
params
[
"start_vm"
]
=
'yes'
env_process
.
preprocess_vm
(
test
,
params
,
env
,
vm_name
)
...
...
@@ -57,27 +56,26 @@ def run(test, params, env):
qtree_info
=
vm
.
monitor
.
info
(
"qtree"
)
dev_info
=
re
.
findall
(
dev_pattern
,
qtree_info
,
re
.
S
)
if
not
dev_info
:
raise
error
.
TestE
rror
(
"Can't get device info from qtree result."
)
test
.
e
rror
(
"Can't get device info from qtree result."
)
for
index
,
option
in
enumerate
(
options
):
option_regex
=
"%s\s+=\s+(\w+)"
%
option
option_value
=
re
.
findall
(
option_regex
,
dev_info
[
0
],
re
.
M
)
if
not
option_value
:
logging
.
debug
(
"dev info in qtree: %s"
%
dev_info
[
0
])
raise
error
.
TestError
(
"Can't get the property info from qtree"
" result"
)
test
.
error
(
"Can't get the property info from qtree result"
)
if
option_value
[
0
]
not
in
convert_dict
[
properties
[
index
]]:
msg
=
"'%s' value get '%s', "
%
(
option
,
option_value
)
msg
+=
"expect value '%s'"
%
convert_dict
[
properties
[
index
]]
logging
.
debug
(
msg
)
raise
error
.
TestF
ail
(
"Properity bit for %s is wrong."
%
option
)
test
.
f
ail
(
"Properity bit for %s is wrong."
%
option
)
logging
.
info
(
"Properity bit in qtree is right for %s."
%
option
)
if
params
.
get
(
"check_in_guest"
,
"yes"
)
==
"yes"
:
pci_info
=
session
.
cmd_output
(
"lspci"
)
pci_n
=
re
.
findall
(
pci_id_pattern
,
pci_info
)
if
not
pci_n
:
raise
error
.
TestE
rror
(
"Can't get the pci id for device"
)
test
.
e
rror
(
"Can't get the pci id for device"
)
cmd
=
"cat /sys/bus/pci/devices/0000:%s/"
%
pci_n
[
0
]
cmd
+=
"virtio*/features"
bitstr
=
session
.
cmd_output
(
cmd
)
...
...
@@ -87,8 +85,8 @@ def run(test, params, env):
msg
=
"bit string in guest: %s"
%
bitstr
msg
+=
"expect bit string: %s"
%
properties
[
index
]
logging
.
debug
(
msg
)
raise
error
.
TestF
ail
(
"Properity bit for %s is wrong"
" inside guest."
%
option
)
test
.
f
ail
(
"Properity bit for %s is wrong"
" inside guest."
%
option
)
logging
.
info
(
"Properity bit in qtree is right for %s"
" in guest."
%
option
)
session
.
close
()
...
...
qemu/tests/disable_win_update.py
浏览文件 @
c1b0252f
import
re
import
logging
from
virttest
import
utils_misc
# Make it work under both autotest-framework and avocado-framework
try
:
from
avocado.core
import
exceptions
except
ImportError
:
from
autotest.client.shared
import
error
as
exceptions
try
:
from
virttest
import
error_context
except
ImportError
:
from
autotest.client.shared
import
error
as
error_context
from
virttest
import
error_context
from
virttest
import
utils_misc
@
error_context
.
context_aware
...
...
@@ -48,7 +39,7 @@ def run(test, params, env):
status
=
utils_misc
.
wait_for
(
lambda
:
disable_win_service
(
session
,
scname
),
timeout
=
cmd_timeout
)
if
not
status
:
raise
exceptions
.
TestF
ail
(
"Turn off updates service failed."
)
test
.
f
ail
(
"Turn off updates service failed."
)
session
=
vm
.
reboot
(
session
)
finally
:
session
.
close
()
qemu/tests/drive_mirror.py
浏览文件 @
c1b0252f
import
os
import
logging
from
a
utotest.client.shared
import
error
,
util
s
from
a
vocado.utils
import
proces
s
from
virttest
import
error_context
from
virttest
import
utils_misc
from
virttest
import
storage
from
virttest
import
qemu_storage
...
...
@@ -65,7 +66,7 @@ class DriveMirror(block_copy.BlockCopy):
image_file
=
storage
.
get_image_filename
(
params
,
self
.
data_dir
)
return
self
.
vm
.
get_block
({
"file"
:
image_file
})
@
error
.
context_aware
@
error
_context
.
context_aware
def
check_node_name
(
self
):
"""
Check node name as set, after block job complete.
...
...
@@ -76,11 +77,10 @@ class DriveMirror(block_copy.BlockCopy):
node_name_exp
=
self
.
params
[
"node_name"
]
node_name
=
info
.
get
(
"node-name"
,
""
)
if
node_name
!=
node_name_exp
:
raise
error
.
TestFail
(
"node-name is: %s, while set value is: %s"
%
(
node_name
,
node_name_exp
))
self
.
test
.
fail
(
"node-name is: %s, while set value is: %s"
%
(
node_name
,
node_name_exp
))
@
error
.
context_aware
@
error
_context
.
context_aware
def
start
(
self
):
"""
start block device mirroring job;
...
...
@@ -101,15 +101,15 @@ class DriveMirror(block_copy.BlockCopy):
"buf-size"
:
buf_size
})
if
'node_name'
in
params
:
args
.
update
({
"node-name"
:
params
.
get
(
"node_name"
)})
error
.
context
(
"Start to mirror block device"
,
logging
.
info
)
error
_context
.
context
(
"Start to mirror block device"
,
logging
.
info
)
self
.
vm
.
block_mirror
(
device
,
target_image
,
full_copy
,
**
args
)
if
not
self
.
get_status
():
raise
error
.
TestF
ail
(
"No active mirroring job found"
)
self
.
test
.
f
ail
(
"No active mirroring job found"
)
if
params
.
get
(
"image_type"
)
!=
"iscsi"
:
self
.
trash_files
.
append
(
target_image
)
@
error
.
context_aware
@
error
_context
.
context_aware
def
reopen
(
self
):
"""
reopen target image, then check if image file of the device is
...
...
@@ -118,7 +118,7 @@ class DriveMirror(block_copy.BlockCopy):
params
=
self
.
parser_test_args
()
target_format
=
params
[
"image_format"
]
timeout
=
params
[
"reopen_timeout"
]
error
.
context
(
"reopen new target image"
,
logging
.
info
)
error
_context
.
context
(
"reopen new target image"
,
logging
.
info
)
if
self
.
vm
.
monitor
.
protocol
==
"qmp"
:
self
.
vm
.
monitor
.
clear_event
(
"BLOCK_JOB_COMPLETED"
)
self
.
vm
.
block_reopen
(
self
.
device
,
self
.
target_image
,
target_format
)
...
...
@@ -141,7 +141,7 @@ class DriveMirror(block_copy.BlockCopy):
params
[
"image_format"
],
self
.
target_image
,
params
[
"image_size"
])
util
s
.
system
(
cmd
)
proces
s
.
system
(
cmd
)
image
=
qemu_storage
.
Iscsidev
(
params
,
self
.
data_dir
,
params
[
"target_image"
])
image
.
cleanup
()
...
...
qemu/tests/drive_mirror_cancel.py
浏览文件 @
c1b0252f
import
logging
from
autotest.client.shared
import
utils
from
autotest.client.shared
import
error
from
avocado.utils
import
process
from
virttest
import
error_context
from
virttest
import
utils_misc
from
qemu.tests
import
drive_mirror
@
error
.
context_aware
@
error
_context
.
context_aware
def
run_drive_mirror_cancel
(
test
,
params
,
env
):
"""
Test block mirroring functionality
...
...
@@ -19,15 +23,16 @@ def run_drive_mirror_cancel(test, params, env):
mirror_test
=
drive_mirror
.
DriveMirror
(
test
,
params
,
env
,
tag
)
try
:
mirror_test
.
start
()
error
.
context
(
"Block network connection with iptables"
,
logging
.
info
)
utils
.
run
(
params
[
"start_firewall_cmd"
])
bg
=
utils
.
InterruptedThread
(
mirror_test
.
cancel
,)
error_context
.
context
(
"Block network connection with iptables"
,
logging
.
info
)
process
.
run
(
params
[
"start_firewall_cmd"
])
bg
=
utils_misc
.
InterruptedThread
(
mirror_test
.
cancel
)
bg
.
start
()
job
=
mirror_test
.
get_status
()
if
job
.
get
(
"type"
,
"0"
)
!=
"mirror"
:
raise
error
.
TestF
ail
(
"Job cancel immediacatly"
)
error
.
context
(
"Cleanup rules in iptables"
,
logging
.
info
)
util
s
.
run
(
params
[
"stop_firewall_cmd"
])
test
.
f
ail
(
"Job cancel immediacatly"
)
error
_context
.
context
(
"Cleanup rules in iptables"
,
logging
.
info
)
proces
s
.
run
(
params
[
"stop_firewall_cmd"
])
bg
.
join
(
timeout
=
int
(
params
[
"cancel_timeout"
]))
finally
:
mirror_test
.
vm
.
destroy
()
...
...
qemu/tests/drive_mirror_complete.py
浏览文件 @
c1b0252f
import
logging
from
autotest.client.shared
import
error
from
virttest
import
data_dir
from
virttest
import
env_process
from
virttest
import
error_context
from
virttest
import
qemu_storage
from
qemu.tests
import
drive_mirror
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Test block mirroring functionality
...
...
@@ -37,8 +36,8 @@ def run(test, params, env):
mirror_test
.
action_after_reopen
()
device_id
=
mirror_test
.
vm
.
get_block
({
"file"
:
target_image
})
if
device_id
!=
mirror_test
.
device
:
raise
error
.
TestE
rror
(
"Mirrored image not being used by guest"
)
error
.
context
(
"Compare fully mirrored images"
,
logging
.
info
)
test
.
e
rror
(
"Mirrored image not being used by guest"
)
error
_context
.
context
(
"Compare fully mirrored images"
,
logging
.
info
)
qemu_img
.
compare_images
(
source_image
,
target_image
,
force_share
=
True
)
mirror_test
.
vm
.
resume
()
if
params
.
get
(
"boot_target_image"
,
"no"
)
==
"yes"
:
...
...
qemu/tests/drive_mirror_powerdown.py
浏览文件 @
c1b0252f
import
logging
from
autotest.client.shared
import
error
from
virttest
import
env_process
from
virttest
import
error_context
from
qemu.tests
import
drive_mirror_stress
...
...
@@ -12,15 +11,15 @@ class DriveMirrorPowerdown(drive_mirror_stress.DriveMirrorStress):
def
__init__
(
self
,
test
,
params
,
env
,
tag
):
super
(
DriveMirrorPowerdown
,
self
).
__init__
(
test
,
params
,
env
,
tag
)
@
error
.
context_aware
@
error
_context
.
context_aware
def
powerdown
(
self
):
"""
power down guest via quit qemu;
"""
error
.
context
(
"powerdown vm"
,
logging
.
info
)
error
_context
.
context
(
"powerdown vm"
,
logging
.
info
)
return
self
.
vm
.
destroy
()
@
error
.
context_aware
@
error
_context
.
context_aware
def
powerup
(
self
):
"""
bootup guest with target image;
...
...
@@ -28,7 +27,7 @@ class DriveMirrorPowerdown(drive_mirror_stress.DriveMirrorStress):
params
=
self
.
parser_test_args
()
vm_name
=
params
[
'main_vm'
]
logging
.
info
(
"Target image: %s"
%
self
.
target_image
)
error
.
context
(
"powerup vm with target image"
,
logging
.
info
)
error
_context
.
context
(
"powerup vm with target image"
,
logging
.
info
)
env_process
.
preprocess_vm
(
self
.
test
,
params
,
self
.
env
,
vm_name
)
vm
=
self
.
env
.
get_vm
(
vm_name
)
vm
.
verify_alive
()
...
...
qemu/tests/drive_mirror_simple.py
浏览文件 @
c1b0252f
import
logging
import
time
import
random
from
autotest.client.shared
import
error
from
autotest.client.shared
import
utils
from
avocado.utils
import
process
from
virttest
import
error_context
from
qemu.tests
import
drive_mirror
...
...
@@ -11,26 +14,27 @@ class DriveMirrorSimple(drive_mirror.DriveMirror):
def
__init__
(
self
,
test
,
params
,
env
,
tag
):
super
(
DriveMirrorSimple
,
self
).
__init__
(
test
,
params
,
env
,
tag
)
@
error
.
context_aware
@
error
_context
.
context_aware
def
query_status
(
self
):
"""
query running block mirroring job info;
"""
error
.
context
(
"query job status"
,
logging
.
info
)
error
_context
.
context
(
"query job status"
,
logging
.
info
)
if
not
self
.
get_status
():
raise
error
.
TestF
ail
(
"No active job"
)
self
.
test
.
f
ail
(
"No active job"
)
@
error
.
context_aware
@
error
_context
.
context_aware
def
readonly_target
(
self
):
error
.
context
(
"Set readonly bit on target image"
,
logging
.
info
)
error
_context
.
context
(
"Set readonly bit on target image"
,
logging
.
info
)
cmd
=
"chattr +i %s"
%
self
.
target_image
return
util
s
.
system
(
cmd
)
return
proces
s
.
system
(
cmd
)
@
error
.
context_aware
@
error
_context
.
context_aware
def
clear_readonly_bit
(
self
):
error
.
context
(
"Clear readonly bit on target image"
,
logging
.
info
)
error_context
.
context
(
"Clear readonly bit on target image"
,
logging
.
info
)
cmd
=
"chattr -i %s"
%
self
.
target_image
return
util
s
.
system
(
cmd
)
return
proces
s
.
system
(
cmd
)
def
run
(
test
,
params
,
env
):
...
...
@@ -59,7 +63,7 @@ def run(test, params, env):
if
params
.
get
(
"negative_test"
)
==
"yes"
:
keywords
=
params
.
get
(
"error_key_words"
,
"Could not open"
)
if
simple_test
.
get_status
():
raise
error
.
TestF
ail
(
"Block job not cancel as expect"
)
test
.
f
ail
(
"Block job not cancel as expect"
)
if
keywords
not
in
str
(
detail
):
raise
simple_test
.
action_before_steady
()
...
...
qemu/tests/driver_in_use.py
浏览文件 @
c1b0252f
import
re
import
time
import
logging
from
virttest
import
utils_misc
from
virttest
import
utils_test
from
virttest
import
error_context
from
autotest.client.shared
import
utils
from
avocado.core
import
exceptions
@
error_context
.
context_aware
...
...
@@ -62,7 +61,7 @@ def run(test, params, env):
session
,
bg_stress_test
)
session
.
sendline
(
bg_stress_test
)
else
:
stress_thread
=
utils
.
InterruptedThread
(
stress_thread
=
utils
_misc
.
InterruptedThread
(
utils_test
.
run_virt_sub_test
,
(
test
,
params
,
env
),
{
"sub_type"
:
bg_stress_test
})
stress_thread
.
start
()
...
...
@@ -77,14 +76,13 @@ def run(test, params, env):
if
not
utils_misc
.
wait_for
(
lambda
:
check_bg_running
(
target_process
),
120
,
0
,
1
):
raise
exceptions
.
TestFail
(
"Backgroud test %s is not "
"alive!"
%
bg_stress_test
)
test
.
fail
(
"Backgroud test %s is not alive!"
%
bg_stress_test
)
if
params
.
get
(
"set_bg_stress_flag"
,
"no"
)
==
"yes"
:
logging
.
info
(
"Wait %s test start"
%
bg_stress_test
)
if
not
utils_misc
.
wait_for
(
lambda
:
env
.
get
(
bg_stress_run_flag
),
wait_time
,
0
,
0.5
):
err
=
"Fail to start %s test"
%
bg_stress_test
raise
exceptions
.
TestE
rror
(
err
)
test
.
e
rror
(
err
)
env
[
"bg_status"
]
=
1
return
stress_thread
...
...
qemu/tests/eject_media.py
浏览文件 @
c1b0252f
import
logging
import
time
from
autotest.client.shared
import
error
from
virttest
import
error_context
from
virttest
import
utils_misc
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
change a removable media:
...
...
@@ -42,55 +41,56 @@ def run(test, params, env):
device_name
=
vm
.
get_block
(
p_dict
)
if
device_name
is
None
:
msg
=
"Fail to get device using image %s"
%
orig_img_name
raise
error
.
TestF
ail
(
msg
)
error
.
context
(
"Eject original device."
)
test
.
f
ail
(
msg
)
error
_context
.
context
(
"Eject original device."
)
eject_cmd
=
"eject device=%s"
%
device_name
vm
.
monitor
.
send_args_cmd
(
eject_cmd
)
logging
.
info
(
"Wait until device is ejected"
)
time
.
sleep
(
10
)
blocks_info
=
vm
.
monitor
.
info
(
"block"
)
if
orig_img_name
in
str
(
blocks_info
):
raise
error
.
TestF
ail
(
"Fail to eject cdrom %s. "
%
orig_img_name
)
test
.
f
ail
(
"Fail to eject cdrom %s. "
%
orig_img_name
)
error
.
context
(
"Eject original device for second time"
)
error
_context
.
context
(
"Eject original device for second time"
)
vm
.
monitor
.
send_args_cmd
(
eject_cmd
)
new_img_name
=
params
.
get
(
"new_img_name"
)
error
.
context
(
"Insert new image to device."
)
error
_context
.
context
(
"Insert new image to device."
)
change_cmd
=
"change device=%s,target=%s"
%
(
device_name
,
new_img_name
)
vm
.
monitor
.
send_args_cmd
(
change_cmd
)
logging
.
info
(
"Wait until device changed"
)
time
.
sleep
(
10
)
blocks_info
=
vm
.
monitor
.
info
(
"block"
)
if
new_img_name
not
in
str
(
blocks_info
):
raise
error
.
TestF
ail
(
"Fail to chang cdrom to %s."
%
new_img_name
)
test
.
f
ail
(
"Fail to chang cdrom to %s."
%
new_img_name
)
if
qmp_used
:
eject_cmd
=
"eject device=%s, force=True"
%
device_name
else
:
eject_cmd
=
"eject device=%s"
%
device_name
error
.
context
(
"Eject device after add new image by change command"
)
error
_context
.
context
(
"Eject device after add new image by change command"
)
vm
.
monitor
.
send_args_cmd
(
eject_cmd
)
logging
.
info
(
"Wait until new image is ejected"
)
time
.
sleep
(
10
)
blocks_info
=
vm
.
monitor
.
info
(
"block"
)
if
new_img_name
in
str
(
blocks_info
):
raise
error
.
TestF
ail
(
"Fail to eject cdrom %s."
%
orig_img_name
)
test
.
f
ail
(
"Fail to eject cdrom %s."
%
orig_img_name
)
error
.
context
(
"Insert %s to device %s"
%
(
orig_img_name
,
device_name
))
error_context
.
context
(
"Insert %s to device %s"
%
(
orig_img_name
,
device_name
))
change_cmd
=
"change device=%s,target=%s"
%
(
device_name
,
orig_img_name
)
vm
.
monitor
.
send_args_cmd
(
change_cmd
)
logging
.
info
(
"Wait until device changed"
)
time
.
sleep
(
10
)
blocks_info
=
vm
.
monitor
.
info
(
"block"
)
if
orig_img_name
not
in
str
(
blocks_info
):
raise
error
.
TestF
ail
(
"Fail to change cdrom to %s."
%
orig_img_name
)
test
.
f
ail
(
"Fail to change cdrom to %s."
%
orig_img_name
)
error
.
context
(
"Try to eject non-removable device"
)
error
_context
.
context
(
"Try to eject non-removable device"
)
p_dict
=
{
"removable"
:
False
}
device_name
=
vm
.
get_block
(
p_dict
)
if
device_name
is
None
:
raise
error
.
TestF
ail
(
"Could not find non-removable device"
)
test
.
f
ail
(
"Could not find non-removable device"
)
if
params
.
get
(
"force_eject"
,
"no"
)
==
"yes"
:
if
not
qmp_used
:
eject_cmd
=
"eject -f %s "
%
device_name
...
...
@@ -102,12 +102,12 @@ def run(test, params, env):
vm
.
monitor
.
send_args_cmd
(
eject_cmd
)
except
Exception
,
e
:
if
"is not removable"
not
in
str
(
e
):
raise
error
.
TestF
ail
(
e
)
test
.
f
ail
(
e
)
logging
.
debug
(
"Catch exception message: %s"
%
e
)
logging
.
info
(
"Wait until device is ejected"
)
time
.
sleep
(
10
)
blocks_info
=
vm
.
monitor
.
info
(
"block"
)
if
device_name
not
in
str
(
blocks_info
):
raise
error
.
TestF
ail
(
"Could remove non-removable device!"
)
test
.
f
ail
(
"Could remove non-removable device!"
)
session
.
close
()
qemu/tests/enforce_quit.py
浏览文件 @
c1b0252f
import
logging
import
re
from
autotest.client.shared
import
error
from
virttest
import
env_process
from
virttest
import
error_context
from
virttest
import
utils_misc
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
enforce quit test:
...
...
@@ -42,14 +41,14 @@ def run(test, params, env):
force_quit
=
True
if
"enforce"
not
in
extra_flags
:
raise
error
.
TestE
rror
(
"pls add 'enforce' params to the cmd line"
)
test
.
e
rror
(
"pls add 'enforce' params to the cmd line"
)
msg_unavailable
=
params
.
get
(
"msg_unavailable"
,
""
).
split
(
":"
)
msg_unknow
=
params
.
get
(
"msg_unknow"
,
"not found"
)
try
:
error
.
context
(
"boot guest with -cpu %s,%s"
%
(
guest_cpumodel
,
extra_flags
),
logging
.
info
)
error
_context
.
context
(
"boot guest with -cpu %s,%s"
%
(
guest_cpumodel
,
extra_flags
),
logging
.
info
)
params
[
"start_vm"
]
=
"yes"
env_process
.
preprocess_vm
(
test
,
params
,
env
,
params
.
get
(
"main_vm"
))
except
Exception
,
err
:
...
...
@@ -60,10 +59,9 @@ def run(test, params, env):
if
tmp_flag
or
msg_unknow
in
str
(
err
):
logging
.
info
(
"unavailable host feature, guest force quit"
)
else
:
raise
error
.
TestF
ail
(
"guest quit with error
\n
%s"
%
str
(
err
))
test
.
f
ail
(
"guest quit with error
\n
%s"
%
str
(
err
))
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
if
force_quit
:
if
not
vm
.
is_dead
():
raise
error
.
TestFail
(
"guest didn't enforce quit"
" while flag lacked in host"
)
test
.
fail
(
"guest didn't enforce quit while flag lacked in host"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录