Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
095020b9
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,发现更多精彩内容 >>
未验证
提交
095020b9
编写于
4月 10, 2018
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'ldoktor/W605'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
8a3008b1
f92c105b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
14 deletion
+14
-14
avocado/utils/astring.py
avocado/utils/astring.py
+2
-2
avocado/utils/external/spark.py
avocado/utils/external/spark.py
+1
-1
avocado/utils/linux_modules.py
avocado/utils/linux_modules.py
+1
-1
avocado/utils/memory.py
avocado/utils/memory.py
+7
-7
avocado/utils/software_manager.py
avocado/utils/software_manager.py
+1
-1
selftests/functional/test_basic.py
selftests/functional/test_basic.py
+1
-1
selftests/unit/test_astring.py
selftests/unit/test_astring.py
+1
-1
未找到文件。
avocado/utils/astring.py
浏览文件 @
095020b9
...
...
@@ -123,8 +123,8 @@ def strip_console_codes(output, custom_codes=None):
return_str
=
""
index
=
0
output
=
"
\x1b
[m%s"
%
output
console_codes
=
"%[G@8]|\
[[@A-HJ-MPXa-hl-nqrsu
\`]"
console_codes
+=
"|\
[[\d;]+[HJKgqnrm]|#8|\([B0UK]|
\)"
console_codes
=
"%[G@8]|
\
\
[[@A-HJ-MPXa-hl-nqrsu
\
\
`]"
console_codes
+=
"|
\
\
[[
\\
d;]+[HJKgqnrm]|#8|
\\
([B0UK]|
\
\
)"
if
custom_codes
is
not
None
and
custom_codes
not
in
console_codes
:
console_codes
+=
"|%s"
%
custom_codes
while
index
<
len
(
output
):
...
...
avocado/utils/external/spark.py
浏览文件 @
095020b9
...
...
@@ -125,7 +125,7 @@ class GenericParser:
self
.
augment
(
start
)
self
.
ruleschanged
=
1
_NULLABLE
=
'\e_'
_NULLABLE
=
'
\
\
e_'
_START
=
'START'
_BOF
=
'|-'
...
...
avocado/utils/linux_modules.py
浏览文件 @
095020b9
...
...
@@ -76,7 +76,7 @@ def parse_lsmod_for_module(l_raw, module_name, escape=True):
# having to splitlines use named matches so we can extract the dictionary
# with groupdict
pattern
=
(
r
"^(?P<name>%s)\s+(?P<size>\d+)\s+(?P<used>\d+)"
"\s*(?P<submodules>\S+)?$"
)
r
"\s*(?P<submodules>\S+)?$"
)
lsmod
=
re
.
search
(
pattern
%
module_search
,
l_raw
,
re
.
M
)
if
lsmod
:
# default to empty list if no submodules
...
...
avocado/utils/memory.py
浏览文件 @
095020b9
...
...
@@ -270,7 +270,7 @@ def read_from_vmstat(key):
"""
with
open
(
"/proc/vmstat"
)
as
vmstat
:
vmstat_info
=
vmstat
.
read
()
return
int
(
re
.
findall
(
"%s\s+(\d+)"
%
key
,
vmstat_info
)[
0
])
return
int
(
re
.
findall
(
r
"%s\s+(\d+)"
%
key
,
vmstat_info
)[
0
])
def
read_from_smaps
(
pid
,
key
):
...
...
@@ -288,7 +288,7 @@ def read_from_smaps(pid, key):
smaps_info
=
smaps
.
read
()
memory_size
=
0
for
each_number
in
re
.
findall
(
"%s:\s+(\d+)"
%
key
,
smaps_info
):
for
each_number
in
re
.
findall
(
r
"%s:\s+(\d+)"
%
key
,
smaps_info
):
memory_size
+=
int
(
each_number
)
return
memory_size
...
...
@@ -348,24 +348,24 @@ def get_buddy_info(chunk_sizes, nodes="all", zones="all"):
with
open
(
"/proc/buddyinfo"
)
as
buddy_info
:
buddy_info_content
=
buddy_info
.
read
()
re_buddyinfo
=
"Node\s+"
re_buddyinfo
=
r
"Node\s+"
if
nodes
==
"all"
:
re_buddyinfo
+=
"(\d+)"
re_buddyinfo
+=
r
"(\d+)"
else
:
re_buddyinfo
+=
"(%s)"
%
"|"
.
join
(
nodes
.
split
())
if
not
re
.
findall
(
re_buddyinfo
,
buddy_info_content
):
logging
.
warn
(
"Can not find Nodes %s"
%
nodes
)
return
None
re_buddyinfo
+=
".*?zone\s+"
re_buddyinfo
+=
r
".*?zone\s+"
if
zones
==
"all"
:
re_buddyinfo
+=
"(\w+)"
re_buddyinfo
+=
r
"(\w+)"
else
:
re_buddyinfo
+=
"(%s)"
%
"|"
.
join
(
zones
.
split
())
if
not
re
.
findall
(
re_buddyinfo
,
buddy_info_content
):
logging
.
warn
(
"Can not find zones %s"
%
zones
)
return
None
re_buddyinfo
+=
"\s+([\s\d]+)"
re_buddyinfo
+=
r
"\s+([\s\d]+)"
buddy_list
=
re
.
findall
(
re_buddyinfo
,
buddy_info_content
)
...
...
avocado/utils/software_manager.py
浏览文件 @
095020b9
...
...
@@ -658,7 +658,7 @@ class ZypperBackend(RpmBackend):
verbose
=
False
)
out
=
cmd_result
.
stdout
.
strip
()
try
:
ver
=
re
.
findall
(
'\d.\d*.\d*'
,
out
)[
0
]
ver
=
re
.
findall
(
r
'\d.\d*.\d*'
,
out
)[
0
]
except
IndexError
:
ver
=
out
self
.
pm_version
=
ver
...
...
selftests/functional/test_basic.py
浏览文件 @
095020b9
...
...
@@ -803,7 +803,7 @@ class RunnerSimpleTest(unittest.TestCase):
"--external-runner %s --sysinfo=off "
"--job-timeout 3"
%
(
AVOCADO
,
self
.
tmpdir
,
SLEEP_BINARY
))
proc
.
read_until_output_matches
([
"\(1/1\)"
],
timeout
=
3
,
proc
.
read_until_output_matches
([
r
"\(1/1\)"
],
timeout
=
3
,
internal_timeout
=
0.01
)
# We need pid of the avocado process, not the shell executing it
avocado_shell
=
psutil
.
Process
(
proc
.
get_pid
())
...
...
selftests/unit/test_astring.py
浏览文件 @
095020b9
...
...
@@ -69,7 +69,7 @@ class AstringTest(unittest.TestCase):
self
.
assertEqual
(
astring
.
tabular_output
(
matrix
),
str_matrix
)
def
test_safe_path
(
self
):
self
.
assertEqual
(
astring
.
string_to_safe_path
(
'a<>:"/
\\
|\?*b'
),
self
.
assertEqual
(
astring
.
string_to_safe_path
(
'a<>:"/
\\
|
\
\
?*b'
),
"a__________b"
)
self
.
assertEqual
(
astring
.
string_to_safe_path
(
'..'
),
"_."
)
self
.
assertEqual
(
len
(
astring
.
string_to_safe_path
(
" "
*
300
)),
255
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录