openharmony_ci 80eb510571 !99 user mode adaptation and modify log
Merge pull request !99 from 韩雅茹/master
2022-09-22 09:01:30 +00:00
2022-09-17 11:40:33 +08:00
2022-08-17 15:49:51 +08:00
2022-08-18 18:58:17 +08:00
2022-09-13 21:35:54 +08:00
2022-09-13 21:35:54 +08:00
2022-03-17 11:29:03 +08:00
2022-03-17 11:37:51 +08:00
2022-08-26 03:40:38 +00:00
2022-08-26 03:54:50 +00:00

WuKong

Introduction

OpenHarmony stability testing automation tool simulates disorderly user behavior to stress test the stability of OpenHarmony systems and applications.

code directory

├── 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    
|   └── report                          # Monitor abnormal information, collect, collect statistics, and display it
|   └── shell_command                   # Used to create a command line map, parse the command line parameters, and execute the command line              
|   └── test_flow                                  
│       └── include                     # Defining Header files
│       └── src                     
│           ├── 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
│   ── README_zh.md                     # The readme file

constraints

  1. WuKong began presetting after system version 3.2
  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
    2.1. Build a way
    ./build.sh --product-name rk3568 --build-target wukong
    
    2.2. push
    hdc_std shell mount -o rw,remount /
    hdc_std file send wukong /
    hdc_std shell chmod a+x /wukong
    hdc_std shell mv /wukong /bin/
    

functional characteristics

Function Features and Command Description

Command Description Note
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 special wukong special test
wukong exec wukong randomly tests

wukong special description

Command Features Required Note
-h, --help Get help information for the current test. No Specialized test help information.
-k, --spec_insomnia Sleep wake-up special test. No -
-c, --count Set the Number of executions. No The default is 10 times.
-i, --interval Set the execution interval. No Unit ms, default 1500ms.
-S, --swap Sliding test. No -
-s, --start[x,y] Set the slide test start coordinates. No -
-e, --end[x,y] Set the slide test end coordinates. No -
-b, --bilateral Set the round-trip swipe. No By default, there is no round-trip swipe.
-t, --touch[x,y] Click test. No -
-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

> hdc_std shell
# wukong special -C [bundlename] -p

Specific test example parsing

Command Parameter Value Description
wukong special The main commands.
-C [bundlename] [bundlename] Control to sequentially traverse the test parameter Settings, bundlename is the name of the test application.
-p Represents a screenshot.

wukong random description

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.
-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).
-p,--prohibit[bundlename,......,bundlename] Set the list of prohibited apps for this test, which conflicts with -b. No By default, no applications are prohibited (application names are separated by commas).
-a,--appswitch Set the app random pull-up test scale. No The default 10%.
-t,--touch Set the screen random touch test ratio. No The default 10%.
-S,--swap Set the screen random swap test scale. No The default 3%.
-m,--mouse Set the screen randommou test ratio. No The default 1%.
-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.

Instructions: Configuring the same random seed results in the same sequence of random events

Example of Wukong Special random test

> hdc_std shell
# wukong exec -s 10 -i 1000 -a 0.28 -t 0.72 -c 100

Random test example parsing

Command Parameter Value Description
wukong exec The main command.
-s 10 Parameter set random seed, 10 is the seed value.
-i 1000 Parameter Settings apply pull up interval, 1000 unit ms.
-a 0.28 Parameter Settings Apply random pull up test ratio 28%.
-t 0.72 Parameter Settings Screen random touch test proportion is 72%.
-c 100 Parameter Setting The number of execution times is 100.

Release notes

3.2.0.0 Release content: Preset WUkong supports the following functions:

  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.
  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.
  3. Supports WUkong run log printing.
  4. White and blacklist applications are supported.
S
Description
OpenHarmony稳定性测试自动化工具,通过模拟无序的用户行为,对OpenHarmony系统及应用进行稳定性压力测试。
Readme 1,021 KiB
Languages
C++ 100%