Skip to content

Commit

Permalink
Fix tests for Door Lock cluster and run them against the lock app
Browse files Browse the repository at this point in the history
  • Loading branch information
Morozov-5F committed Jul 7, 2022
1 parent 3b1732c commit aaf89fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
28 changes: 17 additions & 11 deletions scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,34 @@


def target_for_name(name: str):
if name.startswith('TV_') or name.startswith('Test_TC_MC_'):
if name.startswith("TV_") or name.startswith("Test_TC_MC_"):
return TestTarget.TV
if name.startswith('DL_') or name.startswith('Test_TC_DL_'):
if name.startswith("DL_") or name.startswith("Test_TC_DLRK_"):
return TestTarget.LOCK
if name.startswith('OTA_'):
if name.startswith("OTA_"):
return TestTarget.OTA
return TestTarget.ALL_CLUSTERS


def tests_with_command(chip_tool: str, is_manual: bool):
"""Executes `chip_tool` binary to see what tests are available, using cmd
to get the list.
to get the list.
"""
cmd = 'list'
cmd = "list"
if is_manual:
cmd += '-manual'
cmd += "-manual"

result = subprocess.run([chip_tool, 'tests', cmd], capture_output=True)
result = subprocess.run([chip_tool, "tests", cmd], capture_output=True)

for name in result.stdout.decode('utf8').split('\n'):
for name in result.stdout.decode("utf8").split("\n"):
if not name:
continue

target = target_for_name(name)

yield TestDefinition(run_name=name, name=name, target=target, is_manual=is_manual)
yield TestDefinition(
run_name=name, name=name, target=target, is_manual=is_manual
)


def AllTests(chip_tool: str):
Expand All @@ -58,6 +60,10 @@ def AllTests(chip_tool: str):


__all__ = [
'TestTarget', 'TestDefinition', 'AllTests', 'ApplicationPaths',
'linux', 'runner',
"TestTarget",
"TestDefinition",
"AllTests",
"ApplicationPaths",
"linux",
"runner",
]
4 changes: 2 additions & 2 deletions src/app/tests/suites/certification/Test_TC_DLRK_2_7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ tests:
hasValue: false

- label:
"send Get Year Day Schedule Command to DUT and verify NOT_FOUND
"send Get Year Day Schedule Command to DUT and verify FAILURE
response"
command: "GetYearDaySchedule"
arguments:
Expand All @@ -197,7 +197,7 @@ tests:
- name: "userIndex"
value: 5
- name: "status"
value: 0x8B
value: 0x01
- name: "LocalStartTime"
constraints:
hasValue: false
Expand Down

0 comments on commit aaf89fa

Please sign in to comment.