-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tizen] CI workflow for running QEMU-based tests (#24871)
* Uniform way for testing targets * Add README * [Tizen] Add QEMU runner with lighting app tests * Get default Tizen SDK location from env vars * Revert "Uniform way for testing targets" This reverts commit a04dabd. * Add Tizen test driver app to the build_examples.py * Tizen QEMU tests workflow * Update Tizen QEMU-based tests documentation * Enable external network support in QEMU * Update testdata for build example targets * Generate Tizen QEMU-base test target in a single step * Restyled by prettier-markdown * Fix flashbundle copy after changing tpk output dir * Use chip-build-tizen-qemu:0.6.39 as 0.6.40 is not on dockerhub yet * Drop concept of QEMU as a Tizen board and simply use ARM as a generic name for all ARM-based boards. --------- Co-authored-by: Damian Michalak-Szmaciński <d.michalak@samsung.com> Co-authored-by: Restyled.io <commits@restyled.io>
- Loading branch information
Showing
14 changed files
with
271 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# 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. | ||
|
||
import("//build_overrides/build.gni") | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "${build_root}/config/BUILDCONFIG.gn" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
default_args = { | ||
target_os = "tizen" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# 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. | ||
|
||
group("check") { | ||
testonly = true | ||
deps = [ "integration_tests/lighting-app:check" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# CHIP Tests on QEMU | ||
|
||
Tizen runs mostly on ARM architecture. In order to run tests on Tizen, we need | ||
to use QEMU. This document describes how to build and run CHIP tests on QEMU. | ||
|
||
## Obtaining Tizen QEMU Docker Image | ||
|
||
All tools and dependencies required to build and run tests on Tizen on QEMU are | ||
included in the `chip-build-tizen-qemu` docker image. One can pull the docker | ||
image from hub.docker.com or build it locally using the provided Dockerfile in | ||
`integrations/docker/images/chip-build-tizen-qemu` directory. | ||
|
||
```sh | ||
# Pull the image from hub.docker.com | ||
docker pull connectedhomeip/chip-build-tizen-qemu:latest | ||
``` | ||
|
||
## Building and Running Tests on QEMU | ||
|
||
All steps described below should be done inside the docker container. | ||
|
||
```sh | ||
docker run -it --rm --name chip-tizen-qemu \ | ||
connectedhomeip/chip-build-tizen-qemu:latest /bin/bash | ||
``` | ||
|
||
### Clone the connectedhomeip repository | ||
|
||
```sh | ||
git clone https://github.com/project-chip/connectedhomeip.git | ||
``` | ||
|
||
### Activate the environment | ||
|
||
```sh | ||
cd connectedhomeip | ||
source scripts/activate.sh | ||
``` | ||
|
||
### Generate and run test target | ||
|
||
As for now, Tizen QEMU-based test driver does not support BLE. In order to | ||
disable BLE, one needs to pass `chip_config_network_layer_ble=false` to the args | ||
argument of the `gn gen` command. | ||
|
||
```sh | ||
# Generate test target | ||
gn gen --check --fail-on-unused-args \ | ||
--root="$PWD/src/test_driver/tizen" \ | ||
--args="target_os=\"tizen\" target_cpu=\"arm\" chip_config_network_layer_ble=false" \ | ||
out/tizen-check | ||
# Run Tizen QEMU-based tests | ||
ninja -C out/tizen-check check | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../examples/build_overrides |
46 changes: 46 additions & 0 deletions
46
src/test_driver/tizen/integration_tests/lighting-app/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# 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. | ||
|
||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/tizen.gni") | ||
|
||
import("${tizen_sdk_build_root}/tizen_sdk.gni") | ||
|
||
tizen_qemu_mkisofs("test-runner") { | ||
runner = "runner.sh" | ||
|
||
# Build applications used in the test. | ||
deps = [ | ||
"${chip_root}/examples/chip-tool:chip-tool", | ||
"${chip_root}/examples/lighting-app/tizen:chip-lighting-app:tpk", | ||
] | ||
|
||
# Use artifacts created by the dependencies. | ||
assets = [ | ||
rebase_path("${root_build_dir}/chip-tool"), | ||
rebase_path( | ||
"${root_build_dir}/org.tizen.matter.example.lighting/out/org.tizen.matter.example.lighting-1.0.0.tpk"), | ||
] | ||
} | ||
|
||
tizen_qemu_run("check") { | ||
# Enable network support, so Tizen can obtain current date/time from the | ||
# network. Correct date/time is required for the commissioning process - | ||
# attestation will fail otherwise. | ||
virtio_net = true | ||
|
||
deps = [ ":test-runner" ] | ||
mkisofs_outputs = get_target_outputs(":test-runner") | ||
iso_image = rebase_path(mkisofs_outputs[0]) | ||
} |
34 changes: 34 additions & 0 deletions
34
src/test_driver/tizen/integration_tests/lighting-app/runner.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# 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. | ||
# | ||
|
||
set -e | ||
|
||
# Print CHIP logs on stdout | ||
dlogutil CHIP & | ||
|
||
# Install lighting Matter app | ||
pkgcmd -i -t tpk -p /mnt/chip/org.tizen.matter.* | ||
# Launch lighting Matter app | ||
app_launcher -s org.tizen.matter.example.lighting | ||
|
||
# TEST: pair app using network commissioning | ||
/mnt/chip/chip-tool pairing onnetwork 1 20202021 | ||
# TEST: turn on light | ||
/mnt/chip/chip-tool onoff on 1 1 | ||
# TEST: turn off light | ||
/mnt/chip/chip-tool onoff off 1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../.. |
Oops, something went wrong.