@@ -101,7 +101,7 @@ async def execute_test(yaml, runner):
101
101
'--pics-file' ,
102
102
default = None ,
103
103
help = 'Optional PICS file' )
104
- def main (setup_code , yaml_path , node_id , pics_file ):
104
+ async def main (setup_code , yaml_path , node_id , pics_file ):
105
105
# Setting up python environment for running YAML CI tests using python parser.
106
106
with tempfile .NamedTemporaryFile () as chip_stack_storage :
107
107
chip .native .Init ()
@@ -122,7 +122,7 @@ def main(setup_code, yaml_path, node_id, pics_file):
122
122
# Creating and commissioning to a single controller to match what is currently done when
123
123
# running.
124
124
dev_ctrl = ca_list [0 ].adminList [0 ].NewController ()
125
- dev_ctrl .CommissionWithCode (setup_code , node_id )
125
+ await dev_ctrl .CommissionWithCode (setup_code , node_id )
126
126
127
127
def _StackShutDown ():
128
128
# Tearing down chip stack. If not done in the correct order test will fail.
@@ -143,7 +143,7 @@ def _StackShutDown():
143
143
runner = ReplTestRunner (
144
144
clusters_definitions , certificate_authority_manager , dev_ctrl )
145
145
146
- asyncio . run ( execute_test (yaml , runner ) )
146
+ await execute_test (yaml , runner )
147
147
148
148
except Exception :
149
149
print (traceback .format_exc ())
@@ -153,4 +153,6 @@ def _StackShutDown():
153
153
154
154
155
155
if __name__ == '__main__' :
156
- main ()
156
+ loop = asyncio .get_event_loop ()
157
+ loop .run_until_complete (main ())
158
+ loop .close ()
0 commit comments