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
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'
44
+
returnTestStep(dut_num, read_trusted_roots_over_pase, "List should be empty as the DUT should be in factory reset ")
45
+
46
+
classTC_SC_5_1(MatterBaseTest):
47
+
''' TC-SC-5.1
48
+
49
+
This test requires two instances of the DUT with the same PID/VID to confirm that the individual
50
+
devices are provisioned with different discriminators and PAKE salts in the same product line.
51
+
52
+
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")]
65
+
66
+
return [_trusted_root_test_step(1),
67
+
_trusted_root_test_step(2),
68
+
TestStep(3, "TH compares the discriminators from the provided setup codes", "Discriminators do not match")]
69
+
70
+
@async_test_body
71
+
asyncdeftest_TC_SC_5_1(self):
72
+
# For now, this test is WAY easier if we just ask for the setup code instead of discriminator / passcode
73
+
asserts.assert_false(self.matter_test_config.discriminators, "This test needs to be run with either the QR or manual setup code. The QR code is preferred.")
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"
80
+
else:
81
+
msg="This test requires two devices for use at certification. Specify two device discriminators or QR codes ex. --discriminator 1234 5678"
82
+
asserts.fail(msg)
83
+
84
+
# 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.
asserts.assert_equal(root_certs, [], "Root certificates found on device. Device must be factory reset before running this test.")
90
+
91
+
self.step(len(setup_codes)+1)
92
+
setup_payload_info=self.get_setup_payload_info()
93
+
ifself.post_cert_test:
94
+
# For post-cert, we're testing against the defaults
95
+
# 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?
96
+
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 discriminators.")
101
+
asserts.assert_not_equal(setup_payload_info[0].filter_value, setup_payload_info[1].filter_value, "Devices are using the same discriminator values")
102
+
103
+
104
+
# TODO: add test for PAKE salt. This needs to be plumbed through starting from HandlePBKDFParamResponse.
105
+
# Will handle in a separate follow up as the plumbing here is aggressive and through some of the crypto layers.
asserts.assert_true(self.matter_test_config.qr_code_contentisNoneorself.matter_test_config.manual_codeisNone, "Cannot have both QR and manual code specified")
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.")
1087
-
else:
1088
-
asserts.fail("Require either --qr-code or --manual-code.")
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.")
0 commit comments