Skip to content

Commit

Permalink
Python modifcation for check for fabricSynchronization condition on A…
Browse files Browse the repository at this point in the history
…gregator device (#34626)

* Check for FabricSynchronization condition on Aggregator device

* Update after code review

* Restyled by prettier-yaml

* Remove yaml with test

---------

Co-authored-by: Arkadiusz Bokowy <a.bokowy@samsung.com>
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
3 people authored Jul 30, 2024
1 parent 7afdb97 commit e78498c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ def target_for_name(name: str):
return TestTarget.TV
if name.startswith("DL_") or name.startswith("Test_TC_DRLK_"):
return TestTarget.LOCK
if name.startswith("TestFabricSync"):
return TestTarget.FABRIC_SYNC
if name.startswith("OTA_"):
return TestTarget.OTA
if name.startswith("Test_TC_BRBINFO_") or name.startswith("Test_TC_ACT_"):
Expand Down
1 change: 1 addition & 0 deletions scripts/tests/chiptest/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def PathsWithNetworkNamespaces(paths: ApplicationPaths) -> ApplicationPaths:
chip_tool='ip netns exec tool'.split() + paths.chip_tool,
all_clusters_app='ip netns exec app'.split() + paths.all_clusters_app,
lock_app='ip netns exec app'.split() + paths.lock_app,
fabric_bridge_app='ip netns exec app'.split() + paths.fabric_bridge_app,
ota_provider_app='ip netns exec app'.split() + paths.ota_provider_app,
ota_requestor_app='ip netns exec app'.split() + paths.ota_requestor_app,
tv_app='ip netns exec app'.split() + paths.tv_app,
Expand Down
11 changes: 9 additions & 2 deletions scripts/tests/chiptest/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class TestTarget(Enum):
OTA = auto()
BRIDGE = auto()
LIT_ICD = auto()
FABRIC_SYNC = auto()
MWO = auto()
RVC = auto()
NETWORK_MANAGER = auto()
Expand All @@ -185,6 +186,7 @@ class ApplicationPaths:
chip_tool: typing.List[str]
all_clusters_app: typing.List[str]
lock_app: typing.List[str]
fabric_bridge_app: typing.List[str]
ota_provider_app: typing.List[str]
ota_requestor_app: typing.List[str]
tv_app: typing.List[str]
Expand All @@ -197,8 +199,11 @@ class ApplicationPaths:
network_manager_app: typing.List[str]

def items(self):
return [self.chip_tool, self.all_clusters_app, self.lock_app, self.ota_provider_app, self.ota_requestor_app,
self.tv_app, self.bridge_app, self.lit_icd_app, self.microwave_oven_app, self.chip_repl_yaml_tester_cmd, self.chip_tool_with_python_cmd, self.rvc_app, self.network_manager_app]
return [self.chip_tool, self.all_clusters_app, self.lock_app,
self.fabric_bridge_app, self.ota_provider_app, self.ota_requestor_app,
self.tv_app, self.bridge_app, self.lit_icd_app,
self.microwave_oven_app, self.chip_repl_yaml_tester_cmd,
self.chip_tool_with_python_cmd, self.rvc_app, self.network_manager_app]


@dataclass
Expand Down Expand Up @@ -301,6 +306,8 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str,
target_app = paths.tv_app
elif self.target == TestTarget.LOCK:
target_app = paths.lock_app
elif self.target == TestTarget.FABRIC_SYNC:
target_app = paths.fabric_bridge_app
elif self.target == TestTarget.OTA:
target_app = paths.ota_requestor_app
elif self.target == TestTarget.BRIDGE:
Expand Down
10 changes: 9 additions & 1 deletion scripts/tests/run_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ def cmd_list(context):
@click.option(
'--lock-app',
help='what lock app to use')
@click.option(
'--fabric-bridge-app',
help='what fabric bridge app to use')
@click.option(
'--ota-provider-app',
help='what ota provider app to use')
Expand Down Expand Up @@ -294,7 +297,8 @@ def cmd_list(context):
help='Number of tests that are expected to fail in each iteration. Overall test will pass if the number of failures matches this. Nonzero values require --keep-going')
@click.pass_context
def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, ota_requestor_app,
tv_app, bridge_app, lit_icd_app, microwave_oven_app, rvc_app, network_manager_app, chip_repl_yaml_tester, chip_tool_with_python, pics_file, keep_going, test_timeout_seconds, expected_failures):
fabric_bridge_app, tv_app, bridge_app, lit_icd_app, microwave_oven_app, rvc_app, network_manager_app, chip_repl_yaml_tester,
chip_tool_with_python, pics_file, keep_going, test_timeout_seconds, expected_failures):
if expected_failures != 0 and not keep_going:
logging.exception(f"'--expected-failures {expected_failures}' used without '--keep-going'")
sys.exit(2)
Expand All @@ -309,6 +313,9 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
if lock_app is None:
lock_app = paths_finder.get('chip-lock-app')

if fabric_bridge_app is None:
fabric_bridge_app = paths_finder.get('fabric-bridge-app')

if ota_provider_app is None:
ota_provider_app = paths_finder.get('chip-ota-provider-app')

Expand Down Expand Up @@ -347,6 +354,7 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
chip_tool=[context.obj.chip_tool],
all_clusters_app=[all_clusters_app],
lock_app=[lock_app],
fabric_bridge_app=[fabric_bridge_app],
ota_provider_app=[ota_provider_app],
ota_requestor_app=[ota_requestor_app],
tv_app=[tv_app],
Expand Down

0 comments on commit e78498c

Please sign in to comment.