-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Software Update base class #41145
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
base: master
Are you sure you want to change the base?
Software Update base class #41145
Conversation
PR #41145: Size comparison from f8ebf92 to eea2150 Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41145 +/- ##
==========================================
+ Coverage 50.94% 51.01% +0.07%
==========================================
Files 1378 1386 +8
Lines 100728 100982 +254
Branches 13065 13078 +13
==========================================
+ Hits 51318 51520 +202
- Misses 49410 49462 +52 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR #41145: Size comparison from f8ebf92 to 964ea15 Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
PR #41145: Size comparison from b00714d to 53be1b2 Full report (6 builds for cc32xx, nrfconnect, realtek, stm32)
|
PR #41145: Size comparison from b00714d to 83efdaa Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
PR #41145: Size comparison from b00714d to 0cf840f Full report (22 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32)
|
PR #41145: Size comparison from b00714d to bae956e Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Remove |
…omated at test_metadata.yaml
PR #41145: Size comparison from b00714d to 7640603 Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
PR #41145: Size comparison from 9b969f5 to 22f0ed5 Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
PR #41145: Size comparison from 5ca0aad to 12cd003 Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
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.
ACLHandler
has repeated code
src/python_testing/TC_SUTestBase.py
Outdated
""" | ||
|
||
ota_image = "" | ||
if environ.get(f"SU_OTA_REQUESTOR_V{version}") is not None: |
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.
let's take advantage of test arguments instead of environment variables
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.
Noted, currently working on that and all env variables with be replaced with arguments.
) | ||
|
||
|
||
class ACLHandler: |
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.
why do you need this class? you have the create_acl_entry
method already
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.
Needed for SU 2.2
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.
base class already has that method create_acl_entry
, I am not sure that we need to write ACL on the requstor
src/python_testing/matter_testing_infrastructure/matter/testing/apps.py
Outdated
Show resolved
Hide resolved
|
||
def create_acl_entry(self, dev_ctrl: ChipDeviceController, provider_node_id: int, requestor_node_id: Optional[int] = None): | ||
"""Create ACL entries to allow OTA requestors to access the provider. | ||
def read_from_logs(self, pattern: str, before: int = 4, after: int = 4) -> list[dict]: |
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.
why do you need this method? there is existing functionality to match the logs
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.
Used at SU 2.5. Need to ensure a line of text was only added once in the logs, after some events passed. So in this case is needed to know if the logs contains an specific line at the moment to read. In the other case we need to create an event an listen when a line appears in the logs but that adds complexity because need to work with the other events im already listening
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 would say that working with the logs adds more complexity and it is a potential place for test flakiness, I would assume working with events is more reliable than working with logs
… paths. ota-image path and chip-ota-provider path will be provider to the test as an argument, Removed static versions version should be provided in the test as argument.
PR #41145: Size comparison from 5ca0aad to eb91ca3 Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
src/python_testing/TC_SUTestBase.py
Outdated
reason: Clusters.OtaSoftwareUpdateRequestor.Enums.AnnouncementReasonEnum = Clusters.OtaSoftwareUpdateRequestor.Enums.AnnouncementReasonEnum.kUpdateAvailable, | ||
vendor_id: int = 0xFFF1, | ||
endpoint: int = 0): | ||
"""Announce the OTA provider that a software update is requested. |
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.
nit: I would emphasize in the docstring that this operation happens on the requestor
|
||
if acl_entries is None: | ||
# If there are not ACL entries using proper struct constructors create the default. | ||
acl_entries = [ |
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.
nit: probably it is worth to put it as a constant in the top of the class: DEFAULT_ACL_ENTRIES
PR #41145: Size comparison from 5ca0aad to d9262fb Increases above 0.2%:
Full report (34 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
|
PR #41145: Size comparison from 5ca0aad to 22ad776 Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
PR #41145: Size comparison from 5ca0aad to df18e3d Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Summary
This PR contains the Proposal for the Software Update Base Class. This class will contain all the methods that are repeated across all the SU Test cases so we can improve the readability.
Related issues
Fixes: project-chip/matter-test-scripts#702
Testing
Integrate these changes into you branch and confirm you can use them. If not please propose new changes.
What should we add.
How to use the SU_BaseClass.
import the class
from TC_SUTestBase import SoftwareUpdateBaseTest
In the class that will execute the test instead of extend from
MatterBaseTest
extend fromSoftwareUpdateBaseTest
.To run the provider we need to provide some arguments to the test for example and start the provider using the method:
self.start_provider(
This method requiere at least to mandatory arguments:
The best way to add the provider app image is as an argument from the test as follow:
--string-arg provider_app_path: <path of the provider app image>
You can also provide the image path as argument in the test:
--string-arg ota_image:<ota_image_path>
In most of our test cases we will use only ota-image:
In the cases you need to use more than one ota image you need to manage them using arguments.
--string-arg: ota_image_step2:<ota_image_path>
--string-arg: ota_image_step3:<ota_image_path>
The same as expected version:
Expected version should be pass as an argument so the version is not attached to the code.
--int-arg: ota_image_step2_expected_version:3
--int-arg: ota_image_step3_expected_version:4
Full command example: