Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect initializing of CATs in matter python tests #22114

Closed
mrjerryjohns opened this issue Aug 23, 2022 · 3 comments
Closed

Fix incorrect initializing of CATs in matter python tests #22114

mrjerryjohns opened this issue Aug 23, 2022 · 3 comments

Comments

@mrjerryjohns
Copy link
Contributor

Problem

With the exception of TC_RR_1_1.py that passes a specific value for controller_cat_tags to default_matter_test_main, the others don't.

This results in MatterTestConfig.controller_cat_tags having a default value of None. This gets passed into FabricAdmin.NewController, which requires the list be non-None in value, and have an empty list if there are no CAT tags specified.

That causes this execution assertion:

WARNING:FabricAdmin:Allocating new controller with CaIndex: 1, FabricId: 0x0000000000000001, NodeId: 0x000000000001B669, CatTags: None
Traceback (most recent call last):
  File "/Users/johnsj/work/devel/ext-git/connectedhomeip-2/src/python_testing/TC_SC_3_6.py", line 249, in <module>
    default_matter_test_main()
  File "/Users/johnsj/work/devel/ext-git/connectedhomeip-2/src/python_testing/matter_testing_support.py", line 716, in default_matter_test_main
    default_controller = stack.certificate_authorities[0].adminList[0].NewController(nodeId=matter_test_config.controller_node_id,
  File "/Users/johnsj/work/devel/ext-git/connectedhomeip-2/.environment/pigweed-venv/lib/python3.9/site-packages/chip/FabricAdmin.py", line 107, in NewController
    controller = ChipDeviceCtrl.ChipDeviceController(opCredsContext=self._certificateAuthority.GetOpCredsContext(), fabricId=self._fabricId, nodeId=nodeId,
  File "/Users/johnsj/work/devel/ext-git/connectedhomeip-2/.environment/pigweed-venv/lib/python3.9/site-packages/chip/ChipDeviceCtrl.py", line 172, in __init__
    c_catTags = (c_uint32 * len(catTags))()
TypeError: object of type 'NoneType' has no len()
Exception ignored in: <function ChipDeviceController.__del__ at 0x10cb8e040>
Traceback (most recent call last):
  File "/Users/johnsj/work/devel/ext-git/connectedhomeip-2/.environment/pigweed-venv/lib/python3.9/site-packages/chip/ChipDeviceCtrl.py", line 323, in __del__
    self.Shutdown()
  File "/Users/johnsj/work/devel/ext-git/connectedhomeip-2/.environment/pigweed-venv/lib/python3.9/site-packages/chip/ChipDeviceCtrl.py", line 287, in Shutdown
    if (self._isActive):
AttributeError: 'ChipDeviceController' object has no attribute '_isActive'
@mrjerryjohns
Copy link
Contributor Author

Justification for 1.0 inclusion:

  • Platform change.
  • Fixes certification tests.

@mrjerryjohns mrjerryjohns self-assigned this Aug 23, 2022
mrjerryjohns added a commit to mrjerryjohns/connectedhomeip that referenced this issue Aug 23, 2022
This fixes the default initialization of the `controller_cat_tags` field
in `MatterTestingSupport` class to correctly be initialized to an empty
list, since that is what is expected by FabricAdmin.NewController (and
others).

Testing:

Repro'ed the failure described in project-chip#22114, and then confirmed this fixes
it.
@andy31415 andy31415 added the p1 priority 1 work label Aug 24, 2022
@andy31415
Copy link
Contributor

V1 review: acceptable to have changes for this in master for v1, since it blocks/affects cert.

@andy31415 andy31415 added v1.0 master patch acceptable and removed p1 priority 1 work labels Aug 24, 2022
woody-apple pushed a commit that referenced this issue Aug 25, 2022
…22116)

This fixes the default initialization of the `controller_cat_tags` field
in `MatterTestingSupport` class to correctly be initialized to an empty
list, since that is what is expected by FabricAdmin.NewController (and
others).

Testing:

Repro'ed the failure described in #22114, and then confirmed this fixes
it.
@andy31415
Copy link
Contributor

Seems fixed by #22116. Closing.

isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this issue Sep 16, 2022
…roject-chip#22116)

This fixes the default initialization of the `controller_cat_tags` field
in `MatterTestingSupport` class to correctly be initialized to an empty
list, since that is what is expected by FabricAdmin.NewController (and
others).

Testing:

Repro'ed the failure described in project-chip#22114, and then confirmed this fixes
it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants