mirror of
https://github.com/openharmony/ostest_wukong.git
synced 2026-07-01 06:41:49 -04:00
@@ -1,12 +1,23 @@
|
||||
# WuKong
|
||||
# wukong
|
||||
## Introduction
|
||||
|
||||
OpenHarmony stability testing automation tool simulates disorderly user behavior to stress test the stability of OpenHarmony systems and applications.
|
||||
OpenHarmony stability testing automation tool simulates disorderly user behavior to stress test the stability of OpenHarmony systems and applications.<br>
|
||||
|
||||
## code directory
|
||||
wukong component architecture diagram<br>
|
||||
<br>
|
||||
|
||||
Submodule responsibilities within the component:<br>
|
||||
1. Command line parsing: allows you to obtain and parse parameters on the command line.<br>
|
||||
2. Running environment management: Initialize the overall wukong running environment according to the command line.<br>
|
||||
3. System interface management: Check and get the specified mgr, register controller and dfx faultlog callback functions.<br>
|
||||
4. Random event generation: Generate a random sequence with a specified number of seeds through the random function to generate events.<br>
|
||||
5. Event injection: Inject events into the system based on supported event types, relying on subsystems such as Windows, multimode, and security.<br>
|
||||
6. Exception capture and processing/report generation: The DFX subsystem obtains anomaly information in operation and records logs to generate reports.<br>
|
||||
|
||||
## Directory
|
||||
|
||||
```
|
||||
├── wukong # Wukong main code file
|
||||
├── wukong # wukong main code file
|
||||
| └── common # Provides application control capabilities, random event injection capabilities, multi-mode event injection capabilities
|
||||
| └── component_event # Define the ability, page, Component tree to provide the ability to add nodes, traverse the tree, find child nodes by NodeId, etc
|
||||
| └── input_factory # Realize the screen click, slide, drag, keyboard and other events injection ability
|
||||
@@ -18,14 +29,14 @@ OpenHarmony stability testing automation tool simulates disorderly user behavior
|
||||
│ ├── random_test_flow.cpp # Inherited from TestFlow, is the execution flow of random tests
|
||||
│ ├── special_test_flow.cpp # Inherited from TestFlow, is the execution flow of sequential specific tests
|
||||
│ ├── test_flow.cpp # Check whether the command line parameters conform to specifications
|
||||
│ ── BUILD.gn # Store the configuration of WUkong construction, including construction object, method, dependency, hardware architecture, and file format
|
||||
│ ── BUILD.gn # Store the configuration of wukong construction, including construction object, method, dependency, hardware architecture, and file format
|
||||
│ ── README_zh.md # The readme file
|
||||
```
|
||||
|
||||
## constraints
|
||||
## Constraints
|
||||
|
||||
1. WuKong began presetting after system version 3.2<br>
|
||||
2. Versions of WuKong prior to version 3.2 do not compile with the version. When using WuKong, you need to compile and push it to the OpenHarmony device under test. The procedure is as follows:<br>
|
||||
1. wukong began presetting after system version 3.2<br>
|
||||
2. Versions of wukong prior to version 3.2 do not compile with the version. When using wukong, you need to compile and push it to the OpenHarmony device under test. The procedure is as follows:<br>
|
||||
2.1. Build a way
|
||||
```
|
||||
./build.sh --product-name rk3568 --build-target wukong
|
||||
@@ -38,7 +49,7 @@ OpenHarmony stability testing automation tool simulates disorderly user behavior
|
||||
hdc_std shell mv /wukong /bin/
|
||||
```
|
||||
|
||||
## functional characteristics
|
||||
## Directions for use
|
||||
|
||||
### Function Features and Command Description
|
||||
|
||||
@@ -47,7 +58,7 @@ OpenHarmony stability testing automation tool simulates disorderly user behavior
|
||||
| -------------- | ---------------------------------------------- | ------------- |
|
||||
| wukong version | Get wukong version information | -v, --version |
|
||||
| wukong help | Get wukong help information | |
|
||||
| wukong appinfo | Query support pulling up the application enterName and the corresponding mainAbility name | |
|
||||
| wukong appinfo | Query support pulling up the application bundleName and the corresponding mainAbility name | |
|
||||
| wukong special | wukong special test | |
|
||||
| wukong exec | wukong randomly tests | |
|
||||
|
||||
@@ -68,7 +79,7 @@ OpenHarmony stability testing automation tool simulates disorderly user behavior
|
||||
| -T, --time | Set the total test time. | No | Unit minutes, the default is 10 minutes. |
|
||||
| -C, --component | The control sequentially traverses the test. | No | You need to set the test app name. |
|
||||
|
||||
#### Example of Wukong Special test
|
||||
#### Example of wukong Special test
|
||||
```bash
|
||||
> hdc_std shell
|
||||
# wukong special -C [bundlename] -p
|
||||
@@ -85,7 +96,7 @@ Specific test example parsing:
|
||||
| Command | Features | Required | Note |
|
||||
| --------------- | ------------------------------------ | ---- | ---------------------------------------- |
|
||||
| -h,--help | Get help information for the current test. | No | Random test help information. |
|
||||
| -c,--count | Set the Number of executions. | No | The number of units, the default is 10 times. |
|
||||
| -c,--count | Set the Number of executions, conflicts with -T. | No | The number of units, the default is 10 times. |
|
||||
| -i,--interval | Set the execution interval. | No | Unit ms, default 1500ms. |
|
||||
| -s,--seed | Set the Random Seed. | No | Configuring the same random seed results in the same random event sequence. |
|
||||
| -b,--bundle[bundlename,......,bundlename] | Set the list of allowed applications for this test, and the -p conflict. | No | By default, test all apps for the current device (app names separated by commas). |
|
||||
@@ -97,11 +108,11 @@ Specific test example parsing:
|
||||
| -k,--keyboard | Set the screen random keyboard test ratio. | No | The default 2%. |
|
||||
| -H,--hardkey | Set the random hardkey test scale. | No | The default 4%. |
|
||||
| -C, --component | Set the Random Control Test Scale. | No | The default 70%. |
|
||||
| -T,--time | Set the total test time. | No | Unit minutes, the default is 10 minutes. |
|
||||
| -T,--time | Set the total test time, conflicts with -c. | No | Unit minutes, the default is 10 minutes. |
|
||||
|
||||
> Instructions: Configuring the same random seed results in the same sequence of random events
|
||||
|
||||
#### Example of Wukong Special random test
|
||||
#### Example of wukong exec random test
|
||||
```bash
|
||||
> hdc_std shell
|
||||
# wukong exec -s 10 -i 1000 -a 0.28 -t 0.72 -c 100
|
||||
@@ -118,8 +129,8 @@ Random test example parsing:
|
||||
|
||||
## Release notes
|
||||
|
||||
3.2.0.0 Release content: Preset WUkong supports the following functions:<br>
|
||||
3.2.0.0 Release content: Preset wukong supports the following functions:<br>
|
||||
1. Support the whole machine application pull up, set the random seed, set the application pull up interval, set the application pull up times, support the query application pull up bundle name and ability name.<br>
|
||||
2. Support random injection of events, support random injection of controls, support sleep and wake up special tests, support control sequence traversal screenshots special tests.<br>
|
||||
3. Supports WUkong run log printing.<br>
|
||||
3. Supports wukong run log printing.<br>
|
||||
4. White and blacklist applications are supported.
|
||||
+23
-12
@@ -1,9 +1,20 @@
|
||||
# WuKong部件
|
||||
# wukong部件
|
||||
## 简介
|
||||
|
||||
OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHarmony系统及应用进行稳定性压力测试。
|
||||
OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHarmony系统及应用进行稳定性压力测试。<br>
|
||||
|
||||
## 代码目录
|
||||
wukong部件架构图<br>
|
||||
<br>
|
||||
|
||||
部件内子模块职责:<br>
|
||||
1. 命令行解析:支持命令行获取参数并解析命令行参数。<br>
|
||||
2. 运行环境管理:根据命令行初始化wukong整体运行环境。<br>
|
||||
3. 系统接口管理:检查并获取指定的mgr,注册controller和dfx的faultlog的回调函数。<br>
|
||||
4. 随机事件生成:通过random函数生成指定种子数的随机序列,生成事件。<br>
|
||||
5. 事件注入:根据支持的事件类型向系统注入事件,依赖窗口、多模、安全等子系统。<br>
|
||||
6. 异常捕获处理/报告生成:通过DFX子系统获取运行中的异常信息并记录log,生成报告。<br>
|
||||
|
||||
## 目录
|
||||
|
||||
```
|
||||
├── wukong # wukong主要代码文件
|
||||
@@ -22,10 +33,10 @@ OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHa
|
||||
│ ── README_zh.md # readme文件
|
||||
```
|
||||
|
||||
## 约束条件
|
||||
## 约束
|
||||
|
||||
1. WuKong在3.2系统版本后开始预置使用。<br>
|
||||
2. WuKong在3.2系统版本之前的版本不随版本编译,使用时需自行编译后推送至被测OpenHarmony设备,步骤如下:
|
||||
1. wukong在3.2系统版本后开始预置使用。<br>
|
||||
2. wukong在3.2系统版本之前的版本不随版本编译,使用时需自行编译后推送至被测OpenHarmony设备,步骤如下:
|
||||
2.1. 构建方式
|
||||
```
|
||||
./build.sh --product-name rk3568 --build-target wukong
|
||||
@@ -38,7 +49,7 @@ OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHa
|
||||
hdc_std shell mv /wukong /bin/
|
||||
```
|
||||
|
||||
## 功能特性
|
||||
## 使用说明
|
||||
|
||||
### 功能特性及命令说明
|
||||
|
||||
@@ -47,7 +58,7 @@ OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHa
|
||||
| -------------- | ---------------------------------------------- | ------------- |
|
||||
| version | 获取wukong版本信息。 | -v, --version。 |
|
||||
| help | 获取wukong帮助信息。 | |
|
||||
| appinfo | 查询支持拉起应用entryName和对应的mainAbility名。 | |
|
||||
| appinfo | 查询支持拉起应用bundleName和对应的mainAbility名。 | |
|
||||
| special | wukong专项测试。 | |
|
||||
| exec | wukong随机测试。 | |
|
||||
|
||||
@@ -71,7 +82,7 @@ OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHa
|
||||
| -R, --replay | 回放。 | 否 | 需要指定回放文件。 |
|
||||
| -p, --screenshot | 控件测试截图。 | 否 | - |
|
||||
|
||||
#### wukong special专项测试使用示例
|
||||
#### wukong special 专项测试使用示例
|
||||
```bash
|
||||
> hdc_std shell
|
||||
# wukong special -C [bundlename] -p
|
||||
@@ -88,7 +99,7 @@ OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHa
|
||||
| 命令 | 功能 | 必选 | 备注 |
|
||||
| --------------- | ------------------------------------ | ---- | ---------------------------------------- |
|
||||
| -h,--help | 获取当前测试的帮助信息。 | 否 | 随机测试帮助信息。 |
|
||||
| -c,--count | 设置执行次数。 | 否 | 单位次数,默认10次。 |
|
||||
| -c,--count | 设置执行次数,与-T冲突。 | 否 | 单位次数,默认10次。 |
|
||||
| -i,--interval | 设置执行间隔。 | 否 | 单位ms,默认1500ms。 |
|
||||
| -s,--seed | 设置随机种子。 | 否 | 配置相同随机种子,会生成相同随机事件序列。 |
|
||||
| -b,--bundle[bundlename,……,bundlename] | 设置本次测试的允许应用名单,与-p冲突。 | 否 | 默认测试当前设备所有应用(应用名称用逗号隔开)。 |
|
||||
@@ -100,11 +111,11 @@ OpenHarmony稳定性测试自动化工具,通过模拟用户行为,对OpenHa
|
||||
| -k,--keyboard | 设置屏幕随机keyboard测试比例。 | 否 | 默认2%。 |
|
||||
| -H,--hardkey | 设置随机hardkey测试比例。 | 否 | 默认4%。 |
|
||||
| -C, --component | 设置随机控件测试比例。 | 否 | 默认70%。 |
|
||||
| -T,--time | 设置测试总时间。 | 否 | 单位分钟,默认10分钟。 |
|
||||
| -T,--time | 设置测试总时间,与-c冲突。 | 否 | 单位分钟,默认10分钟。 |
|
||||
|
||||
> 说明:配置相同随机种子,会生成相同随机事件序列
|
||||
|
||||
#### wukong special随机测试使用示例
|
||||
#### wukong exec 随机测试使用示例
|
||||
```bash
|
||||
> hdc_std shell
|
||||
# wukong exec -s 10 -i 1000 -a 0.28 -t 0.72 -c 100
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 147 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 128 KiB |
Reference in New Issue
Block a user