31
31
import click
32
32
from chip .ChipStack import *
33
33
from chip .yaml .runner import ReplTestRunner
34
- from matter_yamltests .definitions import SpecDefinitionsFromPath
34
+ from matter_yamltests .definitions import SpecDefinitionsFromPaths
35
35
from matter_yamltests .parser import TestParser
36
36
37
37
_DEFAULT_CHIP_ROOT = os .path .abspath (
@@ -75,7 +75,8 @@ def main(setup_code, yaml_path, node_id, pics_file):
75
75
ca = certificate_authority_manager .NewCertificateAuthority ()
76
76
ca .NewFabricAdmin (vendorId = 0xFFF1 , fabricId = 1 )
77
77
elif len (certificate_authority_manager .activeCaList [0 ].adminList ) == 0 :
78
- certificate_authority_manager .activeCaList [0 ].NewFabricAdmin (vendorId = 0xFFF1 , fabricId = 1 )
78
+ certificate_authority_manager .activeCaList [0 ].NewFabricAdmin (
79
+ vendorId = 0xFFF1 , fabricId = 1 )
79
80
80
81
ca_list = certificate_authority_manager .activeCaList
81
82
@@ -93,26 +94,33 @@ def _StackShutDown():
93
94
94
95
try :
95
96
# Creating Cluster definition.
96
- clusters_definitions = SpecDefinitionsFromPath (
97
- _CLUSTER_XML_DIRECTORY_PATH + '/*/*.xml' ,
98
- )
97
+ clusters_definitions = SpecDefinitionsFromPaths ([
98
+ _CLUSTER_XML_DIRECTORY_PATH + '/chip/*.xml' ,
99
+
100
+ # Some still-silabs clusters
101
+ _CLUSTER_XML_DIRECTORY_PATH + '/silabs/ha.xml' , # For fan control
102
+ _CLUSTER_XML_DIRECTORY_PATH + '/silabs/general.xml' , # For groups cluster
103
+ ])
99
104
100
105
# Parsing YAML test and setting up chip-repl yamltests runner.
101
106
yaml = TestParser (yaml_path , pics_file , clusters_definitions )
102
- runner = ReplTestRunner (clusters_definitions , certificate_authority_manager , dev_ctrl )
107
+ runner = ReplTestRunner (
108
+ clusters_definitions , certificate_authority_manager , dev_ctrl )
103
109
104
110
# Executing and validating test
105
111
for test_step in yaml .tests :
106
112
test_action = runner .encode (test_step )
107
113
# TODO if test_action is None we should see if it is a pseudo cluster.
108
114
if test_action is None :
109
- raise Exception (f'Failed to encode test step { test_step .label } ' )
115
+ raise Exception (
116
+ f'Failed to encode test step { test_step .label } ' )
110
117
if not test_action .pics_enabled :
111
118
continue
112
119
113
120
response = runner .execute (test_action )
114
121
decoded_response = runner .decode (response )
115
- post_processing_result = test_step .post_process_response (decoded_response )
122
+ post_processing_result = test_step .post_process_response (
123
+ decoded_response )
116
124
if not post_processing_result .is_success ():
117
125
raise Exception (f'Test step failed { test_step .label } ' )
118
126
except Exception :
0 commit comments