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

TC-DA-1.7: Documentation for how to test locally #26985

Merged
merged 3 commits into from
Jun 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions src/python_testing/TC_DA_1_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,40 @@ def extract_akid(cert: Certificate) -> Optional[bytes]:


class TC_DA_1_7(MatterBaseTest):
''' TC-DA-1.7

This test requires two instances of the DUT with the same PID/VID to confirm that the individual
devices are provisioned with different device attestation keys even in the same product line.

In order to fully test this locally, it requires two separate instances of the example app
with different keys, different discrimimators, different ports, and different KVSs.
The example apps use the SDK authority key, so the script needs the allow_sdk_dac arg set.

One suggested method of testing:

Terminal 1: (first DUT - default port 5540)
rm kvsa
cecille marked this conversation as resolved.
Show resolved Hide resolved
cecille marked this conversation as resolved.
Show resolved Hide resolved
<path_to_all_clusters>/chip-all-clusters-app --dac_provider \
cecille marked this conversation as resolved.
Show resolved Hide resolved
credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count1_valid/test_case_vector.json \
--product-id 32768 --KVS kvsa --discriminator 12
cecille marked this conversation as resolved.
Show resolved Hide resolved

Terminal 2: (second DUT - port 5541)
rm kvsb
cecille marked this conversation as resolved.
Show resolved Hide resolved
<path_to_all_clusters>/chip-all-clusters-app --dac_provider \
cecille marked this conversation as resolved.
Show resolved Hide resolved
cecille marked this conversation as resolved.
Show resolved Hide resolved
credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count2_valid/test_case_vector.json \
--product-id 32768 --KVS kvsb --discriminator 34 --secured-device-port 5541
cecille marked this conversation as resolved.
Show resolved Hide resolved

Terminal 3: (test application)
./scripts/tests/run_python_test.py --script "src/python_testing/TC_DA_1_7.py" \
--script-args "--storage-path admin_storage.json --commissioning-method on-network \
--discriminator 12 34 --passcode 20202021 20202021 --bool-arg allow_sdk_dac:true"
'''
@async_test_body
async def test_TC_DA_1_7(self):
# For real tests, we require more than one DUT
# On the CI, this doesn't make sense to do since all the examples use the same DAC
# To specify more than 1 DUT, use a list of discriminators and passcodes
allow_sdk_dac = self.user_params.get("allow_sdk_dac", False)
if allow_sdk_dac:
asserts.assert_equal(len(self.matter_test_config.discriminator), 1, "Only one device can be tested with SDK DAC")
if not allow_sdk_dac:
asserts.assert_equal(len(self.matter_test_config.discriminator), 2, "This test requires 2 DUTs")
pk = []
Expand Down
Loading