Skip to content

Commit

Permalink
Updated DoorLock Python scripts and DRLK_2_1 yaml.
Browse files Browse the repository at this point in the history
* TC_DRLK_2_X.py - updated as per latest test plan

* TC_BOOLCFG_3_1.py - Test description is changed.

* TC_PWRTL_2_1.py - Added missing step for subset check as per latest test plan.

* Test_TC_DRLK_2_1.yaml - Script is updated with latest changes from test plan.
  • Loading branch information
Harshith-GRL committed Aug 23, 2024
1 parent 9520bef commit 7ff26a6
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 212 deletions.
215 changes: 98 additions & 117 deletions src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,104 +35,6 @@ tests:
- name: "nodeId"
value: nodeId

- label: "Precondition: Create new user"
PICS: DRLK.S.F00 && DRLK.S.F07
command: "SetUser"
timedInteractionTimeoutMs: 1000
arguments:
values:
- name: "OperationType"
value: 0
- name: "UserIndex"
value: 1
- name: "UserName"
value: "xxx"
- name: "UserUniqueID"
value: 6452
- name: "UserStatus"
value: 1
- name: "UserType"
value: 0
- name: "CredentialRule"
value: 0

- label: "Precondition: Read the user back and verify its fields"
PICS: DRLK.S.F00 && DRLK.S.F07
command: "GetUser"
arguments:
values:
- name: "UserIndex"
value: 1
response:
values:
- name: "UserIndex"
value: 1
- name: "UserName"
value: "xxx"
- name: "UserUniqueID"
value: 6452
- name: "UserStatus"
value: 1
- name: "UserType"
value: 0
- name: "CredentialRule"
value: 0
- name: "Credentials"
value: []
- name: "CreatorFabricIndex"
value: 1
- name: "LastModifiedFabricIndex"
value: 1
- name: "NextUserIndex"
value: null

- label: "Precondition: Create new PIN credential and lock/unlock user"
PICS: DRLK.S.F00 && DRLK.S.F07
command: "SetCredential"
timedInteractionTimeoutMs: 1000
arguments:
values:
- name: "OperationType"
value: 0
- name: "Credential"
value: { CredentialType: 1, CredentialIndex: 1 }
- name: "CredentialData"
value: "123456"
- name: "UserIndex"
value: 1
- name: "UserStatus"
value: null
- name: "UserType"
value: null
response:
values:
- name: "Status"
value: 0
- name: "UserIndex"
value: null
- name: "NextCredentialIndex"
value: 2

- label: "Precondition: Verify created PIN credential"
PICS: DRLK.S.F00 && DRLK.S.F07
command: "GetCredentialStatus"
arguments:
values:
- name: "Credential"
value: { CredentialType: 1, CredentialIndex: 1 }
response:
values:
- name: "CredentialExists"
value: true
- name: "UserIndex"
value: 1
- name: "CreatorFabricIndex"
value: 1
- name: "LastModifiedFabricIndex"
value: 1
- name: "NextCredentialIndex"
value: null

- label: "Step 1a: TH reads LockState attribute from DUT"
PICS: DRLK.S.A0000
command: "readAttribute"
Expand Down Expand Up @@ -160,8 +62,70 @@ tests:
response:
value: LockStateValue

- label: "Step 1d: TH sends SetUser Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C1a.Rsp
command: "SetUser"
timedInteractionTimeoutMs: 1000
arguments:
values:
- name: "OperationType"
value: 0
- name: "UserIndex"
value: 1
- name: "UserName"
value: "xxx"
- name: "UserUniqueID"
value: 6452
- name: "UserStatus"
value: 1
- name: "UserType"
value: 0
- name: "CredentialRule"
value: 0

- label: "Step 1e: TH reads MinPINCodeLength attribute and saves the value as min_pin_code_length"
PICS: DRLK.S.F08 && DRLK.S.F00
command: "readAttribute"
attribute: "MinPINCodeLength"
response:
saveAs: min_pin_code_length
constraints:
type: int8u
minValue: 0
maxValue: 255

- label: "Step 1f: TH reads MaxPINCodeLength attribute and saves the value as max_pin_code_length"
PICS: DRLK.S.F08 && DRLK.S.F00
command: "readAttribute"
attribute: "MaxPINCodeLength"
response:
saveAs: max_pin_code_length
constraints:
type: int8u
minValue: 0
maxValue: 255

- label: "Step 1g: TH sends SetCredential Command"
PICS: DRLK.S.F00 && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
command: "SetCredential"
timedInteractionTimeoutMs: 1000
arguments:
values:
- name: "OperationType"
value: 0
- name: "Credential"
value: { CredentialType: 1, CredentialIndex: 1 }
- name: "CredentialData"
value: "123456"
- name: "UserIndex"
value: 1
- name: "UserStatus"
value: null
- name: "UserType"
value: null

- label:
"Step 1d: TH sends a Lock Door command to the DUT. If DRLK.S.F00(PIN)
"Step 1h: TH sends a Lock Door command to the DUT. If DRLK.S.F00(PIN)
& DRLK.S.F07(COTA), include a Valid PINCode in the Lock Door command."
PICS: DRLK.S.C00.Rsp && DRLK.S.F00 && DRLK.S.F07 && DRLK.S.A0000
command: "LockDoor"
Expand All @@ -171,7 +135,7 @@ tests:
- name: "PINCode"
value: "123456"

- label: "Step 1d: TH sends a Lock Door command to the DUT."
- label: "Step 1h: TH sends a Lock Door command to the DUT without pin_code."
PICS: DRLK.S.C00.Rsp && !DRLK.S.F00 && !DRLK.S.F07 && DRLK.S.A0000
command: "LockDoor"
timedInteractionTimeoutMs: 1000
Expand All @@ -182,33 +146,30 @@ tests:
command: "WaitForMs"
arguments:
values:
- name: "ms"
value: WaitAfterLockAandUnlockDoor

- label: "Step 1d: TH reads LockState attribute from DUT"
- name: "ms"
value: WaitAfterLockAandUnlockDoor
- label: "Step 1h: TH reads LockState attribute from DUT"
PICS: DRLK.S.A0000
command: "readAttribute"
attribute: "LockState"
response:
value: 1

- label:
"Step 1e: TH sends a Unlock Door command to the DUT. If
- label: "Step 1i: TH sends a Unlock Door command to the DUT. If
DRLK.S.F00(PIN) & DRLK.S.F07(COTA), include a Valid PINCode in the
Unlock Door command"
PICS: DRLK.S.C01.Rsp && !DRLK.S.F00 && !DRLK.S.F07 && DRLK.S.A0000
command: "UnlockDoor"
timedInteractionTimeoutMs: 1000

- label: "Step 1e: TH sends a Unlock Door command to the DUT."
PICS: DRLK.S.C01.Rsp && DRLK.S.F00 && DRLK.S.F07 && DRLK.S.A0000
command: "UnlockDoor"
timedInteractionTimeoutMs: 1000
arguments:
values:
- name: "PINCode"
value: "123456"


- label: "Step 1i: TH sends a Unlock Door command to the DUT without pincode."
PICS: DRLK.S.C01.Rsp && !DRLK.S.F00 && !DRLK.S.F07 && DRLK.S.A0000
command: "UnlockDoor"
timedInteractionTimeoutMs: 1000

- label: "Wait after Unlock Door"
PICS: DRLK.S.C00.Rsp
cluster: "DelayCommands"
Expand All @@ -218,14 +179,14 @@ tests:
- name: "ms"
value: WaitAfterLockAandUnlockDoor

- label: "Step 1e: TH reads LockState attribute from DUT"
- label: "Step 1i: TH reads LockState attribute from DUT"
PICS: DRLK.S.A0000
command: "readAttribute"
attribute: "LockState"
response:
value: 2

- label: "Step 1f: Simulate a not fully locked scenario on the DUT."
- label: "Step 1j: Simulate a not fully locked scenario on the DUT."
PICS:
DRLK.S.A0000 && DRLK.S.M.SimulateNotFullyLocked &&
PICS_SKIP_SAMPLE_APP
Expand Down Expand Up @@ -1366,6 +1327,26 @@ tests:
response:
value: Current_WrongCode_EntryLimit

- label: "Step 31b: TH writes WrongCodeEntryLimit attribute as 8"
PICS:
" ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030 &&
DRLK.S.M.WrongCodeEntryLimitAttributeWritable "
command: "writeAttribute"
attribute: "WrongCodeEntryLimit"
arguments:
value: 8

- label: "Step 31b: TH writes WrongCodeEntryLimit attribute as 8"
PICS:
" ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030 &&
!DRLK.S.M.WrongCodeEntryLimitAttributeWritable "
command: "writeAttribute"
attribute: "WrongCodeEntryLimit"
arguments:
value: 8
response:
error: UNSUPPORTED_WRITE

- label:
"Step 32a: TH reads UserCodeTemporary DisableTime attribute from DUT
TH saves the values as Current_UserCode TemporaryDisableTime"
Expand Down Expand Up @@ -1552,7 +1533,7 @@ tests:
value: NumberOfCredentialsSupportedPerUserValue

- label: "Step 36: TH sends ClearCredential Command to DUT"
PICS: DRLK.S.F00 && DRLK.S.F07 && DRLK.S.C26.Rsp
PICS: DRLK.S.F00 && DRLK.S.F08 && DRLK.S.C26.Rsp
command: "ClearCredential"
timedInteractionTimeoutMs: 1000
arguments:
Expand All @@ -1562,7 +1543,7 @@ tests:

- label:
"Step 37: TH sends ClearUser Command to DUT with the UserIndex as 1"
PICS: DRLK.S.F07 && DRLK.S.C1d.Rsp
PICS: DRLK.S.F08 && DRLK.S.C1d.Rsp
command: "ClearUser"
timedInteractionTimeoutMs: 1000
arguments:
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_BOOLCFG_3_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def steps_TC_BOOLCFG_3_1(self) -> list[TestStep]:
steps = [
TestStep(1, "Commissioning, already done", is_commissioning=True),
TestStep("2a", "Read FeatureMap attribute"),
TestStep("2b", "Verify SENS feature is supported"),
TestStep("2b", "Verify SENSLVL feature is supported"),
TestStep("2c", "Read AttributeList attribute"),
TestStep(3, "Read SupportedSensitivityLevels attribute"),
TestStep(4, "Read DefaultSensitivityLevel attribute, if supported"),
Expand Down
5 changes: 0 additions & 5 deletions src/python_testing/TC_DRLK_2_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ class TC_DRLK_2_12(MatterBaseTest, DRLK_COMMON):
def setup_class(self):
return super().setup_class()

@async_test_body
async def teardown_test(self):
await self.teardown()
return super().teardown_test()

def pics_TC_DRLK_2_12(self) -> list[str]:
return ["DRLK.S.F0c"]

Expand Down
5 changes: 0 additions & 5 deletions src/python_testing/TC_DRLK_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ class TC_DRLK_2_2(MatterBaseTest, DRLK_COMMON):
def setup_class(self):
return super().setup_class()

@async_test_body
async def teardown_test(self):
await self.teardown()
return super().teardown_test()

def pics_TC_DRLK_2_2(self) -> list[str]:
return ["DRLK.S"]

Expand Down
5 changes: 0 additions & 5 deletions src/python_testing/TC_DRLK_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ class TC_DRLK_2_3(MatterBaseTest, DRLK_COMMON):
def setup_class(self):
return super().setup_class()

@async_test_body
async def teardown_test(self):
await self.teardown()
return super().teardown_test()

def pics_TC_DRLK_2_3(self) -> list[str]:
return ["DRLK.S"]

Expand Down
17 changes: 6 additions & 11 deletions src/python_testing/TC_PWRTL_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ async def test_TC_PWRTL_2_1(self):
self.print_step(2, "Read AvailableAttributes attribute")
available_endpoints = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=Clusters.Objects.PowerTopology, attribute=attributes.AvailableEndpoints)

if available_endpoints == NullValue:
logging.info("AvailableEndpoints is null")
else:
logging.info("AvailableEndpoints: %s" % (available_endpoints))

asserts.assert_less_equal(len(available_endpoints), 21,
asserts.assert_less_equal(len(available_endpoints), 20,
"AvailableEndpoints length %d must be less than 21!" % len(available_endpoints))

if not self.check_pics("PWRTL.S.A0001"):
Expand All @@ -71,11 +66,11 @@ async def test_TC_PWRTL_2_1(self):
self.print_step(3, "Read ActiveEndpoints attribute")
active_endpoints = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=Clusters.Objects.PowerTopology, attribute=attributes.ActiveEndpoints)
logging.info("ActiveEndpoints: %s" % (active_endpoints))

if available_endpoints == NullValue:
asserts.assert_true(active_endpoints == NullValue,
"ActiveEndpoints should be null when AvailableEndpoints is null: %s" % active_endpoints)

asserts.assert_less_equal(len(active_endpoints), 20,
"ActiveEndpoints length %d must be less than 21!" % len(active_endpoints))
# Verify that ActiveEndpoints is a subset of AvailableEndpoints
asserts.assert_true(set(active_endpoints).issubset(set(available_endpoints)),
"ActiveEndpoints should be a subset of AvailableEndpoints")

if __name__ == "__main__":
default_matter_test_main()
Loading

0 comments on commit 7ff26a6

Please sign in to comment.