mirror of
https://github.com/openharmony/applications_sample_wifi_iot.git
synced 2026-07-01 10:37:28 -04:00
添加相机拍照拦截,相机跳转图库拦截
Signed-off-by: redjie <hongshaojie@h-partners.com> Change-Id: If397d797297b746d887d7f0235c6c947eeebc48f
This commit is contained in:
@@ -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>
|
||||
|
||||
Binary file not shown.
@@ -1,13 +1,18 @@
|
||||
[
|
||||
{
|
||||
"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",
|
||||
|
||||
@@ -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)
|
||||
else:
|
||||
elif 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)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user