Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
d1aef93e
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d1aef93e
编写于
7月 07, 2014
作者:
L
Lucas Meneghel Rodrigues
提交者:
Lucas Meneghel Rodrigues
7月 07, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #110 from lmr/multiplextest
Multiplextest
上级
9b490fd8
67d4cff6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
184 addition
and
6 deletion
+184
-6
avocado/test.py
avocado/test.py
+1
-3
avocado/utils/params.py
avocado/utils/params.py
+14
-2
docs/source/conf.py
docs/source/conf.py
+1
-1
tests/multiplextest/multiplextest.mplx
tests/multiplextest/multiplextest.mplx
+89
-0
tests/multiplextest/multiplextest.py
tests/multiplextest/multiplextest.py
+79
-0
未找到文件。
avocado/test.py
浏览文件 @
d1aef93e
...
...
@@ -144,7 +144,6 @@ class Test(unittest.TestCase):
# Apply what comes from the params dict
for
key
in
sorted
(
self
.
params
.
keys
()):
self
.
log
.
debug
(
' %s = %s'
,
key
,
self
.
params
.
get
(
key
))
setattr
(
self
.
params
,
key
,
self
.
params
.
get
(
key
))
self
.
log
.
debug
(
''
)
# Apply what comes from the default_params dict
...
...
@@ -157,7 +156,7 @@ class Test(unittest.TestCase):
self
.
log
.
debug
(
''
)
# If there's a timeout set, log a timeout reminder
if
hasattr
(
self
.
params
,
'timeout'
)
:
if
self
.
params
.
timeout
:
self
.
log
.
info
(
'Test timeout set. Will wait %.2f s for '
'PID %s to end'
,
float
(
self
.
params
.
timeout
),
os
.
getpid
())
...
...
@@ -205,7 +204,6 @@ class Test(unittest.TestCase):
self
.
params
[
key
]
except
Exception
:
self
.
params
[
key
]
=
default
setattr
(
self
.
params
,
key
,
default
)
def
get_deps_path
(
self
,
basename
):
"""
...
...
avocado/utils/params.py
浏览文件 @
d1aef93e
...
...
@@ -25,7 +25,10 @@ class Params(UserDict.IterableUserDict):
try
:
value
=
UserDict
.
IterableUserDict
.
__getitem__
(
self
,
key
)
vtype
=
UserDict
.
IterableUserDict
.
get
(
self
,
"%s_type"
%
key
)
return
settings
.
convert_value_type
(
value
,
vtype
)
if
vtype
is
not
None
:
return
settings
.
convert_value_type
(
value
,
vtype
)
else
:
return
value
except
KeyError
:
raise
ParamNotFound
(
"Mandatory parameter '%s' is missing. "
"Check your cfg files for typos/mistakes"
%
...
...
@@ -35,6 +38,15 @@ class Params(UserDict.IterableUserDict):
"convert to %s: %s"
%
(
key
,
value
,
vtype
,
details
))
def
__getattr__
(
self
,
attr
):
try
:
return
UserDict
.
IterableUserDict
.
__getattr__
(
self
,
attr
)
# @UndefinedVariable
except
AttributeError
:
try
:
return
self
.
__getitem__
(
attr
)
except
ParamNotFound
:
return
None
def
objects
(
self
,
key
):
"""
Return the names of objects defined using a given key.
...
...
@@ -59,7 +71,7 @@ class Params(UserDict.IterableUserDict):
"""
suffix
=
"_"
+
obj_name
self
.
lock
.
acquire
()
new_dict
=
self
.
copy
()
new_dict
=
self
.
data
.
copy
()
self
.
lock
.
release
()
for
key
in
new_dict
.
keys
():
if
key
.
endswith
(
suffix
):
...
...
docs/source/conf.py
浏览文件 @
d1aef93e
...
...
@@ -63,7 +63,7 @@ master_doc = 'index'
# General information about the project.
project
=
u
'avocado'
copyright
=
u
'2014, Red Hat'
copyright
=
u
'2014, Red Hat'
# @ReservedAssignment
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
...
...
tests/multiplextest/multiplextest.mplx
0 → 100644
浏览文件 @
d1aef93e
variants:
-multiplextest:
variants:
- env:
variants:
- production:
malloc_perturb = no
gcc_flags = -O3
- debug:
malloc_perturb = yes
gcc_flags = -g
variants:
- host:
variants:
- kernel_config:
variants:
- huge_pages:
huge_pages = yes
- numa_ballance_aggressive:
numa_balancing = 1
numa_balancing_migrate_deferred = 32
numa_balancing_scan_size_mb = 512
- numa_ballance_light:
numa_balancing = 1
numa_balancing_migrate_deferred = 8
numa_balancing_scan_size_mb = 32
variants:
- guest:
variants:
- os:
variants:
- windows:
os_type = windows
variants:
- xp:
win = xp
- 2k12:
win = 2k12
- 7:
win = 7
- linux:
os_type = linux
variants:
- fedora:
distro = fedora
- ubuntu:
distro = ubuntu
variants:
- hardware:
variants:
- disks:
variants:
- ide:
drive_format = ide
- scsi:
drive_format = scsi
- network:
variants:
- rtl_8139:
nic_model = rtl8139
- e1000:
nic_model = e1000
- virtio_net:
nic_model = virtio
enable_msix_vectors = yes
variants:
- tests:
variants:
- sync_test:
variants:
- standard:
sync_timeout = 30
sync_tries = 10
- aggressive:
sync_timeout = 10
sync_tries = 20
- ping_test:
variants:
- standard:
ping_tries = 10
ping_timeout = 20
- aggressive:
ping_flags = -f
ping_tries = 100
ping_timeout = 5
tests/multiplextest/multiplextest.py
0 → 100644
浏览文件 @
d1aef93e
#!/usr/bin/python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright: Red Hat Inc. 2014
# Author: Ruda Moura <rmoura@redhat.com>
from
avocado
import
test
from
avocado
import
job
class
multiplextest
(
test
.
Test
):
"""
Execute the Linux Build test.
"""
def
setup
(
self
):
self
.
compile_code
()
self
.
set_hugepages
()
self
.
set_numa_balance
()
self
.
assembly_vm
()
if
self
.
params
.
os_type
==
'windows'
:
self
.
log
.
info
(
'Preparing VM with Windows (%s)'
,
self
.
params
.
win
)
if
self
.
params
.
os_type
==
'linux'
:
self
.
log
.
info
(
'Preparing VM with Linux (%s)'
,
self
.
params
.
distro
)
def
compile_code
(
self
):
self
.
log
.
info
(
'Compile code'
)
self
.
log
.
info
(
'gcc %s %s'
,
self
.
params
.
gcc_flags
,
'code.c'
)
def
set_hugepages
(
self
):
if
self
.
params
.
huge_pages
==
'yes'
:
self
.
log
.
info
(
'Setting hugepages'
)
def
set_numa_balance
(
self
):
if
self
.
params
.
numa_balance
:
self
.
log
.
info
(
'Numa balancing: %s'
,
self
.
params
.
numa_balance
)
if
self
.
params
.
numa_balancing_migrate_deferred
:
self
.
log
.
info
(
'Numa balancing migrate deferred: %s'
,
self
.
params
.
numa_balancing_migrate_deferred
)
def
assembly_vm
(
self
):
self
.
log
.
info
(
'Assembling VM'
)
if
self
.
params
.
drive_format
:
self
.
log
.
info
(
'Drive format: %s'
,
self
.
params
.
drive_format
)
if
self
.
params
.
nic_model
:
self
.
log
.
info
(
'NIC model: %s'
,
self
.
params
.
nic_model
)
if
self
.
params
.
enable_msx_vectors
==
'yes'
:
self
.
log
.
info
(
'Enabling msx models'
)
def
action
(
self
):
self
.
log
.
info
(
'Executing synctest...'
)
self
.
log
.
info
(
'synctest --timeout %s --tries %s'
,
self
.
params
.
sync_timeout
,
self
.
params
.
sync_tries
)
self
.
log
.
info
(
'Executing ping test...'
)
cmdline
=
'ping --timeout %s --tries %s'
%
(
self
.
params
.
ping_timeout
,
self
.
params
.
ping_tries
)
if
self
.
params
.
ping_flags
:
cmdline
+=
' %s'
%
self
.
params
.
ping_flags
self
.
log
.
info
(
cmdline
)
if
__name__
==
"__main__"
:
job
.
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录