Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Jan 18, 2024
1 parent 41e1ce1 commit ef748d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/python_testing/TC_AccessChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ class AccessTestType(Enum):
WRITE = auto()


def is_global(id: int) -> bool:
return id >= 0xF000 and id <= 0xFFFE


def operation_allowed(spec_requires: Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum,
acl_set_to: Optional[Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum]) -> bool:
''' Determines if the action is allowed on the device based on the spec_requirements and the current ACL privilege granted.
Expand Down Expand Up @@ -185,6 +181,11 @@ async def _run_write_access_test_for_cluster_privilege(self, endpoint_id, cluste
problem=f"Unexpected error writing attribute - expected Unsupported Access, got {resp[0].Status}")
self.success = False

if resp[0].Status == Status.Success and isinstance(val, list):
# Reset the value to the original if we managed to write an empty list
val = wildcard_read.attributes[endpoint_id][cluster_class][attribute]
await self.TH2.WriteAttribute(nodeid=self.dut_node_id, attributes=[(endpoint_id, attribute(val))])

async def run_access_test(self, test_type: AccessTestType):
# Read all the attributes on TH2 using admin access
if test_type == AccessTestType.WRITE:
Expand Down

0 comments on commit ef748d7

Please sign in to comment.