20
20
21
21
import chip .clusters as Clusters
22
22
from matter_testing_support import MatterBaseTest , async_test_body , default_matter_test_main
23
- from mdns_discovery .mdns_discovery import MdnsDiscovery , MdnsServiceType
23
+ from mdns_discovery .mdns_discovery import MdnsDiscovery , MdnsServiceType , DNSRecordType
24
24
from mobly import asserts
25
25
26
26
'''
@@ -172,72 +172,75 @@ async def test_TC_SC_4_3(self):
172
172
# PENDING STEPS 6-8
173
173
174
174
mdns = MdnsDiscovery ()
175
- operational = await mdns .get_operational_service (
175
+ await mdns .get_service_by_record_type (
176
176
service_name = f"{ instance_name } .{ MdnsServiceType .OPERATIONAL .value } " ,
177
177
service_type = MdnsServiceType .OPERATIONAL .value ,
178
- log_output = True
178
+ record_type = DNSRecordType .SRV ,
179
+ log_output = True ,
180
+ load_from_cache = False
179
181
)
182
+
180
183
181
- # *** STEP 9 ***
182
- self .print_step ("9" , "TH verifies ICD, SII, SAI, SAT, and T TXT record keys/vales of the returned record." )
184
+ # # *** STEP 9 ***
185
+ # self.print_step("9", "TH verifies ICD, SII, SAI, SAT, and T TXT record keys/vales of the returned record.")
183
186
184
- # ICD TXT KEY
185
- if supports_lit :
186
- logging .info ("supports_lit is true, verify the ICD key IS present in the TXT record, and it has the value of 0 or 1 (ASCII)." )
187
+ # # ICD TXT KEY
188
+ # if supports_lit:
189
+ # logging.info("supports_lit is true, verify the ICD key IS present in the TXT record, and it has the value of 0 or 1 (ASCII).")
187
190
188
- # Verify the ICD key IS present
189
- asserts .assert_in ('ICD' , operational .txt_record , "ICD key is NOT present in the TXT record." )
191
+ # # Verify the ICD key IS present
192
+ # asserts.assert_in('ICD', operational.txt_record, "ICD key is NOT present in the TXT record.")
190
193
191
- # Verify it has the value of 0 or 1 (ASCII)
192
- icd_value = int (operational .txt_record ['ICD' ])
193
- asserts .assert_true (icd_value == 0 or icd_value == 1 , "ICD value is different than 0 or 1 (ASCII)." )
194
- else :
195
- logging .info ("supports_lit is false, verify that the ICD key is NOT present in the TXT record." )
196
- asserts .assert_not_in ('ICD' , operational .txt_record , "ICD key is present in the TXT record." )
194
+ # # Verify it has the value of 0 or 1 (ASCII)
195
+ # icd_value = int(operational.txt_record['ICD'])
196
+ # asserts.assert_true(icd_value == 0 or icd_value == 1, "ICD value is different than 0 or 1 (ASCII).")
197
+ # else:
198
+ # logging.info("supports_lit is false, verify that the ICD key is NOT present in the TXT record.")
199
+ # asserts.assert_not_in('ICD', operational.txt_record, "ICD key is present in the TXT record.")
197
200
198
- # SII TXT KEY
199
- if supports_icd and not supports_lit :
200
- sit_mode = True
201
+ # # SII TXT KEY
202
+ # if supports_icd and not supports_lit:
203
+ # sit_mode = True
201
204
202
- if supports_icd and supports_lit :
203
- if icd_value == 0 :
204
- sit_mode = True
205
- else :
206
- sit_mode = False
205
+ # if supports_icd and supports_lit:
206
+ # if icd_value == 0:
207
+ # sit_mode = True
208
+ # else:
209
+ # sit_mode = False
207
210
208
- if not supports_icd :
209
- sit_mode = False
211
+ # if not supports_icd:
212
+ # sit_mode = False
210
213
211
- if sit_mode :
212
- logging .info ("sit_mode is True, verify the SII key IS present." )
213
- asserts .assert_in ('SII' , operational .txt_record , "SII key is NOT present in the TXT record." )
214
+ # if sit_mode:
215
+ # logging.info("sit_mode is True, verify the SII key IS present.")
216
+ # asserts.assert_in('SII', operational.txt_record, "SII key is NOT present in the TXT record.")
214
217
215
- logging .info ("Verify SII value is a decimal with no leading zeros and is less than or equal to 3600000 (1h in ms)." )
216
- sii_value = operational .txt_record ['SII' ]
217
- result , message = self .verify_decimal_value (sii_value , self .ONE_HOUR_IN_MS )
218
- asserts .assert_true (result , message )
218
+ # logging.info("Verify SII value is a decimal with no leading zeros and is less than or equal to 3600000 (1h in ms).")
219
+ # sii_value = operational.txt_record['SII']
220
+ # result, message = self.verify_decimal_value(sii_value, self.ONE_HOUR_IN_MS)
221
+ # asserts.assert_true(result, message)
219
222
220
- # SAI TXT KEY
221
- if supports_icd :
222
- logging .info ("supports_icd is True, verify the SAI key IS present." )
223
- asserts .assert_in ('SAI' , operational .txt_record , "SAI key is NOT present in the TXT record." )
224
-
225
- logging .info ("Verify SAI value is a decimal with no leading zeros and is less than or equal to 3600000 (1h in ms)." )
226
- sai_value = operational .txt_record ['SAI' ]
227
- result , message = self .verify_decimal_value (sai_value , self .ONE_HOUR_IN_MS )
228
- asserts .assert_true (result , message )
229
-
230
- # SAT TXT KEY
231
- if 'SAT' in operational .txt_record :
232
- logging .info (
233
- "SAT key is present in TXT record, verify that it is a decimal value with no leading zeros and is less than or equal to 65535." )
234
- sat_value = operational .txt_record ['SAT' ]
235
- result , message = self .verify_decimal_value (sat_value , self .MAX_SAT_VALUE )
236
- asserts .assert_true (result , message )
237
-
238
- if supports_icd :
239
- logging .info ("supports_icd is True, verify the SAT value is equal to active_mode_threshold." )
240
- asserts .assert_equal (int (sat_value ), active_mode_threshold_ms )
223
+ # # SAI TXT KEY
224
+ # if supports_icd:
225
+ # logging.info("supports_icd is True, verify the SAI key IS present.")
226
+ # asserts.assert_in('SAI', operational.txt_record, "SAI key is NOT present in the TXT record.")
227
+
228
+ # logging.info("Verify SAI value is a decimal with no leading zeros and is less than or equal to 3600000 (1h in ms).")
229
+ # sai_value = operational.txt_record['SAI']
230
+ # result, message = self.verify_decimal_value(sai_value, self.ONE_HOUR_IN_MS)
231
+ # asserts.assert_true(result, message)
232
+
233
+ # # SAT TXT KEY
234
+ # if 'SAT' in operational.txt_record:
235
+ # logging.info(
236
+ # "SAT key is present in TXT record, verify that it is a decimal value with no leading zeros and is less than or equal to 65535.")
237
+ # sat_value = operational.txt_record['SAT']
238
+ # result, message = self.verify_decimal_value(sat_value, self.MAX_SAT_VALUE)
239
+ # asserts.assert_true(result, message)
240
+
241
+ # if supports_icd:
242
+ # logging.info("supports_icd is True, verify the SAT value is equal to active_mode_threshold.")
243
+ # asserts.assert_equal(int(sat_value), active_mode_threshold_ms)
241
244
242
245
# # T TXT KEY
243
246
# if 'T' in operational.txt_record:
@@ -246,19 +249,23 @@ async def test_TC_SC_4_3(self):
246
249
# result, message = self.verify_t_value(t_value)
247
250
# asserts.assert_true(result, message)
248
251
249
- # AAAA
250
- logging .info ("Verify the AAAA record contains at least one IPv6 address" )
251
- result , message = self .contains_ipv6_address (operational .addresses )
252
- asserts .assert_true (result , message )
252
+ # # AAAA
253
+ # logging.info("Verify the AAAA record contains at least one IPv6 address")
254
+ # result, message = self.contains_ipv6_address(operational.addresses)
255
+ # asserts.assert_true(result, message)
253
256
254
- # *** STEP 10 ***
255
- self .print_step ("10" , "Verify DUT returns a PTR record with DNS-SD instance name set instance_name." )
256
- service_types = await mdns .get_service_types (log_output = True )
257
- op_sub_type = self .get_operational_subtype ()
258
- asserts .assert_in (op_sub_type , service_types , f"No PTR record with DNS-SD instance name '{ op_sub_type } '" )
257
+ # # *** STEP 10 ***
258
+ # self.print_step("10", "Verify DUT returns a PTR record with DNS-SD instance name set instance_name.")
259
+ # service_types = await mdns.get_service_types(log_output=True)
260
+ # op_sub_type = self.get_operational_subtype()
261
+ # asserts.assert_in(op_sub_type, service_types, f"No PTR record with DNS-SD instance name '{op_sub_type}'")
259
262
260
263
print ("\n " * 10 )
264
+
265
+ # input()
261
266
262
267
263
268
if __name__ == "__main__" :
264
269
default_matter_test_main ()
270
+
271
+
0 commit comments