Skip to content

Commit

Permalink
[chiptest] Add support for door lock app tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq authored and woody-apple committed Mar 2, 2022
1 parent b834c0d commit 84f5dab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
"./scripts/build/build_examples.py \
--target linux-x64-chip-tool-${BUILD_VARIANT}${CHIP_TOOL_VARIANT} \
--target linux-x64-all-clusters-${BUILD_VARIANT}-test-group \
--target linux-x64-door-lock-${BUILD_VARIANT} \
--target linux-x64-tv-app-${BUILD_VARIANT} \
build \
--copy-artifacts-to objdir-clone \
Expand All @@ -93,6 +94,7 @@ jobs:
run \
--iterations 1 \
--all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}-test-group/chip-all-clusters-app \
--door-lock-app ./out/linux-x64-door-lock-${BUILD_VARIANT}/chip-door-lock-app \
--tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
"
- name: Uploading core files
Expand Down Expand Up @@ -180,7 +182,7 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
--chip-tool ./out/darwin-x64-chip-tool-${BUILD_VARIANT}${CHIP_TOOL_VARIANT}/chip-tool \
--target-skip-glob '{TestGroupMessaging,TV_*}' \
--target-skip-glob '{TestGroupMessaging,DL_*,TV_*}' \
run \
--iterations 1 \
--all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \
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 @@ -144,5 +144,6 @@ def PathsWithNetworkNamespaces(paths: ApplicationPaths) -> ApplicationPaths:
return ApplicationPaths(
chip_tool='ip netns exec tool'.split() + paths.chip_tool,
all_clusters_app='ip netns exec app'.split() + paths.all_clusters_app,
door_lock_app='ip netns exec app'.split() + paths.door_lock_app,
tv_app='ip netns exec app'.split() + paths.tv_app,
)
6 changes: 2 additions & 4 deletions scripts/tests/chiptest/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class TestTarget(Enum):
class ApplicationPaths:
chip_tool: typing.List[str]
all_clusters_app: typing.List[str]
door_lock_app: typing.List[str]
tv_app: typing.List[str]


Expand Down Expand Up @@ -206,10 +207,7 @@ def Run(self, runner, apps_register, paths: ApplicationPaths):
elif self.target == TestTarget.TV:
app_cmd = paths.tv_app
elif self.target == TestTarget.DOOR_LOCK:
logging.info(
"Ignore test - test is made for door lock which"
" is not supported yet")
return
app_cmd = paths.door_lock_app
else:
raise Exception("Unknown test target - "
"don't know which application to run")
Expand Down
7 changes: 6 additions & 1 deletion scripts/tests/run_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,23 @@ def cmd_list(context):
'--all-clusters-app',
default=FindBinaryPath('chip-all-clusters-app'),
help='what all clusters app to use')
@click.option(
'--door-lock-app',
default=FindBinaryPath('chip-door-lock-app'),
help='what door lock app to use')
@click.option(
'--tv-app',
default=FindBinaryPath('chip-tv-app'),
help='what tv app to use')
@click.pass_context
def cmd_run(context, iterations, all_clusters_app, tv_app):
def cmd_run(context, iterations, all_clusters_app, door_lock_app, tv_app):
runner = chiptest.runner.Runner()

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

Expand Down

0 comments on commit 84f5dab

Please sign in to comment.