-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Test] Creating TC_CADMIN_1_22 and TC_CADMIN_1_24 python test modules #35632
base: master
Are you sure you want to change the base?
[Test] Creating TC_CADMIN_1_22 and TC_CADMIN_1_24 python test modules #35632
Conversation
j-ororke
commented
Sep 17, 2024
•
edited
Loading
edited
- Created CADMIN_1_22 python test module following steps in PR here: TC_CADMIN_1_22
- Created CADMIN_1_24 python test module following steps in PR here: TC_CADMIN_1_24
- Removed following yaml test modules:
-
- Test_TC_CADMIN_1_21.yaml, Test_TC_CADMIN_1_22.yaml, Test_TC_CADMIN_1_23.yaml, Test_TC_CADMIN_1_24.yaml
- Created CADMIN_1_22 python test module following steps in PR here: - Created CADMIN_1_24 python test module following steps in PR here: - Removed following yaml test modules: -- Test_TC_CADMIN_1_21.yaml, Test_TC_CADMIN_1_22.yaml, Test_TC_CADMIN_1_23.yaml, Test_TC_CADMIN_1_24.yaml
Changed Files
|
PR #35632: Size comparison from 31894f6 to e244d98 Full report (11 builds for nxp, qpg, stm32, tizen)
|
- Resolved linting issues
PR #35632: Size comparison from 31894f6 to c8a2509 Full report (82 builds for bl602, bl702, bl702l, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
- Merged TC_CADMIN_1_24 and TC_CADMIN_1_22 standalone test modules into a single test module - Found enum for window closed value and replaced it in the tests - Removed generate_unique_value and AttemptCommission functions - Updated CI arguments format to YAML'esque format
- Renamed class to TC_CADMIN_1_22_24
- Resolving lint errors
PR #35632: Size comparison from 0a0e9ce to 979df75 Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #35632: Size comparison from af3727b to 252d55f Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Updated to include dependency location change for matter_testing support module
PR #35632: Size comparison from 1f4e81e to 9259c24 Full report (67 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
- Resolved issues with CI args in TC_CADMIN_1_22_24 test module - Removed yaml calls for 1_21, 1_22, 1_23, and 1_24, also removed yaml call for 1_9 from manualTests.json
PR #35632: Size comparison from 1f4e81e to fd13214 Full report (67 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
|
||
except Exception as e: | ||
logging.exception('Error running OpenCommissioningWindow %s', e) | ||
asserts.assert_true(False, 'Failed to open commissioning window') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asserts.assert_true(False, 'Failed to open commissioning window') | |
asserts.fail('Failed to open commissioning window') |
if window_status != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen: | ||
asserts.fail("Commissioning window is expected to be closed, but was found to be open") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right code
if window_status != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen: | |
asserts.fail("Commissioning window is expected to be closed, but was found to be open") | |
asserts.assert_equal(window_status, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen, "Commissioning window is expected to be closed, but was found to be open") |
|
||
self.step(6) | ||
window_status2 = await self.get_window_status() | ||
if window_status2 != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here, just do asserts.assert_equal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, that did make the code much cleaner
|
||
self.step(4) | ||
window_status = await self.get_window_status() | ||
if window_status != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I have updated this here now.
|
||
self.step(6) | ||
window_status2 = await self.get_window_status() | ||
if window_status2 != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
except ChipStackError as e: | ||
# Since we provided 901 seconds as the timeout duration, | ||
# we should not be able to open comm window as duration is too long. | ||
asserts.assert_equal(e.err, 0x00000585, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better readability I would suggest you do something like _FAILURE_ERROR_CODE = 0x00000585
where _FAILURE_ERROR_CODE
is a descriptive name about the errors like INVALID_TIMEOUT_ARGUMENT_ERROR, or whatever 0x00000585 means so that someone else can more easily see the error that you are expecting here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you,
That is a very good point, I have updated the comments to make those show what the error code is referring to
nodeid=self.dut_node_id, timeout=179, iteration=10000, discriminator=self.discriminator, option=1) | ||
|
||
except ChipStackError as e: | ||
# Since we provided 901 seconds as the timeout duration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems like copy paste and should say 179
except ChipStackError as e: | ||
# Since we provided 901 seconds as the timeout duration, | ||
# we should not be able to open comm window as duration is too long. | ||
asserts.assert_equal(e.err, 0x00000585, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again if you could update this to be more readable that would be great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I have updated the comments to be a bit cleaner here now
await self.th1.OpenCommissioningWindow( | ||
nodeid=self.dut_node_id, timeout=180, iteration=10000, discriminator=self.discriminator, option=1) | ||
|
||
self.step(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step 3 for TC_CADMIN_1_24 in https://github.com/CHIP-Specifications/chip-test-plans/pull/4673/ says to wait 181 seconds for this to expire. It doesn't say to issue a revoke command. Should the testplan be updated or should you be waiting 181s?
- Resolving comments from tehampson as these were needed changes to be made -- Substituted to using cleaner code for assert.asserts_equal instead of just assert.failure -- Resolving copy paste error in TC_CADMIN_1_4 test -- Made comments cleaner by rewording to include what the error code was referring too