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

chip-tool Support Needed for Generating invalid QR/manual codes #16385

Closed
liamgonyea opened this issue Mar 17, 2022 · 4 comments · Fixed by #16704
Closed

chip-tool Support Needed for Generating invalid QR/manual codes #16385

liamgonyea opened this issue Mar 17, 2022 · 4 comments · Fixed by #16704

Comments

@liamgonyea
Copy link
Contributor

liamgonyea commented Mar 17, 2022

Problem

While testing TC-DD-3.12/13, the test steps require generating invalid QR/manual codes used as an Onboarding Payload while testing negative scenarios for a DUT commissioner.
chip-tool does not currently support generating QR/manual codes for the following cases:

  1. Custom Flow bit set to 3: Reserved
    image
  2. Discovery Capability set to an invalid number (i.e. 8 or above for chip-device-ctrl)
    image
  3. Invalid Passcodes (00000000, 11111111, 22222222, 33333333, 44444444, 55555555, 66666666, 77777777, 88888888, 99999999, 12345678, 87654321) not allowed per spec:

5.1.6.1 Version master 40e3631, 2022-01-05 11:22:38 -0800: Draft)

  1. TLV data, unable to edit the data at all to make it invalid so that a DUT commissioner can scan a QR code with improper TLV data

image

image
5. Invalid VID_PID_PRESENT for manual codes6.
6.

Proposed Solution

Add support to chip-tool to generate these intentionally-invalid QR codes so that negative test-case scenarios can be properly tested.

Affected Test Cases

TE8
[TC-DD-3.12] Commissioning Flow - QR Code - Negative scenario [DUT - Commissioner]
[TC-DD-3.14] Commissioning Flow - Manual Pairing Code - Negative scenario [DUT - Commissioner]

@liamgonyea liamgonyea changed the title chip-tool Support Needed for Generating invalid QR codes chip-tool Support Needed for Generating invalid QR/manual codes Mar 17, 2022
@franck-apple
Copy link

Can't we just use a bad QR code, manually generated, to test this?

@vivien-apple
Copy link
Contributor

While the other steps are clear to me, I don't understand the one related to TLV data.
The test plan says:

  | Variable length TLV: Using the QR code from Step 1, generate a new QR code but substituting out the correct length TLV with an invalid length TLV according to the manufacturer’s specifications. (i.e. if the manufacturer specifies a TLV length=8, substitute in a TVL length=4, or any other TLV length not equal to 8) |  

but it is unclear to me that there is any short of field specifying the TLV length.
@liamgonyea Is it me not understanding properly the payload format, or is is a mistake in the test plan ?

@vivien-apple
Copy link
Contributor

I have done #16704 that should fix all the cases mentioned here, except the one about variable length TLV since it is unclear to me for now.

@liamgonyea
Copy link
Contributor Author

@vivien-apple Thank you for the changes to generate invalid onboarding payloads

Regarding the "TLV data field", this is a mistake in the test plan and is being addressed in an upcoming PR for the TC-DD test plan. There is no field to specify the TLV data length specifically, just an optional TLV data field in the payload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants