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 committed Feb 22, 2022
1 parent fb4ce3b commit bb91bf4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
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 @@ -145,6 +145,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 @@ -205,10 +206,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 bb91bf4

Please sign in to comment.