@@ -374,7 +374,9 @@ class MatterTestConfig:
374
374
discriminators : Optional [List [int ]] = None
375
375
setup_passcodes : Optional [List [int ]] = None
376
376
commissionee_ip_address_just_for_testing : Optional [str ] = None
377
- maximize_cert_chains : bool = False
377
+ # By default, we start with maximized cert chains, as required for RR-1.1.
378
+ # This allows cert tests to be run without re-commissioning for RR-1.1.
379
+ maximize_cert_chains : bool = True
378
380
379
381
qr_code_content : Optional [str ] = None
380
382
manual_code : Optional [str ] = None
@@ -390,7 +392,10 @@ class MatterTestConfig:
390
392
# Node ID to use for controller/commissioner
391
393
controller_node_id : int = _DEFAULT_CONTROLLER_NODE_ID
392
394
# CAT Tags for default controller/commissioner
393
- controller_cat_tags : List [int ] = field (default_factory = list )
395
+ # By default, we commission with CAT tags specified for RR-1.1
396
+ # so the cert tests can be run without re-commissioning the device
397
+ # for this one test. This can be overwritten from the command line
398
+ controller_cat_tags : List [int ] = field (default_factory = lambda : [0x0001_0001 ])
394
399
395
400
# Fabric ID which to use
396
401
fabric_id : int = 1
@@ -1416,7 +1421,7 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig:
1416
1421
return config
1417
1422
1418
1423
1419
- def parse_matter_test_args (argv : List [str ]) -> MatterTestConfig :
1424
+ def parse_matter_test_args (argv : Optional [ List [str ]] = None ) -> MatterTestConfig :
1420
1425
parser = argparse .ArgumentParser (description = 'Matter standalone Python test' )
1421
1426
1422
1427
basic_group = parser .add_argument_group (title = "Basic arguments" , description = "Overall test execution arguments" )
@@ -1613,7 +1618,7 @@ def _commission_device(self, i) -> bool:
1613
1618
raise ValueError ("Invalid commissioning method %s!" % conf .commissioning_method )
1614
1619
1615
1620
1616
- def default_matter_test_main (argv = None , ** kwargs ):
1621
+ def default_matter_test_main ():
1617
1622
"""Execute the test class in a test module.
1618
1623
This is the default entry point for running a test script file directly.
1619
1624
In this case, only one test class in a test script is allowed.
@@ -1623,26 +1628,13 @@ def default_matter_test_main(argv=None, **kwargs):
1623
1628
...
1624
1629
if __name__ == '__main__':
1625
1630
default_matter_test_main.main()
1626
- Args:
1627
- argv: A list that is then parsed as command line args. If None, defaults to sys.argv
1628
1631
"""
1629
1632
1630
- matter_test_config = parse_matter_test_args (argv )
1631
-
1632
- # Allow override of command line from optional arguments
1633
- if not matter_test_config .controller_cat_tags and "controller_cat_tags" in kwargs :
1634
- matter_test_config .controller_cat_tags = kwargs ["controller_cat_tags" ]
1633
+ matter_test_config = parse_matter_test_args ()
1635
1634
1636
1635
# Find the test class in the test script.
1637
1636
test_class = _find_test_class ()
1638
1637
1639
- # This is required in case we need any testing with maximized certificate chains.
1640
- # We need *all* issuers from the start, even for default controller, to use
1641
- # maximized chains, before MatterStackState init, others some stale certs
1642
- # may not chain properly.
1643
- if "maximize_cert_chains" in kwargs :
1644
- matter_test_config .maximize_cert_chains = kwargs ["maximize_cert_chains" ]
1645
-
1646
1638
hooks = InternalTestRunnerHooks ()
1647
1639
1648
1640
run_tests (test_class , matter_test_config , hooks )
0 commit comments