Skip to content

Commit e0755e5

Browse files
committed
Added nextcredentialIndex check in get_credential_status function
1 parent 534f77b commit e0755e5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/python_testing/TC_DRLK_2_9.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ async def get_user(self, userindex, username, useruniqueid, credentiallist, expe
220220
except InteractionModelError as e:
221221
asserts.assert_equal(e.status, expected_status, f"Unexpected error returned: {e}")
222222

223-
async def get_credentials_status(self, credentialIndex: int, credentialType: drlkcluster.Enums.CredentialTypeEnum, credential_exists):
223+
async def get_credentials_status(self, credentialIndex: int, credentialType: drlkcluster.Enums.CredentialTypeEnum, credential_exists, next_credential_index):
224224

225225
try:
226226
credentials_struct = drlkcluster.Structs.CredentialStruct(credentialIndex=credentialIndex,
@@ -237,14 +237,17 @@ async def get_credentials_status(self, credentialIndex: int, credentialType: drl
237237
asserts.assert_true(response.userIndex == NullValue,
238238
"Error when executing GetCredentialStatus command, userIndex={}".format(
239239
str(response.userIndex)))
240+
asserts.assert_true(response.nextCredentialIndex == next_credential_index,
241+
"Error when executing GetCredentialStatus command, nextCredentialIndex={}".format(
242+
str(response.nextCredentialIndex)))
240243
return response
241244
except InteractionModelError as e:
242245
logging.error(e)
243246
asserts.assert_equal(e.status, Status.Success, f"Unexpected error returned: {e}")
244247

245248
async def set_credential_cmd(self, credential_enum: drlkcluster.Enums.CredentialTypeEnum, statuscode, credentialIndex,
246249
operationType, userIndex, credentialData, userStatus, userType):
247-
custom_stautus_code = 149
250+
custom_status_code = 149
248251

249252
credentials = drlkcluster.Structs.CredentialStruct(
250253
credentialType=credential_enum,
@@ -265,7 +268,7 @@ async def set_credential_cmd(self, credential_enum: drlkcluster.Enums.Credential
265268
asserts.assert_true(type_matches(response, drlkcluster.Commands.SetCredentialResponse),
266269
"Unexpected return type for SetCredential")
267270
asserts.assert_equal(response.userIndex, NullValue)
268-
if (statuscode != custom_stautus_code):
271+
if (statuscode != custom_status_code):
269272
asserts.assert_true(response.status == statuscode,
270273
"Error sending SetCredential command, status={}".format(str(response.status)))
271274
else:
@@ -432,7 +435,7 @@ async def test_TC_DRLK_2_9(self):
432435
if self.pics_guard(self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F08")
433436
and self.check_pics("DRLK.S.C24.Rsp") and self.check_pics("DRLK.S.C25.Tx")):
434437
await self.get_credentials_status(credentialIndex=credentialIndex_1,
435-
credentialType=drlkcluster.Enums.CredentialTypeEnum.kPin, credential_exists=True)
438+
credentialType=drlkcluster.Enums.CredentialTypeEnum.kPin, credential_exists=True, next_credential_index=NullValue)
436439
self.step("4")
437440
if self.pics_guard(self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F08")
438441
and self.check_pics("DRLK.S.C22.Rsp") and self.check_pics("DRLK.S.C23.Tx")):
@@ -479,7 +482,7 @@ async def test_TC_DRLK_2_9(self):
479482
self.step("9a")
480483
if self.pics_guard(self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F08") and self.check_pics("DRLK.S.C24.Rsp")):
481484
await self.get_credentials_status(credentialIndex=credentialIndex_1,
482-
credentialType=drlkcluster.Enums.CredentialTypeEnum.kPin, credential_exists=False)
485+
credentialType=drlkcluster.Enums.CredentialTypeEnum.kPin, credential_exists=False, next_credential_index=NullValue)
483486
self.step("9b")
484487
if self.pics_guard(self.check_pics("DRLK.S.F08") and self.check_pics("DRLK.S.C1d.Rsp")):
485488
await self.send_clear_user_cmd(user_index=1)
@@ -516,7 +519,7 @@ async def test_TC_DRLK_2_9(self):
516519
self.step("13")
517520
if self.pics_guard(self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F08") and self.check_pics("DRLK.S.C24.Rsp") and self.check_pics("DRLK.S.C25.Tx")):
518521
await self.get_credentials_status(credentialIndex=credentialIndex_1,
519-
credentialType=drlkcluster.Enums.CredentialTypeEnum.kPin, credential_exists=False)
522+
credentialType=drlkcluster.Enums.CredentialTypeEnum.kPin, credential_exists=False, next_credential_index=NullValue)
520523
self.step("14a")
521524
if self.pics_guard(self.check_pics("DRLK.S.F08") and self.check_pics("DRLK.S.C26.Rsp")):
522525
feature_map = await self.read_attributes_from_dut(endpoint=self.app_cluster_endpoint,

0 commit comments

Comments
 (0)