tree: e4c8539cc2eb5e1a75ab8d438d06c2256e00df40 [path history] [tgz]
  1. README.md
  2. Test_TC_DM_1_1.yaml
  3. Test_TC_DM_3_1.yaml
  4. Test_TC_OO_1_1.yaml
  5. Test_TC_OO_2_1.yaml
  6. Test_TC_OO_2_2.yaml
  7. TestCluster.yaml
  8. TV_AccountLoginCluster.yaml
  9. TV_ApplicationBasicCluster.yaml
  10. TV_ApplicationLauncherCluster.yaml
  11. TV_AudioOutputCluster.yaml
  12. TV_KeypadInputCluster.yaml
  13. TV_LowPowerCluster.yaml
  14. TV_MediaInputCluster.yaml
  15. TV_MediaPlaybackCluster.yaml
  16. TV_TargetNavigatorCluster.yaml
  17. TV_TvChannelCluster.yaml
src/app/tests/suites/README.md

CHIP Test Suites

This directory contains a set of tests describing interactions between nodes, and more specifically between a controller and a controllee.

This test set is written in a high level language before being automatically converted into a language understandable by the different controllers.

Controllers

There are currently 4 implementations of the CHIP device controller. These different implementations share a common configuration file describing the supported functionalities in terms of clusters, commands and attributes: controllers-clusters.zap

ControllersTesting
POSIX CLIy
iOSy
Pythonn
Androidn

For more information on the different implementations of the CHIP device controller, see README.md

Automatic conversion process

The process of automatic conversion of test files depends on the ZAP tool.

Each of the CHIP device controller implementations uses a dedicated template translating the tests into an appropriate format.

ControllersTemplate
POSIX CLIexamples/chip-tool/templates/partials/test_cluster.zapt
iOSsrc/darwin/Framework/CHIP/templates/partials/test_cluster.zapt
Python
Android

These dedicated templates share a common script which augments the test file with the content of the ZAP database built from the definition files of the specification.

Lists

This common script exposes the result of the analysis in the form of multiple lists accessible from the dedicated template files.

These lists contain elements of which certain properties are directly configurable through the source test file, but also additional properties added during the analysis.

List: {{chip_tests}}

{{chip_tests}} takes as parameter a list of test files and returns an iterable list of objects.

Each element of the list is an object with the following properties:

NameDescription
nameName of the test set in human readable format
configDefault configuration that is inherited by each of the tests in this set
testsThe set of tests. It is possible to iterate over it using {{chip_test_items}}
Property: config
NameDescription
clusterName of the cluster that will be targeted by default by each of the tests in this set
endpointEndpoint Identifier that will be targeted by default by each of the tests in this set

Additionally, the object exhibits the following autogenerated properties:

NameDescription
filenameName of the source file from which the test set was built
totalTestsTotal number of tests contained in this set

List: {{chip_tests_items}}

{{chip_tests_items}} can be used inside a {{chip_tests}} block and iterates over the test set.

Each element of the list is an object with the following configurable properties:

NameDescription
labelTest name
disabledAllows to deactivate a test
commandName of the command to execute. The command can be any of the commands available for the cluster, or a special command.
attributeIf the command is a special attribute command, then this property contains the name of the attribute targeted by the command.
optionalAllows you to specify that a test is optional. An optional test passes if the controllee does not support the requested command or if the command is supported, and the specified conditions are validated.
clusterThe name of the target cluster. If not specified, the default configuration is used.
endpointThe identifier of the target endpoint. If not specified, the default configuration is used.
argumentsA list of arguments to pass to the command. It is possible to iterate over it using {{chip_test_item_\parameters}}
responseA list of expected results or result constraints. It is possible to iterate over it using {{chip_test_item_response_parameters}}

Additionally, the object exhibits the following autogenerated properties:

NameDescription
indexOverall test index

List: {{chip_tests_item_parameters}}

{{chip_tests_item|_parameters}} can be used inside a {{chip_test_items}} block and iterates over the test arguments for the target command.

This object contains all the properties contained in the ZAP database related to the command or the attribute in the case of a special attribute command.

It is increased by the value to be used contained in the test file.

List: {{chip_tests_item_response_parameters}}

{{chip_tests_item|_response|_parameters}} can be used inside a {{chip_test_items}} block and iterates over the test response arguments for the target command.

This object contains all the properties contained in the ZAP database related to the response or the attribute response in the case of a special attribute command.

It is increased by the expected value or the constraints to be used contained in the test file.