Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
test-tools
提交
4238ab5b
T
test-tools
项目概览
openeuler
/
test-tools
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
test-tools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4238ab5b
编写于
7月 28, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
7月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
!10 add param for not checking the mapping between suite and case during debugging.
Merge pull request !10 from lemon.higgins/master
上级
c79c5dc0
e50ad429
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
51 addition
and
34 deletion
+51
-34
mugen/libs/locallibs/common_lib.sh
mugen/libs/locallibs/common_lib.sh
+5
-4
mugen/runoet.sh
mugen/runoet.sh
+46
-30
未找到文件。
mugen/libs/locallibs/common_lib.sh
浏览文件 @
4238ab5b
...
...
@@ -136,11 +136,13 @@ function CHECK_RESULT() {
}
function
CASE_RESULT
()
{
test
$1
-ne
0
&&
ret_c
=
1
[[
-z
$exec_result
]]
&&
{
LOG_INFO
"The case execute succeed."
exec_result
=
0
all_result
=
0
return
0
return
$ret_c
}
for
ret
in
"
${
all_result
[@]
}
"
;
do
...
...
@@ -148,7 +150,7 @@ function CASE_RESULT() {
done
exec_result
=
0
all_result
=
0
return
1
return
$ret
}
function
SSH_CMD
()
{
...
...
@@ -202,7 +204,6 @@ function main() {
fi
run_test
CASE_RESULT
CASE_RESULT
$?
test
$?
-eq
0
||
exit
1
}
mugen/runoet.sh
浏览文件 @
4238ab5b
...
...
@@ -28,6 +28,7 @@ function usage() {
-f:designated test suite
\n
-r:designated test case
\n
-x:the shell script is executed in debug mode
\n
-C: the mapping in suite2case does not need to be checked.
\n
Example: bash runoet.sh -f test_suite -r test_case -x
\n
"
}
...
...
@@ -86,44 +87,21 @@ function run_test_case() {
test_suite
=
$1
test_case
=
$2
LOG_INFO
"start to run testcase:
${
test_case
}
"
log_path
=
${
OET_PATH
}
/logs/
${
test_suite
}
/
${
test_case
}
mkdir
-p
${
log_path
}
[
"
$isCheck
"
x
==
"yes"
x
]
&&
check_case
$test_suite
$test_case
LOG_INFO
"start to run testcase:
${
test_case
}
"
exec
6>&1
exec
7>&2
exec
>
${
log_path
}
/
"
$(
date
+%Y-%m-%d-%T
)
"
.log 2>&1
((
case_num++
))
if
!
find
${
OET_PATH
}
/suite2cases
-type
f
-name
${
test_suite
}
>
/dev/null 2>&1
;
then
LOG_ERROR
"In the suite2cases directory, Can't find the file of testsuite:
${
test_suite
}
."
end_test_case 1
return
1
elif
!
find
${
OET_PATH
}
/testcases
-type
d
-name
${
test_suite
}
>
/dev/null 2>&1
;
then
LOG_ERROR
"Can't find the dir of testsuite:
${
test_suite
}
."
end_test_case 1
return
1
fi
if
!
grep
-w
${
test_case
}
${
OET_PATH
}
/suite2cases/
${
test_suite
}
>
/dev/null 2>&1
;
then
LOG_ERROR
"In the suite2cases directory, no testcase:
${
test_case
}
is found inside the
${
test_suite
}
file."
end_test_case 1
return
1
elif
!
find
${
OET_PATH
}
/testcases
-type
d
-name
${
test_suite
}
>
/dev/null 2>&1
;
then
LOG_ERROR
"Can't find the dir of testcase:
${
test_case
}
."
end_test_case 1
return
1
elif
!
find
${
OET_PATH
}
/testcases/
${
test_suite
}
-type
f
-name
"
${
test_case
}
*"
>
/dev/null 2>&1
;
then
LOG_ERROR
"Can't find the script of testcase:
${
test_case
}
."
end_test_case 1
return
1
fi
case_path
=
$(
find
${
OET_PATH
}
/testcases/
${
test_suite
}
-type
f
-name
"
${
test_case
}
*"
|
sed
-e
"s/
${
test_case
}
\.
.*//g"
)
case_path
=
$(
find
${
OET_PATH
}
/testcases/
${
test_suite
}
-type
f
-name
"
${
test_case
}
\.
*"
|
sed
-e
"s/
${
test_case
}
\.
.*//g"
)
cd
${
case_path
}
||
exit
1
script_type
=
$(
ls
${
test_case
}*
|
awk
-F
'.'
'{print $NF}'
)
if
[[
"
$script_type
"
x
==
"sh"
x
]]
||
[[
"
$script_type
"
x
==
"bash"
x
]]
;
then
...
...
@@ -154,6 +132,40 @@ function run_test_case() {
}
}
function
check_case
()
{
test_suite
=
$1
test_case
=
$2
case_path
=
$(
find
${
OET_PATH
}
/testcases/
${
test_suite
}
-type
f
-name
"
${
test_case
}
\.
*"
|
sed
-e
"s/
${
test_case
}
\.
.*//g"
)
LOG_INFO
"start to check testcase:
${
test_case
}
"
test
-d
${
OET_PATH
}
/testcases/
${
test_suite
}
||
{
LOG_ERROR
"Can't find the dir of testsuite:
${
test_suite
}
."
end_test_case 1
return
1
}
test
-f
${
OET_PATH
}
/suite2cases/
${
test_suite
}
||
{
LOG_ERROR
"In the suite2cases directory, Can't find the file of testsuite:
${
test_suite
}
."
end_test_case 1
return
1
}
if
echo
"
$@
"
|
grep
-e
'-C'
>
/dev/null 2>&1
;
then
if
!
grep
-w
${
test_case
}
${
OET_PATH
}
/suite2cases/
${
test_suite
}
>
/dev/null 2>&1
;
then
LOG_ERROR
"In the suite2cases directory, no testcase:
${
test_case
}
is found inside the
${
test_suite
}
file."
end_test_case 1
return
1
fi
fi
test
-f
${
case_path
}
/
${
test_case
}
\.
*
||
{
LOG_ERROR
"Can't find testcase. please check whether the case name is correct."
exit
1
}
}
function
run_test
()
{
test_suite
=
$1
test_case
=
$2
...
...
@@ -185,8 +197,9 @@ function run_test() {
}
export
command_x
=
"no"
while
getopts
":xachr:f:"
arg
;
do
case
$arg
in
export
isCheck
=
"yes"
while
getopts
":caxf:Cr:h"
opt
;
do
case
$opt
in
x
)
command_x
=
"yes"
;;
...
...
@@ -210,6 +223,9 @@ while getopts ":xachr:f:" arg; do
exit
1
}
;;
C
)
isCheck
=
"no"
;;
h
)
usage
;;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录