Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Applications Sample Wifi Iot
提交
41640b1d
A
Applications Sample Wifi Iot
项目概览
OpenHarmony
/
Applications Sample Wifi Iot
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
41640b1d
编写于
7月 05, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
!122 添加相机拍照拦截,相机跳转图库拦截
Merge pull request !122 from hongshaojie/pr
上级
19ebbb34
87971521
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
5568 addition
and
31 deletion
+5568
-31
OAT.xml
OAT.xml
+4
-4
mini_system_test/L1_mini_system_test.py
mini_system_test/L1_mini_system_test.py
+3
-1
mini_system_test/L2_mini_system_test.py
mini_system_test/L2_mini_system_test.py
+4
-0
screenshot/photographtest/NativeRdbTest
screenshot/photographtest/NativeRdbTest
+0
-0
screenshot/resource/app_capture_screen_test_config.json
screenshot/resource/app_capture_screen_test_config.json
+40
-16
screenshot/resource/capturescreentest.py
screenshot/resource/capturescreentest.py
+18
-10
screenshot/resource/jump_to_photos.png
screenshot/resource/jump_to_photos.png
+0
-0
screenshot/resource/jump_to_photos.pngraw
screenshot/resource/jump_to_photos.pngraw
+5499
-0
未找到文件。
OAT.xml
浏览文件 @
41640b1d
...
...
@@ -27,19 +27,19 @@
<filefilterlist>
<filefilter
name=
"defaultFilter"
desc=
"Files not to check"
>
<filteritem
type=
"filename"
name=
"*.png|*.pngraw|*.json"
desc=
"Test files"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test"
desc=
"Test files"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test
|NativeRdbTest
"
desc=
"Test files"
/>
</filefilter>
<filefilter
name=
"defaultPolicyFilter"
desc=
"Filters for compatibility,license header policies"
>
<filteritem
type=
"filename"
name=
"*.png|*.pngraw|*.json|dhcpc.sh"
desc=
"NoLicenseHeader"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test"
desc=
"NoLicenseHeader"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test
|NativeRdbTest
"
desc=
"NoLicenseHeader"
/>
</filefilter>
<filefilter
name=
"copyrightPolicyFilter"
desc=
"Filters for copyright header policies"
>
<filteritem
type=
"filename"
name=
"*.png|*.pngraw|*.json|dhcpc.sh"
desc=
"InvalidCopyright file"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test"
desc=
"InvalidCopyright file"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test
|NativeRdbTest
"
desc=
"InvalidCopyright file"
/>
</filefilter>
<filefilter
name=
"binaryFileTypePolicyFilter"
desc=
"Filters for binary file policies"
>
<filteritem
type=
"filename"
name=
"*.png|*.pngraw|*.json|busybox"
desc=
"already checked"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test"
desc=
"already checked"
/>
<filteritem
type=
"filename"
name=
"printscreen|*.hap|audio_renderer_unit_test
|NativeRdbTest
"
desc=
"already checked"
/>
</filefilter>
</filefilterlist>
</oatconfig>
...
...
mini_system_test/L1_mini_system_test.py
浏览文件 @
41640b1d
...
...
@@ -140,13 +140,15 @@ if __name__ == "__main__":
target_dir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
archive_path
,
"rootfs"
))
ret_size
=
GetDirSize
(
target_dir
)
/
1024
/
1024
PrintToLog
(
'Size of rootfs is ({:.2f}M)'
.
format
(
ret_size
))
if
ret_size
>
15
:
PrintToLog
(
'ERROR: Size of rootfs({:.2f}M) is over the upper limit(15M)'
.
format
(
ret_size
))
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
99
)
target_dir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
archive_path
,
"
root
fs"
))
target_dir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
archive_path
,
"
user
fs"
))
ret_size
=
GetDirSize
(
target_dir
)
/
1024
/
1024
PrintToLog
(
'Size of userfs is ({:.2f}M)'
.
format
(
ret_size
))
if
ret_size
>
15
:
PrintToLog
(
'ERROR: Size of userfs({:.2f}M) is over the upper limit(15M)'
.
format
(
ret_size
))
PrintToLog
(
"End of check, test failed!"
)
...
...
mini_system_test/L2_mini_system_test.py
浏览文件 @
41640b1d
...
...
@@ -173,6 +173,7 @@ if __name__ == "__main__":
target_dir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
archive_path
,
"system"
))
PrintToLog
(
target_dir
)
ret_size
=
GetDirSize
(
target_dir
)
/
1024
/
1024
PrintToLog
(
'Size of system is :{:.2f}M'
.
format
(
ret_size
))
if
ret_size
>
50
:
PrintToLog
(
'ERROR: Size of system({:.2f}M) is over the upper limit(50M)'
.
format
(
ret_size
))
PrintToLog
(
"End of check, test failed!"
)
...
...
@@ -180,6 +181,7 @@ if __name__ == "__main__":
target_dir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
archive_path
,
"data"
))
ret_size
=
GetDirSize
(
target_dir
)
/
1024
/
1024
PrintToLog
(
'Size of data is :{:.2f}M'
.
format
(
ret_size
))
if
ret_size
>
50
:
PrintToLog
(
'ERROR: Size of data({:.2f}M) is over the upper limit(50M)'
.
format
(
ret_size
))
PrintToLog
(
"End of check, test failed!"
)
...
...
@@ -187,6 +189,7 @@ if __name__ == "__main__":
target_dir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
archive_path
,
"updater"
))
ret_size
=
GetDirSize
(
target_dir
)
/
1024
/
1024
PrintToLog
(
'Size of updater is :{:.2f}M'
.
format
(
ret_size
))
if
ret_size
>
50
:
PrintToLog
(
'ERROR: Size of updater({:.2f}M) is over the upper limit(50M)'
.
format
(
ret_size
))
PrintToLog
(
"End of check, test failed!"
)
...
...
@@ -194,6 +197,7 @@ if __name__ == "__main__":
target_dir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
archive_path
,
"vendor"
))
ret_size
=
GetDirSize
(
target_dir
)
/
1024
/
1024
PrintToLog
(
'Size of vendor is :{:.2f}M'
.
format
(
ret_size
))
if
ret_size
>
50
:
PrintToLog
(
'ERROR: Size of vendor({:.2f}M) is over the upper limit(50M)'
.
format
(
ret_size
))
PrintToLog
(
"End of check, test failed!"
)
...
...
screenshot/photographtest/NativeRdbTest
0 → 100644
浏览文件 @
41640b1d
文件已添加
screenshot/resource/app_capture_screen_test_config.json
浏览文件 @
41640b1d
[
{
"DEVICE_1"
:[
1
,
2
,
3
,
4
,
8
],
"DEVICE_2"
:[
5
,
6
,
7
,
9
],
"DEVICE_1"
:[
2
,
3
,
4
,
10
,
11
],
"DEVICE_2"
:[
1
,
5
,
6
,
7
,
8
,
9
],
"return-x-y"
:[
210
,
1240
],
"recent-x-y"
:[
515
,
1240
],
"home-x-y"
:[
360
,
1240
],
"recent_del-x-y"
:[
360
,
1170
],
"permisson_ok-x-y"
:[
575
,
700
],
"permisson_no-x-y"
:[
140
,
700
],
"take_photos-x-y"
:[
360
,
1095
],
"convert_to_video-x-y"
:[
430
,
980
],
"convert_to_photos-x-y"
:[
200
,
1095
],
"photos-x-y"
:[
590
,
40
],
"stop_video-x-y"
:[
320
,
1095
],
"shot_cmd"
:[
""
],
"remount"
:[
"mount -o rw,remount"
],
"stop_hilog"
:[
"hilog -w stop"
],
...
...
@@ -48,16 +53,15 @@
"entry"
:
""
,
"mk_test_dir"
:[
"mkdir -p /data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile"
],
"close_auto_log"
:[
"hilog -w stop;rm /data/log/hilog/*"
],
"start_video_log"
:[
"hilog -r;hilog -
w start -l 400000000 -m none;hilog -G 512M
"
],
"start_video_log"
:[
"hilog -r;hilog -
Q pidoff;hilog -G 512M;hilog -w start -l 400000000 -m none
"
],
"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 *"
],
"clear_log"
:[
"rm /data/log/hilog/*"
],
"all_actions"
:
[
[
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
,
"
recover_log"
],
[
1
,
"
stop_hilog"
],
[
1
,
"check_result"
],
[
1
,
"compress_log"
],
[
15
,
"start_test"
],
[
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"
]
]
},
...
...
@@ -73,6 +77,15 @@
[
5
,
"audio_render_test"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/audio_render_log.tar"
]
]
},
{
"app_name"
:
"photos"
,
"entry"
:
"aa start -a com.ohos.photos.MainAbility -b com.ohos.photos"
,
"compress_log"
:[
"cd /data/log/hilog && tar -cf photos_log.tar *"
],
"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"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/photos_log.tar"
]
]
},
{
"app_name"
:
"camera"
,
"entry"
:
""
,
...
...
@@ -83,8 +96,28 @@
"start_camera"
:[
"aa start -a com.ohos.camera.MainAbility -b com.ohos.camera"
],
"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
,
"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"
]
]
},
{
"app_name"
:
"photograph"
,
"entry"
:
"aa start -a com.ohos.camera.MainAbility -b com.ohos.camera"
,
"compress_log"
:[
"cd /data/log/hilog && tar -cf photograph_log.tar *"
],
"chmodfile"
:[
"chmod 777 /data/NativeRdbTest"
],
"start_photographtest"
:[
"cd /data && ./NativeRdbTest --gtest_filter=RdbStoreInsertTest.RdbStore_Insert_001 && rm *.xml"
,
"[ PASSED ] 1 test"
],
"all_actions"
:
[
[
2
,
"permisson_ok-x-y"
],
[
2
,
"take_photos-x-y"
],
[
2
,
"take_photos-x-y"
],
[
1
,
"remount"
],
[
1
,
"send_file_to_dev"
,
"photographtest/NativeRdbTest"
,
"/data/"
],
[
2
,
"chmodfile"
],
[
2
,
"start_photographtest"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],[
1
,
"get_file_from_dev"
,
"/data/log/hilog/photograph_log.tar"
]
]
},
{
"app_name"
:
"jump_to_photos"
,
"entry"
:
"aa start -a com.ohos.camera.MainAbility -b com.ohos.camera"
,
"compress_log"
:[
"cd /data/log/hilog && tar -cf jump_to_photos_log.tar *"
],
"all_actions"
:
[
[
3
,
"convert_to_photos-x-y"
],
[
3
,
"convert_to_photos-x-y"
],
[
3
,
"convert_to_photos-x-y"
],
[
2
,
"photos-x-y"
],
[
2
,
"photos-x-y"
],
[
2
,
"photos-x-y"
],
[
2
,
"shot_cmd"
],
[
1
,
"cmp_cmd-level"
,
737280
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],[
1
,
"get_file_from_dev"
,
"/data/log/hilog/jump_to_photos_log.tar"
]
]
},
{
...
...
@@ -96,15 +129,6 @@
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/settings_log.tar"
]
]
},
{
"app_name"
:
"photos"
,
"entry"
:
"aa start -a com.ohos.photos.MainAbility -b com.ohos.photos"
,
"compress_log"
:[
"cd /data/log/hilog && tar -cf photos_log.tar *"
],
"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"
],
[
2
,
"recent-x-y"
],
[
2
,
"recent_del-x-y"
],
[
1
,
"stop_hilog"
],
[
1
,
"compress_log"
],
[
1
,
"get_file_from_dev"
,
"/data/log/hilog/photos_log.tar"
]
]
},
{
"app_name"
:
"note"
,
"entry"
:
"aa start -a MainAbility -b com.ohos.note"
,
...
...
screenshot/resource/capturescreentest.py
浏览文件 @
41640b1d
...
...
@@ -89,6 +89,17 @@ def GetFileFromDev(src, dst):
cmd
=
"hdc_std -t {} file recv
\"
{}
\"
\"
{}
\"
"
.
format
(
args
.
device_num
,
src
,
dst
)
return
EnterCmd
(
cmd
,
1
,
1
)
def
connection_judgment
():
connection_status
=
EnterCmd
(
"hdc_std list targets"
,
2
)
connection_cnt
=
0
while
"7001005458323933328a"
not
in
connection_status
and
connection_cnt
<
15
:
connection_status
=
EnterCmd
(
"hdc_std list targets"
,
2
)
connection_cnt
+=
1
if
connection_cnt
==
15
:
PrintToLog
(
"Device disconnection!!"
)
PrintToLog
(
"End of check, test failed!"
)
sys
.
exit
(
101
)
def
ConnectToWifi
(
tools_path
):
EnterShellCmd
(
"mkdir /data/l2tool"
,
1
)
SendFileToDev
(
os
.
path
.
normpath
(
os
.
path
.
join
(
tools_path
,
"l2tool/busybox"
)),
"/data/l2tool/"
)
...
...
@@ -147,7 +158,7 @@ if __name__ == "__main__":
cmp_status
=
0
global_pos
=
all_app
[
0
]
#rmlock
rebootcnt
=
2
while
rebootcnt
:
...
...
@@ -169,6 +180,7 @@ if __name__ == "__main__":
EnterShellCmd
(
"/data/screen_test/printscreen -f /data/screen_test/launcher_{}.png"
.
format
(
args
.
device_num
),
1
)
GetFileFromDev
(
"/data/screen_test/launcher_{}.pngraw"
.
format
(
args
.
device_num
),
args
.
save_path
)
GetFileFromDev
(
"/data/screen_test/launcher_{}.png"
.
format
(
args
.
device_num
),
args
.
save_path
)
connection_judgment
()
cmp_launcher
=
"cmp -l /data/screen_test/launcher_{}.pngraw /data/screen_test/train_set/launcher.pngraw | wc -l"
.
format
(
args
.
device_num
)
p
=
EnterShellCmd
(
cmp_launcher
,
1
)
num
=
re
.
findall
(
r
'[-+]?\d+'
,
p
)
...
...
@@ -321,12 +333,6 @@ if __name__ == "__main__":
elif
type
(
single_action
[
1
])
==
str
and
single_action
[
1
]
==
'connect_wifi'
:
next_cmd
=
""
ConnectToWifi
(
args
.
tools_path
)
elif
type
(
single_action
[
1
])
==
str
and
single_action
[
1
]
==
'log_packaging'
:
next_cmd
=
""
EnterShellCmd
(
"cd /data/log/hilog && tar -cf photos_log_{}.tar *"
.
format
(
4
-
testcnt
))
elif
type
(
single_action
[
1
])
==
str
and
single_action
[
1
]
==
'get_photos_log_from_dev'
:
next_cmd
=
""
EnterCmd
(
"hdc_std -t {} file recv
\"
/data/log/hilog/photos_log_{}.tar
\"
\"
{}
\"
"
.
format
(
args
.
device_num
,
4
-
testcnt
,
os
.
path
.
normpath
(
args
.
save_path
)))
#process_crash_check
elif
type
(
single_action
[
1
])
==
str
and
single_action
[
1
]
==
'process_crash_check'
:
next_cmd
=
""
...
...
@@ -391,6 +397,7 @@ if __name__ == "__main__":
else
:
testcnt
=
0
EnterShellCmd
(
"hilog -w stop"
,
1
)
connection_judgment
()
if
smoke_first_failed
==
'launcher'
:
break
...
...
@@ -460,8 +467,10 @@ if __name__ == "__main__":
sys
.
exit
(
0
)
elif
py_cmd
==
98
:
sys
.
exit
(
98
)
el
se
:
el
if
py_cmd
==
99
:
sys
.
exit
(
99
)
else
:
sys
.
exit
(
101
)
else
:
PrintToLog
(
"ERROR: name {}, index {}, these testcase is failed"
.
format
(
fail_name_list
,
fail_idx_list
))
PrintToLog
(
"SmokeTest find some key problems!"
)
...
...
@@ -470,5 +479,4 @@ if __name__ == "__main__":
else
:
PrintToLog
(
"All testcase is ok"
)
PrintToLog
(
"End of check, test succeeded!"
)
sys
.
exit
(
0
)
sys
.
exit
(
0
)
\ No newline at end of file
screenshot/resource/jump_to_photos.png
0 → 100644
浏览文件 @
41640b1d
97.1 KB
screenshot/resource/jump_to_photos.pngraw
0 → 100644
浏览文件 @
41640b1d
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录