Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Applications Sample Wifi Iot
提交
684c4d7a
A
Applications Sample Wifi Iot
项目概览
OpenHarmony
/
Applications Sample Wifi Iot
10 个月 前同步成功
通知
3
Star
24
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Applications Sample Wifi Iot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
684c4d7a
编写于
6月 02, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
!85 添加关键进程的crash检查
Merge pull request !85 from hongshaojie/pr
上级
6758d78f
9e9b2af8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
19 deletion
+46
-19
screenshot/resource/app_capture_screen_test_config.json
screenshot/resource/app_capture_screen_test_config.json
+17
-9
screenshot/resource/capturescreentest.py
screenshot/resource/capturescreentest.py
+29
-10
未找到文件。
screenshot/resource/app_capture_screen_test_config.json
浏览文件 @
684c4d7a
...
...
@@ -20,8 +20,9 @@
"entry"
:
""
,
"compress_file_recv"
:[
"cd /data/log/faultlog/temp && tar -cf crash_log.tar cppcrash*"
],
"crash_check"
:[
"ls /data/log/faultlog/temp/ -al | wc -l"
,
""
],
"clear_faultlog"
:[
"rm /data/log/faultlog/temp/*"
],
"all_actions"
:
[
[
1
,
"remount"
],
[
1
,
"
crash_check
"
],
[
1
,
"compress_file_recv"
],
[
1
,
"get_file_from_dev"
,
"/data/log/faultlog/temp/crash_log.tar"
]
[
1
,
"remount"
],
[
1
,
"
process_crash_check"
,
"foundation"
],
[
1
,
"process_crash_check"
,
"render_service"
],
[
1
,
"process_crash_check"
,
"appspawn
"
],
[
1
,
"compress_file_recv"
],
[
1
,
"get_file_from_dev"
,
"/data/log/faultlog/temp/crash_log.tar"
]
]
},
{
...
...
@@ -51,13 +52,13 @@
"start_test"
:[
"aa start -a ohos.acts.multimedia.video.videoplayer.MainAbility -b ohos.acts.multimedia.video.videoplayer"
],
"recover_log"
:[
"cd data/log/hilog/;hilog -x > video_log.txt"
],
"check_result"
:[
"cd /data/log/hilog && grep -nr 'total cases'"
,
"failure 0,error 0,pass 1"
],
"compress_log"
:[
"cd /data/log/hilog && tar -cf video_log.tar
video_
*"
],
"compress_log"
:[
"cd /data/log/hilog && tar -cf video_log.tar *"
],
"clear_log"
:[
"rm /data/log/hilog/*"
],
"all_actions"
:
[
[
2
,
"install_hap"
,
"vediotest/ActsVideoPlayerJsTest.hap"
],
[
1
,
"mk_test_dir"
],
[
1
,
"remount"
],
[
1
,
"close_auto_log"
],
[
1
,
"start_video_log"
],
[
2
,
"install_hap"
,
"vediotest/ActsVideoPlayerJsTest.hap"
],
[
1
,
"mk_test_dir"
],
[
1
,
"remount"
],
[
1
,
"send_file_to_dev"
,
"vediotest/H264_AAC.mp4"
,
"/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
],
[
15
,
"start_test"
],
[
1
,
"stop_hilog"
],
[
1
,
"check_result"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/video_log.tar"
],
[
1
,
"clear_log"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del
-x-y"
]
[
15
,
"start_test"
],
[
1
,
"
recover_log"
],
[
1
,
"
stop_hilog"
],
[
1
,
"check_result"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/video_log.tar"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
2
,
"home-x-y"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
2
,
"home
-x-y"
]
]
},
{
...
...
@@ -83,7 +84,7 @@
"recover_log"
:[
"cd data/log/hilog/;hilog -x > camera_log.txt;hilog -b D"
],
"all_actions"
:
[
[
1
,
"close_auto_log"
],
[
1
,
"open_camera_log"
],
[
5
,
"start_camera"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
1
,
"recover_log"
],
[
1
,
"check_result"
],
[
1
,
"shot_cmd"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/camera_log.tar"
]
[
1
,
"shot_cmd"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/camera_log.tar"
]
,
[
2
,
"home-x-y"
],
[
2
,
"home-x-y"
]
]
},
{
...
...
@@ -91,18 +92,25 @@
"entry"
:
"aa start -a com.ohos.settings.MainAbility -b com.ohos.settings"
,
"compress_log"
:[
"cd /data/log/hilog && tar -cf settings_log.tar *"
],
"all_actions"
:
[
[
2
,
"shot_cmd"
,
"settings"
],
[
1
,
"cmp_cmd-level"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/settings_log.tar"
]
[
2
,
"shot_cmd"
,
"settings"
],
[
1
,
"cmp_cmd-level"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
2
,
"home-x-y"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/settings_log.tar"
],
[
2
,
"home-x-y"
]
]
},
{
"app_name"
:
"photos"
,
"entry"
:
"aa start -a com.ohos.photos.MainAbility -b com.ohos.photos"
,
"all_actions"
:
[[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"shot_cmd"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"cmp_cmd-level"
,
200000
],
[
1
,
"recent-x-y"
],
[
1
,
"recent_del-x-y"
]]
"all_actions"
:
[
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"shot_cmd"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"cmp_cmd-level"
,
200000
],
[
2
,
"home-x-y"
],
[
1
,
"recent-x-y"
],
[
1
,
"recent_del-x-y"
],
[
2
,
"home-x-y"
]
]
},
{
"app_name"
:
"note"
,
"entry"
:
"aa start -a MainAbility -b com.ohos.note"
,
"compress_log"
:[
"cd /data/log/hilog && tar -cf note_log.tar *"
],
"all_actions"
:
[[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"shot_cmd"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"cmp_cmd-level"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/note_log.tar"
]]
"all_actions"
:
[
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"permisson_ok-x-y"
],
[
2
,
"shot_cmd"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
2
,
"home-x-y"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"cmp_cmd-level"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/note_log.tar"
],
[
2
,
"home-x-y"
]
]
}
]
screenshot/resource/capturescreentest.py
浏览文件 @
684c4d7a
...
...
@@ -70,6 +70,11 @@ def EnterCmd(mycmd, waittime = 0, printresult = 1):
cmd_file
.
close
()
return
result
def
SysExit
():
EnterShellCmd
(
"cd /data/log/faultlog/temp && tar -cf after_test_crash_log_{}.tar cppcrash*"
.
format
(
args
.
device_num
))
GetFileFromDev
(
"/data/log/faultlog/temp/after_test_crash_log_{}.tar"
.
format
(
args
.
device_num
),
os
.
path
.
normpath
(
args
.
save_path
))
sys
.
exit
(
99
)
def
EnterShellCmd
(
shellcmd
,
waittime
=
0
,
printresult
=
1
):
if
shellcmd
==
""
:
return
...
...
@@ -147,10 +152,7 @@ if __name__ == "__main__":
rebootcnt
=
2
while
rebootcnt
:
rebootcnt
-=
1
#os.system("hdc_std start")
EnterCmd
(
"hdc_std list targets"
,
1
)
#EnterCmd("hdc_std list targets", 1)
#EnterShellCmd("rm -rf /data/screen_test/train_set")
EnterShellCmd
(
"mkdir -p /data/screen_test/train_set"
)
SendFileToDev
(
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
tools_path
,
"resource/printscreen"
)),
"/data/screen_test/"
)
EnterShellCmd
(
"chmod 777 /data/screen_test/printscreen"
)
...
...
@@ -183,7 +185,7 @@ if __name__ == "__main__":
PrintToLog
(
"ERROR: remove lock failed
\n\n
"
)
PrintToLog
(
"SmokeTest find some fatal problems!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
99
)
SysExit
(
)
PrintToLog
(
"
\n\n
########## First check key processes start ##############"
)
lose_process
=
[]
...
...
@@ -213,7 +215,7 @@ if __name__ == "__main__":
PrintToLog
(
"
\n\n
ERROR: %s, These processes are not exist!!!
\n
"
%
lose_process
)
PrintToLog
(
"SmokeTest find some fatal problems!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
99
)
SysExit
(
)
else
:
PrintToLog
(
"First processes check is ok
\n
"
)
...
...
@@ -319,6 +321,23 @@ if __name__ == "__main__":
elif
type
(
single_action
[
1
])
==
str
and
single_action
[
1
]
==
'connect_wifi'
:
next_cmd
=
""
ConnectToWifi
(
args
.
tools_path
)
#process_crash_check
elif
type
(
single_action
[
1
])
==
str
and
single_action
[
1
]
==
'process_crash_check'
:
next_cmd
=
""
if
len
(
single_action
)
==
3
:
p
=
EnterShellCmd
(
"cd /data/log/faultlog/temp && grep
\"
Process name
\"
-rnw ./"
,
single_action
[
0
])
result
=
""
.
join
(
p
)
findsome
=
result
.
find
(
single_action
[
2
],
0
,
len
(
result
))
if
findsome
!=
-
1
:
testok
=
-
1
PrintToLog
(
"
\"
{}
\"
ERROR:find crux crash
\"
{}
\"
!
\n
"
.
format
(
single_action
[
1
],
single_action
[
2
]))
PrintToLog
(
"SmokeTest find some fatal problems!"
)
PrintToLog
(
"End of check, test failed!"
)
SysExit
()
else
:
testok
=
1
PrintToLog
(
"
\"
{}
\"
check execut result is ok, not find crux crash
\"
{}
\"
!
\n
"
.
format
(
single_action
[
1
],
single_action
[
2
]))
sys
.
stdout
.
flush
()
#other cmd handle
elif
type
(
single_action
[
1
])
==
str
:
if
single_action
[
1
]
not
in
single_app
.
keys
():
...
...
@@ -368,7 +387,7 @@ if __name__ == "__main__":
EnterShellCmd
(
"hilog -w stop"
,
1
)
if
smoke_first_failed
==
'launcher'
:
break
#key processes second check, and cmp to first check
PrintToLog
(
"
\n\n
########## Second check key processes start ##############"
)
second_check_lose_process
=
[]
...
...
@@ -382,7 +401,7 @@ if __name__ == "__main__":
PrintToLog
(
"ERROR: pid of %s is different the first check"
%
pname
)
PrintToLog
(
"SmokeTest find some fatal problems!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
99
)
SysExit
(
)
else
:
PrintToLog
(
"WARNNING: pid of %s is different the first check"
%
pname
)
elif
len
(
pidlist
)
!=
1
:
...
...
@@ -390,7 +409,7 @@ if __name__ == "__main__":
PrintToLog
(
"ERROR: pid of %s is not only one"
%
pname
)
PrintToLog
(
"SmokeTest find some fatal problems!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
99
)
SysExit
(
)
else
:
PrintToLog
(
"WARNNING: pid of %s is not only one"
%
pname
)
except
:
...
...
@@ -400,7 +419,7 @@ if __name__ == "__main__":
PrintToLog
(
"ERROR: pid of %s is not exist"
%
pname
)
PrintToLog
(
"SmokeTest find some fatal problems!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
99
)
SysExit
(
)
else
:
PrintToLog
(
"Second processes check is ok
\n
"
)
...
...
@@ -411,7 +430,7 @@ if __name__ == "__main__":
if
fail_name_list
.
count
(
'launcher'
)
or
fail_name_list
.
count
(
'settings_keyboard'
):
PrintToLog
(
"SmokeTest find some fatal problems!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
99
)
SysExit
(
)
PrintToLog
(
"SmokeTest find some key problems!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
98
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录