Skip to content

Commit

Permalink
Add support for running YAML tests against bridge-app. (#23198)
Browse files Browse the repository at this point in the history
And run Test_TC_BRBINFO_* against it.

Fixes #23147
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jun 24, 2023
1 parent cd588c9 commit 2346352
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
--target darwin-x64-ota-provider-${BUILD_VARIANT} \
--target darwin-x64-ota-requestor-${BUILD_VARIANT} \
--target darwin-x64-tv-app-${BUILD_VARIANT} \
--target darwin-x64-bridge-app-${BUILD_VARIANT} \
build \
--copy-artifacts-to objdir-clone \
"
Expand All @@ -112,6 +113,7 @@ jobs:
--ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \
--ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \
--tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
--bridge-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-bridge-app \
"
- name: Uploading core files
uses: actions/upload-artifact@v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ jobs:
--target linux-x64-ota-provider-${BUILD_VARIANT} \
--target linux-x64-ota-requestor-${BUILD_VARIANT} \
--target linux-x64-tv-app-${BUILD_VARIANT} \
--target linux-x64-bridge-app-${BUILD_VARIANT} \
build \
--copy-artifacts-to objdir-clone \
"
Expand All @@ -206,6 +207,7 @@ jobs:
--ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \
--ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \
--tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
--bridge-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-bridge-app \
"
- name: Uploading core files
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -291,6 +293,7 @@ jobs:
--target darwin-x64-ota-provider-${BUILD_VARIANT} \
--target darwin-x64-ota-requestor-${BUILD_VARIANT} \
--target darwin-x64-tv-app-${BUILD_VARIANT} \
--target darwin-x64-bridge-app-${BUILD_VARIANT} \
build \
--copy-artifacts-to objdir-clone \
"
Expand All @@ -309,6 +312,7 @@ jobs:
--ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \
--ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \
--tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
--bridge-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-bridge-app \
"
- name: Uploading core files
uses: actions/upload-artifact@v2
Expand Down
2 changes: 2 additions & 0 deletions scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def target_for_name(name: str):
return TestTarget.LOCK
if name.startswith("OTA_"):
return TestTarget.OTA
if name.startswith("Test_TC_BRBINFO_"):
return TestTarget.BRIDGE
return TestTarget.ALL_CLUSTERS


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 @@ -148,4 +148,5 @@ def PathsWithNetworkNamespaces(paths: ApplicationPaths) -> ApplicationPaths:
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,
bridge_app='ip netns exec app'.split() + paths.bridge_app,
)
6 changes: 5 additions & 1 deletion scripts/tests/chiptest/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class TestTarget(Enum):
TV = auto()
LOCK = auto()
OTA = auto()
BRIDGE = auto()


@dataclass
Expand All @@ -163,9 +164,10 @@ class ApplicationPaths:
ota_provider_app: typing.List[str]
ota_requestor_app: typing.List[str]
tv_app: typing.List[str]
bridge_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]
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]


@dataclass
Expand Down Expand Up @@ -229,6 +231,8 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str, ti
target_app = paths.lock_app
elif self.target == TestTarget.OTA:
target_app = paths.ota_requestor_app
elif self.target == TestTarget.BRIDGE:
target_app = paths.bridge_app
else:
raise Exception("Unknown test target - "
"don't know which application to run")
Expand Down
11 changes: 9 additions & 2 deletions scripts/tests/run_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ def cmd_list(context):
@click.option(
'--tv-app',
help='what tv app to use')
@click.option(
'--bridge-app',
help='what bridge app to use')
@click.option(
'--pics-file',
type=click.Path(exists=True),
Expand All @@ -200,7 +203,7 @@ def cmd_list(context):
type=int,
help='If provided, fail if a test runs for longer than this time')
@click.pass_context
def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, ota_requestor_app, tv_app, pics_file, test_timeout_seconds):
def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, ota_requestor_app, tv_app, bridge_app, pics_file, test_timeout_seconds):
runner = chiptest.runner.Runner()

if all_clusters_app is None:
Expand All @@ -218,14 +221,18 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
if tv_app is None:
tv_app = FindBinaryPath('chip-tv-app')

if bridge_app is None:
bridge_app = FindBinaryPath('chip-bridge-app')

# Command execution requires an array
paths = chiptest.ApplicationPaths(
chip_tool=[context.obj.chip_tool],
all_clusters_app=[all_clusters_app],
lock_app=[lock_app],
ota_provider_app=[ota_provider_app],
ota_requestor_app=[ota_requestor_app],
tv_app=[tv_app]
tv_app=[tv_app],
bridge_app=[bridge_app]
)

if sys.platform == 'linux':
Expand Down

0 comments on commit 2346352

Please sign in to comment.