-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'zigbee/Add_pytest_in_CI' into 'master'
ci(zigbee): Add pytest for esp32h2 in CI See merge request espressif/esp-idf!23779
- Loading branch information
Showing
11 changed files
with
112 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps | ||
|
||
.zigbee_dependencies: &zigbee_dependencies | ||
depends_filepatterns: | ||
- components/ieee802154/**/* | ||
- examples/zigbee/light_sample/**/* | ||
|
||
examples/zigbee/esp_zigbee_gateway: | ||
disable: | ||
- if: IDF_TARGET in ["esp32c2", "esp32h2"] | ||
temporary: true | ||
reason: target(s) not supported yet | ||
<<: *zigbee_dependencies | ||
|
||
examples/zigbee/esp_zigbee_rcp: | ||
enable: | ||
- if: IDF_TARGET in ["esp32c6", "esp32h2"] | ||
reason: should able to run on esp32h2 and esp32c6 | ||
<<: *zigbee_dependencies | ||
|
||
examples/zigbee/light_sample: | ||
enable: | ||
- if: IDF_TARGET in ["esp32c6", "esp32h2"] | ||
reason: should able to run on esp32h2 and esp32c6 | ||
disable_test: | ||
- if: IDF_TARGET == "esp32c6" | ||
temporary: true | ||
reason: only test on esp32h2 | ||
<<: *zigbee_dependencies |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## IDF Component Manager Manifest File | ||
dependencies: | ||
espressif/esp-zboss-lib: "~0.4.0" | ||
espressif/esp-zigbee-lib: "~0.5.0" | ||
espressif/esp-zboss-lib: "~0.5.0" | ||
espressif/esp-zigbee-lib: "~0.7.0" | ||
## Required IDF version | ||
idf: | ||
version: ">=5.0.0" |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## IDF Component Manager Manifest File | ||
dependencies: | ||
espressif/esp-zboss-lib: "~0.4.0" | ||
espressif/esp-zigbee-lib: "~0.5.0" | ||
espressif/esp-zboss-lib: "~0.5.0" | ||
espressif/esp-zigbee-lib: "~0.7.0" | ||
## Required IDF version | ||
idf: | ||
version: ">=5.0.0" |
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
4 changes: 2 additions & 2 deletions
4
examples/zigbee/light_sample/HA_on_off_light/main/idf_component.yml
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
4 changes: 2 additions & 2 deletions
4
examples/zigbee/light_sample/HA_on_off_switch/main/idf_component.yml
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## IDF Component Manager Manifest File | ||
dependencies: | ||
espressif/esp-zigbee-lib: "~0.5.0" | ||
espressif/esp-zboss-lib: "~0.4.0" | ||
espressif/esp-zigbee-lib: "~0.7.0" | ||
espressif/esp-zboss-lib: "~0.5.0" | ||
## Required IDF version | ||
idf: | ||
version: ">=5.0.0" |
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 @@ | ||
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# !/usr/bin/env python3 | ||
|
||
import pathlib | ||
import time | ||
from typing import Tuple | ||
|
||
import pytest | ||
from pytest_embedded import Dut | ||
|
||
CURRENT_DIR_LIGHT = str(pathlib.Path(__file__).parent / 'HA_on_off_light') | ||
CURRENT_DIR_SWITCH = str(pathlib.Path(__file__).parent / 'HA_on_off_switch') | ||
pytest_build_dir = CURRENT_DIR_LIGHT + '|' + CURRENT_DIR_SWITCH | ||
|
||
|
||
@pytest.mark.esp32h2 | ||
@pytest.mark.zigbee_multi_dut | ||
@pytest.mark.parametrize( | ||
' count, app_path, erase_all', [ | ||
(2, pytest_build_dir, 'y'), | ||
], | ||
indirect=True, | ||
) | ||
# config Zigbee network | ||
def test_config_zigbee_network(dut:Tuple[Dut, Dut]) -> None: | ||
light = dut[0] | ||
switch = dut[1] | ||
time.sleep(3) | ||
switch.expect('ESP_ZB_ON_OFF_SWITCH: Formed network successfully',timeout=30) | ||
# get the switch extpanid | ||
switch_node_expanid = switch.expect(r'Extended PAN ID: (([a-z0-9]{2}:?){8})',timeout=3)[1].decode() | ||
switch_node_expanid = switch_node_expanid.replace(':','') | ||
# get the switch panid | ||
switch_node_panid = switch.expect(r'PAN ID: 0x([a-z0-9]+:?)',timeout=2)[1].decode() | ||
# new device commissioned successfully | ||
switch.expect(r'New device commissioned or rejoined \(short: 0x([a-z0-9]+)[^a-z0-9]',timeout=30)[1].decode() | ||
# get the light node extpanid | ||
light.expect('ESP_ZB_ON_OFF_LIGHT: Joined network successfully',timeout=20) | ||
light_node_expanid = light.expect(r'Extended PAN ID: (([a-z0-9]{2}:?){8})',timeout=3)[1].decode() | ||
light_node_expanid = light_node_expanid.replace(':','') | ||
# get the light panid | ||
light_node_panid = light.expect(r'PAN ID: 0x([a-z0-9]+:?)',timeout=2)[1].decode() | ||
# make sure the light node join the network that switch node formed (same expanid) | ||
if ((light_node_expanid != switch_node_expanid) or (light_node_panid != switch_node_panid)): | ||
assert False |