|
|
|
# Notes about OpenHarmony and meta-openharmony
|
|
|
|
|
|
|
|
## General
|
|
|
|
|
|
|
|
|
|
|
|
## ACTS
|
|
|
|
|
|
|
|
### Building ACTS
|
|
|
|
|
|
|
|
To build ACTS test suites add following to the `local.conf`:
|
|
|
|
|
|
|
|
```
|
|
|
|
DISTRO_FEATURES += "acts"
|
|
|
|
```
|
|
|
|
|
|
|
|
ACTS test suites can be found in output directory, eg.
|
|
|
|
|
|
|
|
```
|
|
|
|
build-openharmony-components-qemuarma7/tmp-musl/work/cortexa7-neon-vfpv4-oe-linux-musleabi/openharmony-standard/3.0-r0/src/out/ohos-arm-release/suites/acts/testcases
|
|
|
|
```
|
|
|
|
|
|
|
|
### Running ACTS
|
|
|
|
|
|
|
|
To be able to run ACTS against on the target you need to start the target:
|
|
|
|
```
|
|
|
|
$ runqemu publicvnc serialstdio
|
|
|
|
```
|
|
|
|
|
|
|
|
and connect to it using `hdc` tool:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ hdc tconn 192.168.7.2:35000
|
|
|
|
Connect OK
|
|
|
|
```
|
|
|
|
|
|
|
|
From this point on you can use `hdc` tool to execute commands on the target, install hap packages, transfer files, etc.
|
|
|
|
|
|
|
|
Up to now `xdevice`, tool that is provided as part of ACTS suite, used on Linux was unable to connect to the target device and therefore any testing with it was impossible. To workaround that problem set of simple [ACTS scripts](https://gitlab.eclipse.org/robertd/acts-runner) can be used in a following manner:
|
|
|
|
|
|
|
|
- clone `acts-runner` repository
|
|
|
|
- navigate to ACTS test suite `suites/acts/testcases` directory
|
|
|
|
- optionally you can make ACTS scripts available by adding it's location to PATH environment variable
|
|
|
|
- make sure hdc is connected to the target
|
|
|
|
- execute test:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ run-acts-test.sh ActsOsAccountJSApiTest.json
|
|
|
|
[Info]App install path:/home/robert/prj/gitee_3.0.1/code-v3.0.1-LTS/OpenHarmony/out/ohos-arm-release/suites/acts/testcases/./ActsOsAccountJSApiTest.hap, queuesize:0, msg:install bundle successfully.
|
|
|
|
AppMod finish
|
|
|
|
init log clear success
|
|
|
|
app log clear success
|
|
|
|
|
|
|
|
Starting ability: "ohos.acts.account.osaccount.MainAbility" from bundle: "ohos.acts.account.osaccount"
|
|
|
|
[end] run suites end
|
|
|
|
[Info]App uninstall path:, queuesize:0, msg:uninstall bundle successfully.
|
|
|
|
AppMod finish
|
|
|
|
Testcase ActsOsAccountJSApiTest.json: PASS
|
|
|
|
total cases:7;failure 0,error 0,pass 7; consuming 4.27S
|
|
|
|
================
|
|
|
|
```
|
|
|
|
|
|
|
|
## TODOs
|
|
|
|
|
|
|
|
### Handling of users and directories permissions/ownership
|
|
|
|
|
|
|
|
Note: In meta-openharmony we don't use OpenHarmony init system. It is responsible for creation of some directories, handling permissions and running services with appropriate UIDs/GIDs. Currently in meta-openharmony we run everything as root. OpenHarmony init system uses `*.cfg` files that can be used as a reference.
|
|
|
|
|
|
|
|
- OpenHarmony uses couple of UIDs/GIDs for running it's services
|
|
|
|
- currently in meta-openharmony we have everything run as root, which causes some issues
|
|
|
|
- currently `/data` directory has to be `chmod -R 777 /data` in order for services to work
|
|
|
|
- one of possible manifestation of this not being done is `create display failed!` error in the logs
|
|
|
|
|
|
|
|
### Handling services startup
|
|
|
|
|
|
|
|
Note: In meta-openharmony we settled for systemd units for managing the services. As it turned out the ordering of the services and even time between subsequent services is important. Currently we have a workaround for that which is services are started from a single script checking if the corresponding service systemd dummy unit is enabled.
|
|
|
|
|
|
|
|
- Fix services startup
|
|
|
|
|
|
|
|
### Installation of the Launcher and SystemUI haps
|
|
|
|
|
|
|
|
Note: As a rule, in meta-openharmony we didn't want to include any pre-built stuff. That had to be compromised on couple of occasions. For the ACTS tests to work repeatedly Launcher haps and SystemUI haps, which are not included in the openharmony-standard recipe. Those can be found either in the OpenHarmony code-v3.0.1-LTS release package or on [gitee](https://gitee.com/openharmony/applications_hap).
|
|
|
|
|
|
|
|
- Make the Launcher and SystemUI hap packages built in openharmony-standard from sources and included in the image
|
|
|
|
|