@@ -53,6 +53,7 @@ class TC_DRLK_2_13(MatterBaseTest):
53
53
54
54
def steps_TC_DRLK_2_13 (self ) -> list [TestStep ]:
55
55
steps = [
56
+ TestStep ("0" , "Commissoning with DUT is done" , is_commissioning = True ),
56
57
TestStep ("1a" , "TH reads OperationalCredentials cluster's CurrentFabricIndex and save the attribute" ,
57
58
"TH Reads Attribute Successfully" ),
58
59
TestStep ("1b" , "TH sends ClearUser Command to DUT with the UserIndex as 0xFFFE to clear all the users" ,
@@ -145,11 +146,11 @@ def steps_TC_DRLK_2_13(self) -> list[TestStep]:
145
146
"Verify that the DUT responds with SetCredentialResponse command and Status success. This step will fill the last slot with credentialType as AliroEvictableEndpointKey" ),
146
147
TestStep ("31" ,
147
148
"TH sends SetCredential Command to DUT with CredentialType as AliroNonEvictableEndpointKey and number of credentials for 'alirouser' exceeds the max_aliro_keys_supported" ,
148
- "Verify that the DUT responds with SetCredentialResponse command and Status success. " ),
149
- TestStep ("32" , "TH sends GetCredentialStatus Command with Credential as 7 startcredentialindex+ 1" ,
150
- "DUT responds with GetCredentialStatusResponse Command and CredentialExists is false " ),
151
- TestStep ("33" , "TH sends GetCredentialStatus Command with Credential as 8 startcredentialindex+1 " ,
152
- "Verify DUT responds with GetCredentialStatusResponse having CredentialExists is true and UserIndex as 1" ),
149
+ "Verify that the DUT responds with SetCredentialResponse command and Status ResourceExhausted " ),
150
+ TestStep ("32" , "TH sends GetCredentialStatus Command with Credential as 7 1" ,
151
+ "DUT responds with GetCredentialStatusResponse Command and CredentialExists is True " ),
152
+ TestStep ("33" , "TH sends GetCredentialStatus Command with Credential as 8 max_aliro_keys_supported " ,
153
+ "Verify DUT responds with GetCredentialStatusResponse having CredentialExists is false and UserIndex as 1" ),
153
154
TestStep ("34" , "TH sends ClearCredential Command to DUT to clear the ALIRO CredentialType" ,
154
155
"Verify that the DUT sends SUCCESS response" ),
155
156
TestStep ("35" , "TH sends ClearUser Command to DUT with the UserIndex as 1" ,
@@ -249,7 +250,7 @@ async def get_credentials_status(self, credentialIndex: int, credentialType: clu
249
250
self .step (step )
250
251
try :
251
252
flags = ["DRLK.S.F0d" , "DRLK.S.C24.Rsp" , "DRLK.S.C25.Tx" ]
252
- if not self .pics_guard (all ([self .check_pics (p ) for p in flags ])):
253
+ if self .pics_guard (all ([self .check_pics (p ) for p in flags ])):
253
254
credentials_struct = cluster .Structs .CredentialStruct (credentialIndex = credentialIndex ,
254
255
credentialType = credentialType )
255
256
response = await self .send_single_cmd (endpoint = self .app_cluster_endpoint , timedRequestTimeoutMs = 1000 ,
@@ -268,7 +269,8 @@ async def get_credentials_status(self, credentialIndex: int, credentialType: clu
268
269
asserts .assert_equal (e .status , Status .Success , f"Unexpected error returned: { e } " )
269
270
270
271
async def set_credential_cmd (self , credential_enum : Clusters .DoorLock .Enums .CredentialTypeEnum , credentialIndex ,
271
- operationType , userIndex , credentialData , userStatus , userType , step = None ):
272
+ operationType , userIndex , credentialData , userStatus , userType , step = None ,
273
+ expected_status : Status = Status .Success ):
272
274
if step :
273
275
self .step (step )
274
276
credentials = cluster .Structs .CredentialStruct (
@@ -287,7 +289,7 @@ async def set_credential_cmd(self, credential_enum: Clusters.DoorLock.Enums.Cred
287
289
timedRequestTimeoutMs = 1000 )
288
290
asserts .assert_true (type_matches (response , Clusters .Objects .DoorLock .Commands .SetCredentialResponse ),
289
291
"Unexpected return type for SetCredential" )
290
- asserts .assert_true (response .status == Status . Success ,
292
+ asserts .assert_true (response .status == expected_status ,
291
293
"Error sending SetCredential command, status={}" .format (str (response .status )))
292
294
except InteractionModelError as e :
293
295
logging .exception (e )
@@ -370,6 +372,7 @@ async def test_TC_DRLK_2_13(self):
370
372
self .alirononevictableendpointkey1 = bytes .fromhex (
371
373
"047a4c552d753924cdf3779a3c84fec2debaa6f0b3084450878acc7ddcce7856ae57b1ebbe2561015103dd7474c2a183675378ec55f1e465ac3436bf3dd5ca54d4" )
372
374
# step 1 TH reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute
375
+ self .step ("0" )
373
376
self .step ("1a" )
374
377
self .fabric_idx1 = await self .read_attributes_from_dut (endpoint = self .common_cluster_endpoint ,
375
378
cluster = Clusters .Objects .OperationalCredentials ,
@@ -569,6 +572,8 @@ async def test_TC_DRLK_2_13(self):
569
572
endpoint = self .app_cluster_endpoint ,
570
573
cluster = Clusters .Objects .DoorLock ,
571
574
attribute = Clusters .DoorLock .Attributes .NumberOfCredentialsSupportedPerUser )
575
+ logging .info (f"After reading attribute NumberOfCredentialsSupportedPerUser we get"
576
+ f" value { self .numberofcredentialsupportedperuser } " )
572
577
self .step ("28b" )
573
578
await self .clear_all_aliro_credential ()
574
579
await self .send_clear_user_cmd (user_index = 1 )
@@ -600,7 +605,7 @@ async def test_TC_DRLK_2_13(self):
600
605
start_credential_index = 1
601
606
credentials_data = self .alirononevictableendpointkey
602
607
while 1 :
603
- if start_credential_index <= (self .max_aliro_keys_supported - 2 ):
608
+ if start_credential_index <= (self .max_aliro_keys_supported - 1 ):
604
609
if start_credential_index != 1 :
605
610
credentials_data = self .generate_unique_octbytes ()
606
611
@@ -614,37 +619,36 @@ async def test_TC_DRLK_2_13(self):
614
619
logging .info (f"The updated value of start_credential_index is { start_credential_index } " )
615
620
else :
616
621
break
617
-
618
- # step 30
619
- logging .info (f"the value of start_credential_index is { start_credential_index } for step 30" )
620
622
self .step ("30" )
621
623
await self .set_credential_cmd (credentialData = self .alirononevictableendpointkey ,
622
624
operationType = cluster .Enums .DataOperationTypeEnum .kAdd ,
623
625
credential_enum = cluster .Enums .CredentialTypeEnum .kAliroEvictableEndpointKey ,
624
- credentialIndex = start_credential_index , userIndex = 1 , userStatus = NullValue ,
626
+ credentialIndex = 1 , userIndex = 1 , userStatus = NullValue ,
625
627
userType = NullValue )
628
+
626
629
# step 31
627
630
self .step ("31" )
628
631
await self .set_credential_cmd (credentialData = self .alirononevictableendpointkey1 ,
629
632
operationType = cluster .Enums .DataOperationTypeEnum .kAdd ,
630
633
credential_enum = cluster .Enums .CredentialTypeEnum .kAliroNonEvictableEndpointKey ,
631
- credentialIndex = start_credential_index , userIndex = 1 , userStatus = NullValue ,
632
- userType = NullValue )
634
+ credentialIndex = self .max_aliro_keys_supported , userIndex = 1 , userStatus = NullValue ,
635
+ userType = NullValue ,
636
+ expected_status = Status .ResourceExhausted )
633
637
# step 32
634
- dut_get_cred_response = await self .get_credentials_status (step = "32" ,
635
- credentialIndex = start_credential_index ,
636
- credentialType = cluster .Enums .CredentialTypeEnum .kAliroEvictableEndpointKey ,
637
- credential_exists = False , userIndex = NullValue )
638
- asserts .assert_equal (dut_get_cred_response .credentialExists , NullValue ,
639
- f"Error when comparing for { dut_get_cred_response } of null" )
638
+ await self .get_credentials_status (step = "32" , credentialIndex = 1 ,
639
+ credentialType = cluster .Enums .CredentialTypeEnum .kAliroEvictableEndpointKey ,
640
+ credential_exists = True , userIndex = 1 )
640
641
641
642
# step 33
642
- await self .get_credentials_status (step = "33" , credentialIndex = start_credential_index ,
643
+ await self .get_credentials_status (step = "33" , credentialIndex = self . max_aliro_keys_supported ,
643
644
credentialType = cluster .Enums .CredentialTypeEnum .kAliroNonEvictableEndpointKey ,
644
- credential_exists = True , userIndex = 1 )
645
+ credential_exists = False , userIndex = NullValue )
645
646
# step 34
646
647
self .step ("34" )
647
- await self .clear_all_aliro_credential ()
648
+ if self .pics_guard (self .check_pics ("DRLK.S.C26.Rsp" )):
649
+ await self .send_single_cmd (cmd = Clusters .DoorLock .Commands .ClearCredential (credential = NullValue ),
650
+ endpoint = self .app_cluster_endpoint ,
651
+ timedRequestTimeoutMs = 1000 )
648
652
649
653
# step 35
650
654
self .step ("35" )
0 commit comments