@@ -68,45 +68,32 @@ def teardown_class(self):
68
68
super ().teardown_class ()
69
69
70
70
async def create_device_and_commission_to_th_fabric (self , kvs , port , node_id_for_th , device_info ):
71
- # TODO: confirm whether we can open processes like this on the TH
72
71
app = self .user_params .get ("th_server_app_path" , None )
73
72
if not app :
74
73
asserts .fail ('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:<path_to_app>' )
75
74
75
+ if not os .path .exists (app ):
76
+ asserts .fail (f'The path { app } does not exist' )
77
+
76
78
discriminator = random .randint (0 , 4095 )
77
79
passcode = 20202021
78
- app_args = f'--secured-device-port { port } --discriminator { discriminator } --passcode { passcode } --KVS { kvs } '
79
- cmd = f'{ app } { app_args } '
80
+
81
+ cmd = [app ]
82
+ cmd .extend (['--secured-device-port' , str (port )])
83
+ cmd .extend (['--discriminator' , str (discriminator )])
84
+ cmd .extend (['--passcode' , str (passcode )])
85
+ cmd .extend (['--KVS' , kvs ])
86
+
80
87
# TODO: Determine if we want these logs cooked or pushed to somewhere else
81
88
logging .info (f"Starting TH device for { device_info } " )
82
- self .app_process_for_dut_eco = subprocess .Popen (cmd , bufsize = 0 , shell = True )
89
+ self .app_process_for_dut_eco = subprocess .Popen (cmd )
83
90
logging .info (f"Started TH device for { device_info } " )
84
91
time .sleep (3 )
85
92
86
93
logging .info ("Commissioning from separate fabric" )
87
94
await self .TH_server_controller .CommissionOnNetwork (nodeId = node_id_for_th , setupPinCode = passcode , filterType = ChipDeviceCtrl .DiscoveryFilterType .LONG_DISCRIMINATOR , filter = discriminator )
88
95
logging .info ("Commissioning device for DUT ecosystem onto TH for managing" )
89
96
90
- async def create_and_commission_device_for_th_ecosystem (self ):
91
- # TODO: confirm whether we can open processes like this on the TH
92
- app = self .user_params .get ("th_server_app_path" , None )
93
-
94
- self .device_for_th_eco_kvs = f'kvs_{ str (uuid .uuid4 ())} '
95
- discriminator = random .randint (0 , 4095 )
96
- passcode = 20202021
97
- app_args = f'--secured-device-port { self .device_for_th_eco_port } --discriminator { discriminator } --passcode { passcode } --KVS { self .device_for_th_eco_kvs } '
98
- cmd = f'{ app } { app_args } '
99
- # TODO: Determine if we want these logs cooked or pushed to somewhere else
100
- logging .info ("Starting TH device for TH ecosystem" )
101
- self .app_process_for_th_eco = subprocess .Popen (cmd , bufsize = 0 , shell = True )
102
- logging .info ("Started TH device for TH ecosystem" )
103
- time .sleep (3 )
104
-
105
- logging .info ("Commissioning from separate fabric" )
106
- self .server_nodeid = 1112
107
- await self .TH_server_controller .CommissionOnNetwork (nodeId = self .server_nodeid , setupPinCode = passcode , filterType = ChipDeviceCtrl .DiscoveryFilterType .LONG_DISCRIMINATOR , filter = discriminator )
108
- logging .info ("Commissioning TH device for TH ecosystem" )
109
-
110
97
def steps_TC_MCORE_FS_1_3 (self ) -> list [TestStep ]:
111
98
steps = [TestStep (1 , "DUT_FSA commissions TH_SED_DUT to DUT_FSAs fabric and generates a UniqueID" , is_commissioning = True ),
112
99
TestStep (2 , "TH_FSA commissions TH_SED_TH onto TH_FSAs fabric and generates a UniqueID." ),
@@ -127,6 +114,7 @@ async def test_TC_MCORE_FS_1_3(self):
127
114
kvs = f'kvs_{ str (uuid .uuid4 ())} '
128
115
device_info = "for DUT ecosystem"
129
116
await self .create_device_and_commission_to_th_fabric (kvs , self .device_for_dut_eco_port , self .device_for_dut_eco_nodeid , device_info )
117
+
130
118
self .device_for_dut_eco_kvs = kvs
131
119
read_result = await self .TH_server_controller .ReadAttribute (self .device_for_dut_eco_nodeid , [(root_node_endpoint , Clusters .BasicInformation .Attributes .UniqueID )])
132
120
result = read_result [root_node_endpoint ][Clusters .BasicInformation ][Clusters .BasicInformation .Attributes .UniqueID ]
0 commit comments