-
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
TC-TCTL-2.3 python test #36703
base: master
Are you sure you want to change the base?
TC-TCTL-2.3 python test #36703
Conversation
Changed Files
|
PR #36703: Size comparison from 2bc3251 to 71708d1 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
] | ||
return steps | ||
|
||
@async_test_body |
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 is correct as of today, but it's something we want to change. The ability to change this is going to be dependent on this PR landing #36727. So nothing to do right now, but either a follow up or something that can be addressed in this PR if the other PR lands before you can undraft.
Right now, the purpose of the pics_ function above is to allow the test harness to select the tests used for certification. This is not used at all in CI, and the CI works because we know the all-clusters-app happens to have this feature enabled.
The PICS come from an external file (actually set of files) that describe what's on the device at a certain endpoint. The PICS in this test say that there is a temperature control server on the endpoint (TCTL.S) and the temperature control server supports feature 1 (TCTL.S.F01). Both of these are things that we can read directly from the device - we don't need to be going out to an external file for this information, and it's preferable not to since that's more error prone (file might be incorrect, incorrect file might have been loaded, maybe no file was supplied etc.)
We recently started testing with self-selecting test. We have a set of decorators that will only run the test if certain conditions hold. However, as noted in this PR description (#36727), we still need to keep this top level pics_ method for the test harness because even just starting tests from the test harness is slow.
So, once that PR lands, I'm going to suggest changing @async_test_body to
@run_if_endpoint_matches(has_feature(Clusters.TemperatureControl, Clusters.TemperatureControl.Bitmaps.Feature.kTemperatureLevel))
That will allow the automation that GD is writing to automatically select this test based on the device composition.
TL;DR - nothing to do now, if that PR lands before this goes in, let's update
|
||
# Step 2: Read SelectedTemperatureLevel attribute | ||
self.step(2) | ||
if self.check_pics("TCTL.S.A0004"): # SelectedTemperatureLevel attribute |
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.
Similar to above, this PICS just indicates whether a attribute 4 is supported on this cluster / endpoint and that information is available from the device. Getting this information directly from the device rather than from the PICS file is less error prone.
I've asked one of the CSA folks working on test automation to add in a guard function to just read this from the device. In other tests, we've done this by reading the attribute list directly in the test, but since we do this a lot it makes sense to centralize this. The PR to add that is here: #34290.
As above, if that PR happens to land before this gets undrafted and goes for review, it makes sense to switch over to use that, otherwise it can be done as a followup.
the change here would be something like
if attribute_guard(Clusters.TemperatureControl.Attributes.SelectedTemperatureLevel):
also below.
src/python_testing/TC_TCTL_2_3.py
Outdated
# Step 2: Read SelectedTemperatureLevel attribute | ||
self.step(2) | ||
if self.check_pics("TCTL.S.A0004"): # SelectedTemperatureLevel attribute | ||
selected_temp = await self.default_controller.ReadAttribute( |
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.
please switch to use self.read_single_attribute_check_success. That function has some nice defaults - you don't need to indicate the controller or node, and it will set the endpoint properly. Right now, the endpoint is hard coded to 1, which works for the CI, but isn't guaranteed to work for all devices since this cluster can appear on any endpoint.
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.
Makes sense! Switched to self.read_single_attribute_check_success
…ttribute_check_success()
PR #36703: Size comparison from 2bc3251 to cb1fdfc Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36703: Size comparison from af8d173 to 5777abd Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Category:
Functional
Description:
Verifies that the DUT can respond to Temperature Control Cluster attribute read commands. This test case is required only if the TL feature is supported (TCTL.S.F01(TL)). Some check examples:
Test plan for more details: https://github.com/CHIP-Specifications/chip-test-plans/blob/master/src/cluster/temperaturecontrol.adoc#tc-tctl-2-3-optional-temperature-level-attributes-with-dut_server