You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* TC-SC-5.1: Add test for unique discriminators
see
CHIP-Specifications/connectedhomeip-spec#9117
Test:
please see test_testing for unit tests.
* Restyled by autopep8
* Restyled by isort
* rename test to TC-SC-7.1
TC-SC-5.1 exists, it's just in a different section.
* linter
* make setup codes empty lists by default
* fix basic comp
* fix qr code in ci
* Fixup manual codes
* Restyled by autopep8
* linter
---------
Co-authored-by: Restyled.io <commits@restyled.io>
read_trusted_roots_over_pase=f'TH establishes a PASE session to DUT{dut_num} using the provided setup code and reads the TrustedRootCertificates attribute from the operational credentials cluster over PASE'
41
+
returnTestStep(dut_num, read_trusted_roots_over_pase, "List should be empty as the DUT should be in factory reset ")
42
+
43
+
44
+
classTC_SC_7_1(MatterBaseTest):
45
+
''' TC-SC-7.1
46
+
47
+
This test requires two instances of the DUT with the same PID/VID to confirm that the individual
48
+
devices are provisioned with different discriminators and PAKE salts in the same product line.
49
+
50
+
This test MUST be run on a factory reset device, over PASE, with no commissioned fabrics.
TestStep(2, "TH extracts the discriminator from the provided setup code", "Ensure the code is not the default")]
68
+
69
+
return [_trusted_root_test_step(1),
70
+
_trusted_root_test_step(2),
71
+
TestStep(3, "TH compares the discriminators from the provided setup codes", "Discriminators do not match")]
72
+
73
+
# TODO: Need a pics or something to limit this to devices that have a factory-provided matter setup code (as opposed to a field upgradable device / device with a custom commissioning where this test won't apply)
74
+
75
+
@async_test_body
76
+
asyncdeftest_TC_SC_7_1(self):
77
+
# For now, this test is WAY easier if we just ask for the setup code instead of discriminator / passcode
msg="The post_cert_test flag is only for use post-certification. When using this flag, specify a single discriminator, manual-code or qr-code-content"
84
+
else:
85
+
msg="This test requires two devices for use at certification. Specify two device discriminators or QR codes ex. --discriminator 1234 5678"
86
+
asserts.fail(msg)
87
+
88
+
# Make sure these are no fabrics on the device so we know we're looking at the factory discriminator. This also ensures that the provided codes are correct.
root_certs, [], "Root certificates found on device. Device must be factory reset before running this test.")
95
+
96
+
self.step(i+2)
97
+
setup_payload_info=self.get_setup_payload_info()
98
+
ifself.post_cert_test:
99
+
# For post-cert, we're testing against the defaults
100
+
# TODO: Does it even make sense to test against a manual code in post-cert? It's such a small space, collisions are likely. Should we restrict post-cert to QR? What if one isn't provided?
101
+
asserts.assert_not_equal(setup_payload_info[0].filter_value, 3840, "Device is using the default discriminator")
logging.warn("The two provided discriminators are the same. Note that this CAN occur by chance, especially when using manual codes with the short discriminator. Consider using a QR code, or a different device if you believe the DUTs have individually provisioned")
105
+
asserts.assert_not_equal(
106
+
setup_payload_info[0].filter_value, setup_payload_info[1].filter_value, "Devices are using the same discriminator values")
107
+
108
+
# TODO: add test for PAKE salt. This needs to be plumbed through starting from HandlePBKDFParamResponse.
109
+
# Will handle in a separate follow up as the plumbing here is aggressive and through some of the crypto layers.
f"Manual code code '{manual_code}' failed to parse properly as a Matter setup code. Check that all digits are correct and length is 11 or 21 characters.")
1085
-
else:
1086
-
asserts.fail("Require either --qr-code or --manual-code.")
0 commit comments