Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
74aeccfa
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,发现更多精彩内容 >>
提交
74aeccfa
编写于
4月 10, 2020
作者:
Q
Qinghua Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add nested verify CPU models test case
Signed-off-by:
N
Qinghua Cheng
<
qcheng@redhat.com
>
上级
bfc04828
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
62 addition
and
37 deletion
+62
-37
qemu/deps/playbook.yml
qemu/deps/playbook.yml
+42
-29
qemu/tests/cfg/nested_test.cfg
qemu/tests/cfg/nested_test.cfg
+6
-4
qemu/tests/nested_test.py
qemu/tests/nested_test.py
+14
-4
未找到文件。
qemu/deps/playbook.yml
浏览文件 @
74aeccfa
...
...
@@ -11,6 +11,7 @@
bs_options
:
"
{{bootstrap_options}}"
host_log_dir
:
"
{{host_log_files_dir}}"
cmd_line
:
"
{{command_line}}"
acc_cancel
:
"
{{accept_cancel}}"
tasks
:
...
...
@@ -44,35 +45,30 @@
path
:
'
{{kar_local}}'
register
:
kar_folder
-
name
:
Clone kar
git
:
repo
:
'
{{kar_repo}}'
dest
:
'
{{kar_local}}'
when
:
not kar_folder.stat.exists
-
name
:
Run bootstrap script
command
:
./Bootstrap.sh {{bs_options}}
args
:
chdir
:
'
{{kar_local}}'
when
:
not kar_folder.stat.exists
register
:
bootstrap_result
ignore_errors
:
True
-
name
:
Remove kar folder when bootstrap failed
file
:
path
:
'
{{kar_local}}'
state
:
absent
when
:
bootstrap_result is failed
-
name
:
Clean env when bootstrap failed
pip
:
name
:
aexpect, avocado-framework, avocado-framework-plugin-vt, avocado-framework-plugin-result-html
state
:
absent
when
:
bootstrap_result is failed
-
fail
:
msg
:
"
bootstrap
script
failed"
when
:
bootstrap_result is failed
-
block
:
-
name
:
Clone kar
git
:
repo
:
'
{{kar_repo}}'
dest
:
'
{{kar_local}}'
when
:
not kar_folder.stat.exists
-
name
:
Run Bootstrap script
command
:
./Bootstrap.sh {{bs_options}}
args
:
chdir
:
'
{{kar_local}}'
when
:
not kar_folder.stat.exists
register
:
bootstrap_result
rescue
:
-
name
:
Remove kar folder when bootstrap failed
file
:
path
:
'
{{kar_local}}'
state
:
absent
-
name
:
Clean env when bootstrap failed
pip
:
name
:
aexpect, avocado-framework, avocado-framework-plugin-vt, avocado-framework-plugin-result-html
state
:
absent
-
fail
:
msg
:
"
bootstrap
script
failed"
-
name
:
Run case
shell
:
...
...
@@ -91,6 +87,14 @@
msg
:
"
Log
dir
is
created"
when
:
guest_log_dir.stdout != ""
-
name
:
Get results.json file from guest vm
slurp
:
src
:
'
{{
guest_log_dir.stdout}}/latest/results.json'
register
:
results_json
-
set_fact
:
results_json
:
"
{{
results_json.content|b64decode|from_json
}}"
-
name
:
Compress log directory to log.bz2
archive
:
path
:
'
{{guest_log_dir.stdout}}/latest/'
...
...
@@ -110,3 +114,12 @@
shell
:
echo "Run test case failed"
failed_when
:
run_case_result is failed
-
debug
:
var
:
results_json.cancel
-
name
:
Handle cancelled test cases
fail
:
msg
:
"
Test
failed!
There
are
unexpected
cancelled
test
cases."
when
:
-
results_json.cancel != 0 and not acc_cancel|bool
qemu/tests/cfg/nested_test.cfg
浏览文件 @
74aeccfa
...
...
@@ -2,17 +2,19 @@
kar_repo = <kar_repo_url>
cert_url = <cert_ca_url>
nested_bs_options = ""
accept_cancel = no
l2_kar_options = ""
auto_cpu_model = yes
cpu_model_flags = ",+vmx"
no Host_RHEL.m7
Host_RHEL.m8.u0, Host_RHEL.m8.u1:
auto_cpu_model = no
cpu_model = host
only RHEL.8
type = nested_test
test_type = testcase
install_node = no
test_timeout = 3600
variants:
variants
nested_test
:
- boot_l2:
case_name = boot
install_node = yes
- check_cpu_model_l2:
case_name = x86_cpu_model
qemu/tests/nested_test.py
浏览文件 @
74aeccfa
...
...
@@ -8,6 +8,7 @@ from avocado.utils import software_manager
from
virttest
import
error_context
from
virttest
import
data_dir
as
virttest_data_dir
from
virttest
import
cpu
as
virttest_cpu
@
error_context
.
context_aware
...
...
@@ -62,13 +63,21 @@ def run(test, params, env):
guest_password
=
params
.
get
(
"password"
)
bootstrap_options
=
params
.
get
(
"nested_bs_options"
)
accept_cancel
=
params
.
get_boolean
(
"accept_cancel"
)
kar_cmd
=
"python3 ./ConfigTest.py "
test_type
=
params
.
get
(
"test_type"
)
if
test_type
:
case_name
=
params
.
get
(
"case_name"
)
if
case_name
:
kar_cmd
+=
" --%s=%s "
%
(
test_type
,
case_name
)
variant_name
=
params
.
get
(
"nested_test"
)
case_name
=
params
.
get
(
"case_name"
,
""
)
if
variant_name
==
"check_cpu_model_l2"
:
host_cpu_models
=
virttest_cpu
.
get_host_cpu_models
()
case_name
=
','
.
join
([
"%s.%s"
%
(
case_name
,
i
)
for
i
in
host_cpu_models
])
kar_cmd
+=
" --%s=%s "
%
(
test_type
,
case_name
)
l2_guest_name
=
params
.
get
(
"l2_guest_name"
)
if
l2_guest_name
:
kar_cmd
+=
" --guestname=%s"
%
l2_guest_name
...
...
@@ -92,6 +101,7 @@ def run(test, params, env):
data
=
{
"guest_password"
:
guest_password
,
"bootstrap_options"
:
bootstrap_options
,
"accept_cancel"
:
accept_cancel
,
"command_line"
:
kar_cmd
,
"setup_br_sh"
:
setup_bridge_sh
,
"host_log_files_dir"
:
results_dir
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录