diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..29f81d812f3e768fa89638d1f72920dbfd1413a8
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
index 02bd276a78c11084ff42efab8f77ef2545cc2db4..c60415bf5fac36799e27a21844a4222675cbd107 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,46 @@
-# developtools_integration_verification
+# 集成验证部件
-#### 介绍
-{**以下是 Gitee 平台说明,您可以替换此简介**
-Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
-无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
+## 简介
+集成验证包含门禁冒烟和每日构建两个功能:
+- 门禁冒烟对开发者的提交进行基本功能、部件功能和按场景的端到端测试;
+- 每日构建定时取master和release分支代码进行版本归档、全量TDD测试、最小系统测试和部件化的架构看护检查。
-#### 软件架构
-软件架构说明
+**图1** 集成验证架构图
+
-#### 安装教程
+## 目录
-1. xxxx
-2. xxxx
-3. xxxx
+```undefined
+/developtools/integration_verification
+├── cases # 用例
+│ ├── daily # 每日构建
+│ │ └── mini_system # 最小系统测试
+│ └── smoke # 门禁冒烟
+│ ├── audio # 音频用例
+│ ├── basic # 基础功能用例
+│ │ ├── screenshot32
+│ │ └── screenshot64
+│ ├── distributed # 分布式场景端到端用例
+│ └── video # 视频用例
+├── test # 自测试用例
+└── tools # 公共工具集
+ └── rom_ram_analyzer # ROM/RAM分析工具
+```
-#### 使用说明
+## 说明
-1. xxxx
-2. xxxx
-3. xxxx
+### 使用说明
+#### 关联仓和冒烟用例
+当新建仓或仓对应系统功能发生变化时,通常需要在门禁中添加和修改冒烟用例的关联。关联关系通过cases/smoke/repo_cases_matrix.csv文件配置,文件第一列为仓名,从第二列为部件名称,第三列开始为不同形态的开发板(包括虚拟开发板),仓与开发板的交集中填写测试用例名称。示例如下:
-#### 参与贡献
+| repoistory | bundle | board1 | board2 | ... |
+| ---------- | ---------- | --------------------- | --------------------- | ---- |
+| repo1 | component1 | test_case1 | test_case1;test_case2 | ... |
+| repo2 | component2 | test_case1;test_case2 | test_case1 | ... |
-1. Fork 本仓库
-2. 新建 Feat_xxx 分支
-3. 提交代码
-4. 新建 Pull Request
+一般一个测试用例对应一个可执行文件,在门禁构建时产生和烧录设备。
+## 相关仓
-#### 特技
-
-1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
-2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
-3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
-4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
-5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
-6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
+[**developtools\_integration\_verification**](https://gitee.com/openharmony/developtools_integration_verification/blob/master/README_zh.md)
\ No newline at end of file
diff --git a/cases/daily/mini_system/L0_mini_system_test.py b/cases/daily/mini_system/L0_mini_system_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..bdcb917aaacd464574c052309e15c4860491f098
--- /dev/null
+++ b/cases/daily/mini_system/L0_mini_system_test.py
@@ -0,0 +1,121 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from ast import parse
+import json
+import sys
+import os
+import time
+import argparse
+import re
+import subprocess
+import shlex
+import datetime
+import serial
+import threading
+
+def GetDirSize(dir_path):
+ if not os.path.exists(dir_path):
+ PrintToLog("\n\nERROR: %s, dir are not exist!!!\n" % dir_path)
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ size = 0
+ for root, dirs, files in os.walk(dir_path):
+ for name in files:
+ sz = os.path.getsize(os.path.join(root, name))
+ print('{} : {}byte'.format(os.path.join(root, name), sz))
+ size += sz
+ PrintToLog('total size: {:.2f}M'.format(size/1024/1024))
+ return size
+
+def PrintToLog(str):
+ time = datetime.datetime.now()
+ str = "[{}] {}".format(time, str)
+ print(str)
+ with open(os.path.join(args.save_path, 'L0_mini_test.log'), mode='a', encoding='utf-8') as log_file:
+ console = sys.stdout
+ sys.stdout = log_file
+ print(str)
+ sys.stdout = console
+ log_file.close()
+
+def WriteToComPort(com_port, cmd):
+ len = com_port.write(cmd.encode('utf-8'))
+ print('{}'.format(len))
+ return
+
+def ReadFromComPort(com_port, timeout):
+ time_start = datetime.datetime.now()
+ time_end = time_start
+ #print((time_end - time_start).seconds)
+ global com_output
+ com_output = ''
+ while (time_end - time_start).seconds < timeout:
+ com_output_once = ''
+ while com_port.inWaiting() > 0:
+ com_output_once += com_port.read(com_port.inWaiting()).decode()
+ if com_output_once != '':
+ com_output += com_output_once
+ print('{}'.format(com_output_once), end='')
+ time_end = datetime.datetime.now()
+ return com_output
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description='manual to this script')
+ parser.add_argument('--com_port', type=str, default = 'COM5')
+ parser.add_argument('--com_baudrate', type=int, default = 115200)
+ parser.add_argument('--save_path', type=str, default = 'D:\\DeviceTestTools\\screenshot')
+ parser.add_argument('--archive_path', type=str, default = 'Z:\workspace\ohos_L2\ohos\out\hispark_pegasus\hispark_pegasus_mini_system')
+ args = parser.parse_args()
+
+ com_port = serial.Serial(args.com_port, args.com_baudrate)
+ if com_port.isOpen():
+ PrintToLog("{} is open successed".format(com_port))
+ else:
+ PrintToLog("{} is open failed".format(com_port))
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+
+ read_com_thread = threading.Thread(target=ReadFromComPort, args=(com_port, 10))
+ read_com_thread.setDaemon(True)
+ print('read wait:')
+ read_com_thread.start()
+ time.sleep(1)
+ WriteToComPort(com_port, '\r\n\r\n')
+ WriteToComPort(com_port, 'AT+SYSINFO\r\n')
+ print('enter AT+SYSINFO')
+ time.sleep(3)
+ hivew_proc_find = re.findall('hiview,id=\d{1,3},status=\d{1,10},pri=\d{1,3},size=', com_output)
+ #Bootstrap_proc_find = re.findall('Bootstrap,id=\d{1,3},status=\d{1,10},pri=\d{1,3},size=', com_output)
+ print(hivew_proc_find)
+ if type(hivew_proc_find) == list and len(hivew_proc_find) > 0:
+ PrintToLog('hivew_proc found')
+ else:
+ PrintToLog('hivew_proc not found')
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+
+ target_file = os.path.normpath(os.path.join(args.archive_path, "OHOS_image.bin"))
+ ret_size = os.path.getsize(target_file)/1024/1024
+ PrintToLog('Size of OHOS_image.bin : {:.2f}M'.format(ret_size))
+ if ret_size > 1:
+ PrintToLog('ERROR: Size of OHOS_image.bin ({:.2f}M) is over the upper limit(1M)'.format(ret_size))
+ target_dir = os.path.normpath(os.path.join(args.archive_path, "libs"))
+ GetDirSize(target_dir)
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+
+ PrintToLog("End of check, test succeeded!")
+ sys.exit(0)
+
diff --git a/cases/daily/mini_system/L1_mini_system_test.py b/cases/daily/mini_system/L1_mini_system_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..a9c4e0d55ce6152192e28b7d2809a3b32c3b34f2
--- /dev/null
+++ b/cases/daily/mini_system/L1_mini_system_test.py
@@ -0,0 +1,172 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from ast import parse
+import json
+import sys
+import os
+import time
+import argparse
+import re
+import subprocess
+import shlex
+import datetime
+import serial
+import threading
+
+def GetDirSize(dir_path):
+ if not os.path.exists(dir_path):
+ PrintToLog("\n\nERROR: %s, dir are not exist!!!\n" % dir_path)
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ size = 0
+ for root, dirs, files in os.walk(dir_path):
+ for name in files:
+ sz = os.path.getsize(os.path.join(root, name))
+ print('{} : {}byte'.format(os.path.join(root, name), sz))
+ size += sz
+ PrintToLog('total size: {:.2f}M'.format(size/1024/1024))
+ return size
+
+def PrintToLog(str):
+ time = datetime.datetime.now()
+ str = "[{}] {}".format(time, str)
+ print(str)
+ with open(os.path.join(args.save_path, 'L1_mini_test.log'), mode='a', encoding='utf-8') as log_file:
+ console = sys.stdout
+ sys.stdout = log_file
+ print(str)
+ sys.stdout = console
+ log_file.close()
+
+def WriteToComPort(com_port, cmd):
+ len = com_port.write(cmd.encode('utf-8'))
+ #print('{}'.format(len))
+ return
+
+def ReadFromComPort(com_port, timeout):
+ time_start = datetime.datetime.now()
+ time_end = time_start
+ #print((time_end - time_start).seconds)
+ global com_output
+ com_output = ''
+ while (time_end - time_start).seconds < timeout:
+ com_output_once = ''
+ while com_port.inWaiting() > 0:
+ com_output_once += com_port.read(com_port.inWaiting()).decode()
+ if com_output_once != '':
+ com_output += com_output_once
+ print('{}'.format(com_output_once), end='')
+ time_end = datetime.datetime.now()
+ return com_output
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description='manual to this script')
+ parser.add_argument('--com_port', type=str, default = 'COM8')
+ parser.add_argument('--com_baudrate', type=int, default = 115200)
+ parser.add_argument('--save_path', type=str, default = 'D:\\DeviceTestTools\\screenshot')
+ parser.add_argument('--archive_path', type=str, default = 'D:\DeviceTestTools')
+ args = parser.parse_args()
+
+ com_port = serial.Serial(args.com_port, args.com_baudrate)
+ if com_port.isOpen():
+ PrintToLog("{} is open successed".format(com_port))
+ else:
+ PrintToLog("{} is open failed".format(com_port))
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+
+ res = com_port.write("free".encode('utf-8'));
+ read_com_thread = threading.Thread(target=ReadFromComPort, args=(com_port, 10))
+ read_com_thread.setDaemon(True)
+ print('read wait:')
+ read_com_thread.start()
+ time.sleep(1)
+ WriteToComPort(com_port, '\r\n\r\n\r\n')
+ WriteToComPort(com_port, 'task\r\n')
+ print('enter task')
+ time.sleep(3)
+ print(com_output)
+ foundation_proc_find = re.findall('\d{1,4}\s*\d{1,4}\s*\d{1,4}\s*\d{1,4}.\d{1,4}\s*foundation', com_output)
+ print(foundation_proc_find)
+ if type(foundation_proc_find) == list and len(foundation_proc_find) > 0:
+ PrintToLog('found foundation process')
+ else:
+ PrintToLog('not found foundation process')
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ shell_proc_find = re.findall('\d{1,4}\s*\d{1,4}\s*\d{1,4}\s*\d{1,4}.\d{1,4}\s*shell', com_output)
+ print(shell_proc_find)
+ if type(shell_proc_find) == list and len(shell_proc_find) > 0:
+ PrintToLog('found shell process')
+ else:
+ PrintToLog('not found shell process')
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ apphilogcat_proc_find = re.findall('\d{1,4}\s*\d{1,4}\s*\d{1,4}\s*\d{1,4}.\d{1,4}\s*apphilogcat', com_output)
+ print(apphilogcat_proc_find)
+ if type(apphilogcat_proc_find) == list and len(apphilogcat_proc_find) > 0:
+ PrintToLog('found apphilogcat process')
+ else:
+ PrintToLog('not found apphilogcat process')
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ deviceauth_service_proc_find = re.findall('\d{1,4}\s*\d{1,4}\s*\d{1,4}\s*\d{1,4}.\d{1,4}\s*deviceauth_service', com_output)
+ print(deviceauth_service_proc_find)
+ if type(deviceauth_service_proc_find) == list and len(deviceauth_service_proc_find) > 0:
+ PrintToLog('found deviceauth_service process')
+ else:
+ PrintToLog('not found deviceauth_service process')
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ softbus_server_proc_find = re.findall('\d{1,4}\s*\d{1,4}\s*\d{1,4}\s*\d{1,4}.\d{1,4}\s*softbus_server', com_output)
+ print(softbus_server_proc_find)
+ if type(softbus_server_proc_find) == list and len(softbus_server_proc_find) > 0:
+ PrintToLog('found softbus_server process')
+ else:
+ PrintToLog('not found softbus_server process')
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ mem_find = re.findall('Mem:\s*\d*\s*\d*\s*\d*\s*\d*', com_output)
+ print(mem_find)
+ if len(mem_find) > 0:
+ mem_size = int(mem_find[0].split()[2]) / 1024 / 1024
+ else:
+ PrintToLog('Error:can find memory usage info!')
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ if mem_size > 25:
+ PrintToLog(
+ 'Error:memory usage is over the upper limit(25M),now is {:.2f}'.format(mem_size))
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+
+ 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, "userfs"))
+ 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!")
+ sys.exit(99)
+
+ PrintToLog("End of check, test succeeded!")
+ sys.exit(0)
diff --git a/cases/daily/mini_system/L2_mini_system_test.py b/cases/daily/mini_system/L2_mini_system_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..22f403f775ec5ab758e72f3dbaa4f370e1485ae8
--- /dev/null
+++ b/cases/daily/mini_system/L2_mini_system_test.py
@@ -0,0 +1,217 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from ast import parse
+import json
+import sys
+import os
+import time
+import argparse
+import re
+import subprocess
+import shlex
+import datetime
+
+def GetDirSize(dir_path):
+ if not os.path.exists(dir_path):
+ PrintToLog("\n\nERROR: %s, dir are not exist!!!\n" % dir_path)
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ size = 0
+ for root, dirs, files in os.walk(dir_path):
+ for name in files:
+ if not os.path.islink(os.path.join(root, name)):
+ sz = os.path.getsize(os.path.join(root, name))
+ #print('{} : {}byte'.format(os.path.join(root, name), sz))
+ size += sz
+ PrintToLog('total size: {:.2f}M'.format(size/1024/1024))
+ return size
+
+def PrintToLog(str):
+ time = datetime.datetime.now()
+ str = "[{}] {}".format(time, str)
+ print(str)
+ with open(os.path.join(args.save_path, 'L2_mini_test_{}.log'.format(args.device_num)), mode='a', encoding='utf-8') as log_file:
+ console = sys.stdout
+ sys.stdout = log_file
+ print(str)
+ sys.stdout = console
+ log_file.close()
+
+def EnterCmd(mycmd, waittime = 0, printresult = 1):
+ if mycmd == "":
+ return
+ global CmdRetryCnt
+ CmdRetryCnt = 1
+ EnterCmdRetry = 2
+ while EnterCmdRetry:
+ EnterCmdRetry -= 1
+ try:
+ p = subprocess.Popen(mycmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ result, unused_err = p.communicate(timeout=25)
+ try:
+ result=result.decode(encoding="utf-8")
+ except UnicodeDecodeError:
+ result=result.decode('gbk', errors='ignore')
+ break
+ except Exception as e:
+ result = 'retry failed again'
+ PrintToLog(e)
+ CmdRetryCnt += 1
+ p.kill()
+ if printresult == 1:
+ with open(os.path.join(args.save_path, 'mini_test_{}.bat'.format(args.device_num)), mode='a', encoding='utf-8') as cmd_file:
+ cmd_file.write(mycmd + '\n')
+ cmd_file.close()
+ PrintToLog(mycmd)
+ PrintToLog(result)
+ sys.stdout.flush()
+ if waittime != 0:
+ time.sleep(waittime)
+ if printresult == 1:
+ with open(os.path.join(args.save_path, 'mini_test_{}.bat'.format(args.device_num)), mode='a', encoding='utf-8') as cmd_file:
+ cmd_file.write("ping -n {} 127.0.0.1>null\n".format(waittime))
+ cmd_file.close()
+ return result
+
+def EnterShellCmd(shellcmd, waittime = 0, printresult = 1):
+ if shellcmd == "":
+ return
+ cmd = "hdc_std -t {} shell \"{}\"".format(args.device_num, shellcmd)
+ return EnterCmd(cmd, waittime, printresult)
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description='manual to this script')
+ parser.add_argument('--save_path', type=str, default = 'D:\\DeviceTestTools\\screenshot')
+ parser.add_argument('--device_num', type=str, default = 'null')
+ parser.add_argument('--archive_path', type=str, default = 'Z:\workspace\ohos_L2\ohos\out\\rk3568\packages\phone')
+ args = parser.parse_args()
+
+ if args.device_num == 'null':
+ result = EnterCmd("hdc_std list targets", 1, 0)
+ print(result)
+ args.device_num = result.split()[0]
+
+ PrintToLog("\n\n########## First check key processes start ##############")
+ lose_process = []
+ process_pid = {}
+
+ two_check_process_list = ['huks_service', 'hilogd', 'hdf_devmgr', 'samgr', 'foundation', 'accesstoken_ser',]
+ other_process_list = ['softbus_server', 'deviceauth_service']
+
+ for pname in two_check_process_list:
+ pids = EnterCmd("hdc_std -t {} shell pidof {}".format(args.device_num, pname), 0, 1)
+ try:
+ pidlist = pids.split()
+ int(pidlist[0])
+ for pid in pidlist:
+ int(pid)
+ process_pid[pname] = pidlist
+ except:
+ lose_process.append(pname)
+ all_p = EnterShellCmd("ps -elf")
+ for pname in other_process_list:
+ findp = all_p.find(pname, 0, len(all_p))
+ if findp == -1:
+ lose_process.append(pname)
+
+ if lose_process:
+ PrintToLog("\n\nERROR: %s, These processes are not exist!!!\n" % lose_process)
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ else:
+ PrintToLog("First processes check is ok\n")
+
+ # check processes usage
+ res = EnterCmd("hdc_std -t {} shell hidumper --mem".format(args.device_num), 0, 1)
+ process_usage = int(res.split(':')[-1].split()[0]) / 1024
+ if process_usage > 40:
+ PrintToLog(
+ "ERROR: Processes usage cannot be greater than 40M, but currently it's actually %.2fM" % process_usage)
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+
+ time.sleep(10)
+
+ #key processes second check, and cmp to first check
+ PrintToLog("\n\n########## Second check key processes start ##############")
+ second_check_lose_process = []
+ #for pname in two_check_process_list + other_process_list:
+ for pname in two_check_process_list:
+ pids = EnterCmd("hdc_std -t {} shell pidof {}".format(args.device_num, pname), 0, 1)
+ try:
+ pidlist = pids.split()
+ if process_pid[pname] != pidlist:
+ if pname in two_check_process_list:
+ 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)
+ else:
+ PrintToLog("WARNNING: pid of %s is different the first check" % pname)
+ elif len(pidlist) != 1:
+ if pname in two_check_process_list:
+ 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)
+ else:
+ PrintToLog("WARNNING: pid of %s is not only one" % pname)
+ except:
+ second_check_lose_process.append(pname)
+
+ if second_check_lose_process:
+ PrintToLog("ERROR: pid of %s is not exist" % pname)
+ PrintToLog("SmokeTest find some fatal problems!")
+ PrintToLog("End of check, test failed!")
+ sys.exit(99)
+ else:
+ PrintToLog("Second processes check is ok\n")
+
+ 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!")
+ sys.exit(99)
+
+ 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!")
+ sys.exit(99)
+
+ 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!")
+ sys.exit(99)
+
+ 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!")
+ sys.exit(99)
+
+ PrintToLog("All testcase is ok")
+ PrintToLog("End of check, test succeeded!")
+ sys.exit(0)
diff --git a/cases/smoke/basic/screenshot32/DistributedTest/config/user_config.xml b/cases/smoke/basic/screenshot32/DistributedTest/config/user_config.xml
new file mode 100644
index 0000000000000000000000000000000000000000..d2a9f63abcb59405f3912326fe29e44730540356
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/DistributedTest/config/user_config.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+ 7001005458323933328a017ce1b13800;7001005458323933328a258f3d043900
+
+
+
+
+ cmd
+ 115200
+ 8
+ 1
+ 20
+
+
+
+ deploy
+ 115200
+
+
+
+
+
+ cmd
+ 115200
+ 8
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DEBUG
+ ON
+
\ No newline at end of file
diff --git a/cases/smoke/basic/screenshot32/DistributedTest/main.py b/cases/smoke/basic/screenshot32/DistributedTest/main.py
new file mode 100644
index 0000000000000000000000000000000000000000..3eeb592cd30fb4c3149f055927178de3442f9346
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/DistributedTest/main.py
@@ -0,0 +1,9 @@
+import sys
+from xdevice.__main__ import main_process
+from testcases.set_sn import get_devices_sn
+
+if __name__ == '__main__':
+ get_devices_sn()
+ argv = "{} {} {}".format(sys.argv[1], sys.argv[2], sys.argv[3])
+ print(">>>>>>>:{}".format(argv))
+ main_process(argv)
\ No newline at end of file
diff --git a/cases/smoke/basic/screenshot32/DistributedTest/testcases/DistributedTest.json b/cases/smoke/basic/screenshot32/DistributedTest/testcases/DistributedTest.json
new file mode 100644
index 0000000000000000000000000000000000000000..8188504822d6d044c229c768aa35df981ecad1bb
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/DistributedTest/testcases/DistributedTest.json
@@ -0,0 +1,17 @@
+{
+ "description": "Config for OpenHarmony devicetest test cases",
+ "environment": [
+ {
+ "type": "device",
+ "label": "phone"
+ },
+ {
+ "type": "device",
+ "label": "phone"
+ }
+ ],
+ "driver": {
+ "type": "DeviceTest",
+ "py_file": ["DistributedTest.py"]
+ }
+}
\ No newline at end of file
diff --git a/cases/smoke/basic/screenshot32/DistributedTest/testcases/DistributedTest.py b/cases/smoke/basic/screenshot32/DistributedTest/testcases/DistributedTest.py
new file mode 100644
index 0000000000000000000000000000000000000000..bec8615b1bad3c770ca66b799a03b0d605ab55ab
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/DistributedTest/testcases/DistributedTest.py
@@ -0,0 +1,124 @@
+# -*- coding: utf-8 -*-
+import time
+import threading
+import re
+from devicetest.core.test_case import TestCase
+from devicetest.aw.OpenHarmony import CommonOH
+from testcases.orc import Orc
+
+
+class DistributedTest(TestCase):
+ def __init__(self, controllers):
+ self.TAG = self.__class__.__name__
+ self.tests = [
+ # 设备组网
+ "sub_distributed_smoke_testcase_0100",
+ # pin码连接
+ "sub_distributed_smoke_testcase_0200",
+ # 结果校验
+ "sub_distributed_smoke_testcase_0300"
+ ]
+ TestCase.__init__(self, self.TAG, controllers)
+
+ def setup(self):
+ print("预置工作:初始化设备开始...........................")
+ print(self.devices[0].device_id)
+ print(self.devices[1].device_id)
+
+ def sub_distributed_smoke_testcase_0100(self):
+ t1 = threading.Thread(target=self.net_connect1)
+ t2 = threading.Thread(target=self.net_connect2)
+ t1.start()
+ t2.start()
+ t1.join()
+ t2.join()
+
+ def sub_distributed_smoke_testcase_0200(self):
+ CommonOH.startAbility(self.Phone1, "ohos.samples.distributedcalc.MainAbility", "ohos.samples.distributedcalc")
+ time.sleep(2)
+ # 授权
+ CommonOH.click(self.Phone1, 500, 1130)
+ CommonOH.click(self.Phone1, 500, 1130)
+ CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step1.jpeg")
+ CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step1.jpeg testcases\\distributedcalc_step1.jpeg")
+ CommonOH.click(self.Phone1, 610, 110)
+ time.sleep(2)
+ CommonOH.click(self.Phone1, 380, 1150)
+ CommonOH.click(self.Phone1, 610, 110)
+ time.sleep(2)
+ CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step2.jpeg")
+ CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step2.jpeg testcases\\distributedcalc_step2.jpeg")
+ CommonOH.click(self.Phone1, 580, 1090)
+ time.sleep(2)
+ CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step3.jpeg")
+ CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step3.jpeg testcases\\distributedcalc_step3.jpeg")
+ #确定
+ CommonOH.click(self.Phone2, 520, 520)
+ CommonOH.click(self.Phone2, 520, 520)
+ CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step4.jpeg")
+ CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step4.jpeg testcases\\distributedcalc_step4.jpeg")
+ time.sleep(2)
+ code = Orc("testcases\\distributedcalc_step4.jpeg")
+ self.code = re.findall("[0-9]{6}", code)[0]
+ #输pin码
+ CommonOH.click(self.Phone1, 340, 530)
+ CommonOH.click(self.Phone1, 340, 530)
+ time.sleep(1)
+ #切换至数字输入
+ CommonOH.click(self.Phone1, 60, 1145)
+ time.sleep(1)
+ for i in self.code:
+ if i == "0":
+ CommonOH.click(self.Phone1, 676, 778)
+ else:
+ j = int(i) - 1
+ CommonOH.click(self.Phone1, 46 + j * 70, 778)
+ time.sleep(1)
+ CommonOH.click(self.Phone1, 60, 1145)
+ CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step5.jpeg")
+ # 确定
+ CommonOH.click(self.Phone1, 500, 600)
+ CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step5.jpeg testcases\\distributedcalc_step5.jpeg")
+
+ def sub_distributed_smoke_testcase_0300(self):
+ # 切入后台,结束进程
+ CommonOH.click(self.Phone1, 512, 1246)
+ CommonOH.click(self.Phone1, 360, 1168)
+ # 重启计算器应用
+ CommonOH.startAbility(self.Phone1, "ohos.samples.distributedcalc.MainAbility", "ohos.samples.distributedcalc")
+ time.sleep(2)
+ # 拉起远端设备
+ CommonOH.click(self.Phone1, 610, 110)
+ time.sleep(3)
+ CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step6.jpeg")
+ CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step6.jpeg testcases\\distributedcalc_step6.jpeg")
+ CommonOH.click(self.Phone1, 580, 1090)
+ CommonOH.click(self.Phone1, 580, 1090)
+ # 设备二授权
+ time.sleep(2)
+ CommonOH.click(self.Phone2, 500, 1130)
+ CommonOH.click(self.Phone2, 500, 1130)
+ # 校验远端计算器是否被拉起
+ CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step7.jpeg")
+ CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step7.jpeg testcases\\distributedcalc_step7.jpeg")
+ CommonOH.hdc_std(self.Phone2, 'shell "aa dump -a | grep distributedcalc > /data/report.txt"')
+ CommonOH.hdc_std(self.Phone2, "file recv /data/report.txt testcases\\report.txt")
+ time.sleep(1)
+ CommonOH.hdc_std(self.Phone1, "file send testcases\\report.txt /data/report.txt")
+
+ def net_connect1(self):
+ # 点亮屏幕
+ CommonOH.wake(self.Phone1)
+ # 设置不息屏
+ CommonOH.hdc_std(self.Phone1, 'shell "power-shell setmode 602"')
+
+ def net_connect2(self):
+ # 点亮屏幕
+ CommonOH.wake(self.Phone2)
+ # 设置不息屏
+ CommonOH.hdc_std(self.Phone2, 'shell "power-shell setmode 602"')
+
+ def teardown(self):
+ # 切入后台,结束进程
+ CommonOH.hdc_std(self.Phone1, "shell killall ohos.samples.distributedcalc")
+ CommonOH.hdc_std(self.Phone2, "shell killall ohos.samples.distributedcalc")
\ No newline at end of file
diff --git a/cases/smoke/basic/screenshot32/DistributedTest/testcases/orc.py b/cases/smoke/basic/screenshot32/DistributedTest/testcases/orc.py
new file mode 100644
index 0000000000000000000000000000000000000000..54ab14b87e9dba3ec819d9900c37ac33110a5cc1
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/DistributedTest/testcases/orc.py
@@ -0,0 +1,10 @@
+import pytesseract
+from PIL import Image
+
+
+def Orc(path):
+ pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe'
+ tessdata_dir_config = '--tessdata-dir "C:\\Program Files (x86)\\Tesseract-OCR\\tessdata"'
+ image = Image.open(path)
+ code = pytesseract.image_to_string(image, config=tessdata_dir_config)
+ return code
diff --git a/cases/smoke/basic/screenshot32/DistributedTest/testcases/set_sn.py b/cases/smoke/basic/screenshot32/DistributedTest/testcases/set_sn.py
new file mode 100644
index 0000000000000000000000000000000000000000..6ccbba0df5ffa912b6010907567300855f88445b
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/DistributedTest/testcases/set_sn.py
@@ -0,0 +1,21 @@
+import encodings
+import os
+import re
+from xml.dom.minidom import parse
+
+def get_devices_sn():
+ cmd_sn = os.popen("hdc_std list targets").read()
+ device_sn = re.findall('[\w+]{32}', cmd_sn) + re.findall('[\w+]{16}', cmd_sn)
+ dom_tree = parse('config\\user_config.xml')
+ collection = dom_tree.documentElement
+ sn1 = collection.getElementsByTagName('sn')[0]
+ if len(device_sn[0]) == len(device_sn[1]):
+ sn1.childNodes[0].data = "{};{}".format(device_sn[0], device_sn[1])
+ else:
+ sn1.childNodes[0].data = device_sn[0]
+ with open('config\\user_config.xml', 'w', encoding='utf-8') as f:
+ dom_tree.writexml(f, encoding='utf-8')
+ f.close()
+
+if __name__ == '__main__':
+ get_devices_sn()
\ No newline at end of file
diff --git a/cases/smoke/basic/screenshot32/audiotest/audio_renderer_unit_test b/cases/smoke/basic/screenshot32/audiotest/audio_renderer_unit_test
new file mode 100644
index 0000000000000000000000000000000000000000..59093521a9b6c37c5aca94bcf578a49b1c64ecc0
Binary files /dev/null and b/cases/smoke/basic/screenshot32/audiotest/audio_renderer_unit_test differ
diff --git a/cases/smoke/basic/screenshot32/audiotest/test_44100_2.wav b/cases/smoke/basic/screenshot32/audiotest/test_44100_2.wav
new file mode 100644
index 0000000000000000000000000000000000000000..70dea75a08d17b43ef9d501184014a8dec42cdc0
Binary files /dev/null and b/cases/smoke/basic/screenshot32/audiotest/test_44100_2.wav differ
diff --git a/cases/smoke/basic/screenshot32/l2tool/busybox b/cases/smoke/basic/screenshot32/l2tool/busybox
new file mode 100644
index 0000000000000000000000000000000000000000..bb8c6c2a7f66274277dad579038b44a355c505d4
Binary files /dev/null and b/cases/smoke/basic/screenshot32/l2tool/busybox differ
diff --git a/cases/smoke/basic/screenshot32/l2tool/dhcpc.sh b/cases/smoke/basic/screenshot32/l2tool/dhcpc.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b94b73965638945289d1a31eb8bdd6449b3d5f95
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/l2tool/dhcpc.sh
@@ -0,0 +1,39 @@
+#!/system/bin/sh
+# udhcpc script edited by Tim Riker
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+RESOLV_CONF="/etc/resolv.conf"
+[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+[ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+case "$1" in
+ deconfig)
+ /system/bin/ifconfig $interface 0.0.0.0
+ ;;
+
+ renew|bound)
+ /system/bin/ifconfig $interface $ip $BROADCAST $NETMASK
+
+ if [ -n "$router" ] ; then
+ echo "deleting routers"
+ while ./busybox route del default gw 0.0.0.0 dev $interface ; do
+ :
+ done
+
+ for i in $router ; do
+ ./busybox route add default gw $i dev $interface
+ done
+ fi
+
+ echo -n > $RESOLV_CONF
+ [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
+ for i in $dns ; do
+ echo adding dns $i
+ echo nameserver $i >> $RESOLV_CONF
+ done
+ ;;
+esac
+
+exit 0
+
diff --git a/cases/smoke/basic/screenshot32/l2tool/wpa_supplicant.conf b/cases/smoke/basic/screenshot32/l2tool/wpa_supplicant.conf
new file mode 100644
index 0000000000000000000000000000000000000000..81ffc27a5435f2d6edd8da554b7103fd3f3a35e8
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/l2tool/wpa_supplicant.conf
@@ -0,0 +1,8 @@
+country=GB
+#update_config=1
+#ap_scan=1
+
+network={
+ ssid="testapold"
+ psk="passw0rd1!"
+}
\ No newline at end of file
diff --git a/cases/smoke/basic/screenshot32/resource/app_capture_screen_test_config.json b/cases/smoke/basic/screenshot32/resource/app_capture_screen_test_config.json
new file mode 100644
index 0000000000000000000000000000000000000000..4761803fd7e4349330728e8d3838c641a14cbfcf
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/resource/app_capture_screen_test_config.json
@@ -0,0 +1,145 @@
+[
+ {
+ "DEVICE_1":[1, 2, 3, 8, 10, 12],
+ "DEVICE_2":[4, 5, 6, 7, 9, 11],
+ "recent-x-y":[515, 1240],
+ "recent_del-x-y":[360, 1170],
+ "permisson_ok-x-y":[500, 1130],
+ "note_content-x-y":[500, 310],
+ "take_photos-x-y":[360, 1095],
+ "convert_to_video-x-y":[430, 980],
+ "convert_to_photos-x-y":[200, 1095],
+ "last_photos-x-y":[100, 220],
+ "stop_video-x-y":[320, 1095],
+ "phone-x-y":[645, 1060],
+ "screenshot-x-y":[115,480],
+ "shot_cmd":[""],
+ "remount":["mount -o rw,remount"],
+ "stop_hilog":["hilog -w stop"],
+ "cmp_cmd-level":["", 443200],
+ "get_file_from_dev":[""],
+ "send_file_to_dev":["", ""]
+ },
+ {
+ "app_name": "crash_check",
+ "entry": "",
+ "compress_file_recv":["cd /data/log/faultlog/temp && tar -cf crash_log.tar cppcrash*"],
+ "all_actions": [
+ [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"]
+ ]
+ },
+ {
+ "app_name": "notification_bar",
+ "entry": "",
+ "pull_down_cmd":["uinput -T -m 500 0 550 30"],
+ "swipe_up_cmd":["uinput -T -m 500 500 550 300"],
+ "all_actions": [
+ [2, "pull_down_cmd"], [2, "pull_down_cmd"], [2, "shot_cmd"], [2, "cmp_cmd-level"], [1, "swipe_up_cmd"], [1, "swipe_up_cmd"]
+ ]
+ },
+ {
+ "app_name": "wifi_connect",
+ "entry": "",
+ "check_ping_baidu":["ping www.baidu.com", "64 bytes from"],
+ "all_actions": [
+ [2, "connect_wifi"], [1, "check_ping_baidu"]
+ ]
+ },
+ {
+ "app_name": "video_test",
+ "entry": "",
+ "mk_test_dir":["mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.video.videoplayer/haps/entry/files"],
+ "start_video_log":["rm /data/log/hilog/* && hilog -r && hilog -Q pidoff;hilog -G 512M;hilog -w start -l 400000000 -m none"],
+ "start_test":["aa test -p ohos.acts.multimedia.video.videoplayer -b ohos.acts.multimedia.video.videoplayer -s unittest OpenHarmonyTestRunner -w 2000000 -s timeout 60000", "Failure: 0, Error: 0, Pass: 1"],
+ "compress_log":["cd /data/log/hilog && tar -cf video_log.tar *"],
+ "kill_video": ["killall ohos.acts.multimedia.video.videoplayer"],
+ "all_actions": [
+ [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/el2/100/base/ohos.acts.multimedia.video.videoplayer/haps/entry/files/"],
+ [5, "start_test"], [1, "stop_hilog"], [1, "compress_log"], [1, "get_file_from_dev", "/data/log/hilog/video_log.tar"], [1, "kill_video"]
+ ]
+ },
+ {
+ "app_name": "camera",
+ "entry": "",
+ "check_result":["cd /data/log/hilog && grep -nr PreviewOutputCallback", "OnFrameStarted"],
+ "compress_log":["cd /data/log/hilog && tar -cf camera_log.tar *"],
+ "open_camera_log":["rm /data/log/hilog/* && hilog -b X;hilog -b D -T CAMERA;hilog -r"],
+ "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"],
+ "kill_camera": ["killall com.ohos.camera"],
+ "kill_photos": ["killall com.ohos.photos"],
+ "all_actions": [
+ [1, "open_camera_log"], [5, "start_camera"], [3, "take_photos-x-y"], [2, "convert_to_video-x-y"], [3, "take_photos-x-y"], [2, "stop_video-x-y"], [6, "convert_to_photos-x-y"],
+ [2, 670, 40], [1, "recover_log"], [1, "check_result"], [1, "shot_cmd", "camera_to_photos"], [1, "cmp_cmd-level", 1900000], [1, "compress_log"],
+ [1, "get_file_from_dev", "/data/log/hilog/camera_log.tar"], [1, "kill_camera"], [1, "kill_photos"]
+ ]
+ },
+ {
+ "app_name": "audio_render",
+ "entry": "",
+ "remount":["mount -o rw,remount /"],
+ "chmodfile1":["chmod 777 /data/audio_renderer_unit_test"],
+ "audio_render_test":["cd /data && ./audio_renderer_unit_test --gtest_filter=AudioRendererUnitTest.Audio_Renderer_Playback_001 && rm *.xml", "[ PASSED ] 1 test"],
+ "all_actions": [
+ [1, "remount"], [1, "send_file_to_dev", "audiotest/audio_renderer_unit_test", "/data/"], [1, "send_file_to_dev", "audiotest/test_44100_2.wav", "/data/"], [2, "chmodfile1"],
+ [5, "audio_render_test"]
+ ]
+ },
+ {
+ "app_name": "photos",
+ "entry": "",
+ "pull_down_cmd":["uinput -T -m 500 0 550 30"],
+ "start_screenshot": ["aa start -a com.ohos.screenshot.ServiceExtAbility -b com.ohos.screenshot"],
+ "start_photos": ["aa start -a com.ohos.photos.MainAbility -b com.ohos.photos"],
+ "kill_photos": ["killall com.ohos.photos"],
+ "all_actions": [
+ [2, "pull_down_cmd"], [5, "screenshot-x-y"], [5, "start_photos"], [2, "last_photos-x-y"], [2, "shot_cmd"], [1, "cmp_cmd-level"],
+ [1, "get_file_from_dev", "/data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/rdb/media_library.db"],
+ [1, "get_file_from_dev", "/data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/rdb/media_library.db-wal"],
+ [2, "photo_check"], [1, "process_check", "com.ohos.medialibrary.medialibrarydata"], [2, "sandbox_path_check"], [1, "kill_photos"]
+ ]
+ },
+ {
+ "app_name": "settings",
+ "entry": "aa start -a com.ohos.settings.MainAbility -b com.ohos.settings",
+ "kill_settings": ["killall com.ohos.settings"],
+ "all_actions": [
+ [2, "shot_cmd", "settings"], [1, "cmp_cmd-level"], [1, "kill_settings"]
+ ]
+ },
+ {
+ "app_name": "note",
+ "entry": "aa start -a MainAbility -b com.ohos.note",
+ "kill_note": ["killall com.ohos.note"],
+ "all_actions": [
+ [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [5, "note_content-x-y"], [2, "note_content-x-y"], [2, "shot_cmd"], [1, "cmp_cmd-level"], [2, "recent-x-y"], [1, "recent_del-x-y"]
+ ]
+ },
+ {
+ "app_name": "contacts",
+ "entry": "aa start -a com.ohos.contacts.MainAbility -b com.ohos.contacts",
+ "kill_contacts": ["killall com.ohos.contacts"],
+ "all_actions": [
+ [2, "phone-x-y"], [2, "phone-x-y"], [2, "shot_cmd"], [1, "cmp_cmd-level"], [1, "kill_contacts"]
+
+ ]
+ },
+ {
+ "app_name": "mms",
+ "entry": "aa start -a com.ohos.mms.MainAbility -b com.ohos.mms",
+ "kill_mms": ["killall com.ohos.mms"],
+ "all_actions": [
+ [2, "shot_cmd"], [1, "cmp_cmd-level"], [1, "kill_mms"]
+ ]
+ },
+ {
+ "app_name": "distributedmusicplayer",
+ "entry": "aa start -a ohos.samples.distributedmusicplayer.MainAbility -b ohos.samples.distributedmusicplayer",
+ "kill_distributedmusicplayer": ["killall ohos.samples.distributedmusicplayer"],
+ "all_actions": [
+ [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "shot_cmd"], [1, "cmp_cmd-level", 960000], [1, "kill_distributedmusicplayer"]
+ ]
+ }
+]
diff --git a/cases/smoke/basic/screenshot32/resource/camera_to_photos.png b/cases/smoke/basic/screenshot32/resource/camera_to_photos.png
new file mode 100644
index 0000000000000000000000000000000000000000..1dc276ef3ca3805639028643dd582377b1a2d5eb
Binary files /dev/null and b/cases/smoke/basic/screenshot32/resource/camera_to_photos.png differ
diff --git a/cases/smoke/basic/screenshot32/resource/camera_to_photos.pngraw b/cases/smoke/basic/screenshot32/resource/camera_to_photos.pngraw
new file mode 100644
index 0000000000000000000000000000000000000000..28661e94340bb64b8a4218db4854f6fbbb0f525f
--- /dev/null
+++ b/cases/smoke/basic/screenshot32/resource/camera_to_photos.pngraw
@@ -0,0 +1,1808 @@
+>EN%/'/:[bi%/%/%/Z`g%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[bi[biekrG)1:@HPhnt%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/=EN%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/rw}%/%/%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