Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/constants/shared_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ class DutPairingModeEnum(str, Enum):
BLE_THREAD = "ble-thread"
WIFIPAF_WIFI = "wifipaf-wifi"
NFC_THREAD = "nfc-thread"
THREAD = "thread"
THREAD_MESHCOP = "thread-meshcop"
4 changes: 2 additions & 2 deletions test_collections/matter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class MatterSettings(BaseSettings):

# SDK Docker Image
SDK_DOCKER_IMAGE: str = "connectedhomeip/chip-cert-bins"
SDK_DOCKER_TAG: str = "d3ec6d14cdc637280466b5e1c7b56b8534245c48"
SDK_DOCKER_TAG: str = "ead81748828787a656ae05c7d980f908f09ea751-patch"
# SDK SHA: used to fetch tests (YAML and Python) from SDK.
SDK_SHA: str = "d3ec6d14cdc637280466b5e1c7b56b8534245c48"
SDK_SHA: str = "ead81748828787a656ae05c7d980f908f09ea751"

class Config:
case_sensitive = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def setup(self) -> None:
if self.matter_config.dut_config.pairing_mode in (
DutPairingModeEnum.NFC_THREAD,
DutPairingModeEnum.NFC_WIFI,
DutPairingModeEnum.THREAD,
DutPairingModeEnum.THREAD_MESHCOP,
):
# When PCSC reader is used in a Docker container, pollkit should
# be disabled
Expand All @@ -134,13 +134,13 @@ class CommissioningPythonTestSuite(PythonTestSuite, UserPromptSupport):
async def setup(self) -> None:
await super().setup()

# If in BLE-Thread, NFC-Thread, or THREAD mode and a Thread Auto-Config was
# provided by the user, start a new OTBR container app with the according Thread
# topology for all tests in the Python Tests Suite.
# If in BLE-Thread, NFC-Thread, or THREAD_MESHCOP mode and a Thread Auto-Config
# was provided by the user, start a new OTBR container app with the according
# Thread topology for all tests in the Python Tests Suite.
if self.matter_config.dut_config.pairing_mode in (
DutPairingModeEnum.BLE_THREAD,
DutPairingModeEnum.NFC_THREAD,
DutPairingModeEnum.THREAD,
DutPairingModeEnum.THREAD_MESHCOP,
) and isinstance(self.matter_config.network.thread, ThreadAutoConfig):
await self.border_router.start_device(self.matter_config.network.thread)
await self.border_router.form_thread_topology()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ async def generate_command_arguments(
dut_config = config.dut_config
test_parameters = config.test_parameters

# Map TH pairing modes to SDK commissioning method names
pairing_mode = (
"on-network"
if dut_config.pairing_mode == DutPairingModeEnum.ON_NETWORK
Expand Down Expand Up @@ -91,13 +92,13 @@ async def generate_command_arguments(
elif pairing_mode in (
DutPairingModeEnum.BLE_THREAD,
DutPairingModeEnum.NFC_THREAD,
DutPairingModeEnum.THREAD,
DutPairingModeEnum.THREAD_MESHCOP,
):
dataset_hex = await __thread_dataset_hex(config.network.thread)
arguments.append(f"--thread-dataset-hex {dataset_hex}")

# Add Border Agent parameters for THREAD
if pairing_mode == DutPairingModeEnum.THREAD:
# Add Border Agent parameters for THREAD_MESHCOP
if pairing_mode == DutPairingModeEnum.THREAD_MESHCOP:
thread_config = config.network.thread
if thread_config.ba_host:
arguments.append(f"--thread-ba-host {thread_config.ba_host}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_create_config_matter_with_thread_valid_succeeds() -> None:
config_matter = TestEnvironmentConfigMatter(**default_config_thread_valid)

assert config_matter is not None
assert config_matter.dut_config.pairing_mode == "thread"
assert config_matter.dut_config.pairing_mode == "thread-meshcop"
assert config_matter.network.thread.ba_host == "127.0.0.1"
assert config_matter.network.thread.ba_port == 5684

Expand All @@ -108,7 +108,7 @@ def test_create_config_matter_with_thread_no_ba_port_fails() -> None:


def test_create_config_matter_with_thread_no_ba_params_fails() -> None:
"""Test that THREAD mode fails when both ba_host and ba_port are missing."""
"""Test that THREAD_MESHCOP mode fails when both ba_host and ba_port are missing."""
config = {
"network": {
"fabric_id": "0",
Expand All @@ -121,7 +121,7 @@ def test_create_config_matter_with_thread_no_ba_params_fails() -> None:
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand All @@ -140,14 +140,14 @@ def test_create_config_matter_with_thread_no_ba_params_fails() -> None:


def test_create_config_matter_with_thread_no_thread_config_fails() -> None:
"""Test that THREAD mode fails when thread config is missing entirely."""
"""Test that THREAD_MESHCOP mode fails when thread config is missing entirely."""
config = {
"network": {
"fabric_id": "0",
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand All @@ -167,7 +167,7 @@
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand All @@ -189,7 +189,7 @@
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ async def test_pair_with_dut_thread_with_external_config_success() -> None:
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand Down Expand Up @@ -250,7 +250,7 @@ async def test_pair_with_dut_thread_with_auto_config_success() -> None:
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand Down Expand Up @@ -318,7 +318,7 @@ async def test_pair_with_dut_thread_missing_thread_config_fails() -> None:
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand Down Expand Up @@ -358,7 +358,7 @@ async def test_pair_with_dut_thread_invalid_thread_config_type_fails() -> None:
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand Down Expand Up @@ -398,7 +398,7 @@ async def test_pair_with_dut_thread_pairing_fails() -> None:
"wifi": {"ssid": "testharness", "password": "wifi-password"},
},
"dut_config": {
"pairing_mode": "thread",
"pairing_mode": "thread-meshcop",
"setup_code": "20202021",
"discriminator": "3840",
"chip_use_paa_certs": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ async def __pair_with_dut(self) -> None:
is DutPairingModeEnum.WIFIPAF_WIFI
):
pair_result = await self.__pair_wifi_dut_wifi_modes("wifipaf")
elif self.config_matter.dut_config.pairing_mode is DutPairingModeEnum.THREAD:
elif (
self.config_matter.dut_config.pairing_mode
is DutPairingModeEnum.THREAD_MESHCOP
):
pair_result = await self.__pair_with_dut_thread()
else:
raise DUTCommissioningError("Unsupported DUT pairing mode")
Expand Down
9 changes: 5 additions & 4 deletions test_collections/matter/test_environment_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ def validate_model(self, dict_model: dict) -> None:
f"The field {field} is required for dut_config configuration"
)

# Validate THREAD mode requires ba_host and ba_port
# Validate THREAD_MESHCOP mode requires ba_host and ba_port
pairing_mode = dut_config.get("pairing_mode")
if pairing_mode == DutPairingModeEnum.THREAD:
if pairing_mode == DutPairingModeEnum.THREAD_MESHCOP:
thread_config = network.get("thread") if network else None
if not thread_config:
raise TestEnvironmentConfigMatterError(
"Thread configuration is required for THREAD pairing mode"
"Thread configuration is required for THREAD_MESHCOP pairing"
" mode"
)

# Check if thread config is a dict or object
Expand All @@ -129,5 +130,5 @@ def validate_model(self, dict_model: dict) -> None:
if not ba_host or not ba_port:
raise TestEnvironmentConfigMatterError(
"ba_host and ba_port are mandatories in thread configuration "
"when pairing_mode is THREAD"
"when pairing_mode is THREAD_MESHCOP"
)
Loading