Skip to content

Conversation

@jtrejoespinoza-grid
Copy link
Contributor

@jtrejoespinoza-grid jtrejoespinoza-grid commented Aug 19, 2025

Summary

This PR contains the test case TC_SU_2.7 which verify the events during the software update.
This scripts closes and open the provider_app and the requestor_app as needed this is required because different configuration for both apps is required.

This script also requires different ota_versions ( 2 -4 ) in order to run properly as the updates are completed.

Related issues

#Fixes project-chip/matter-test-scripts#657

Testing

Terminal 1

/out/debug/chip-ota-requestor-app --discriminator 123 --passcode 2123 --secured-device-port 5540  --KVS /tmp/chip_kvs_requestor --autoApplyImage       

Terminal 2:

python3 src/python_testing/TC_SU_2_7.py --commissioning-method on-network --passcode 2123 --discriminator 123 --endpoint 0 --nodeId 123

@github-actions github-actions bot added the tests label Aug 19, 2025
@jtrejoespinoza-grid jtrejoespinoza-grid changed the title TC Software update verity events during update TC Software update verify events during update Aug 22, 2025
@jtrejoespinoza-grid jtrejoespinoza-grid changed the title TC Software update verify events during update TC Software Update 2.7 Cerify events during update Aug 22, 2025
@jtrejoespinoza-grid
Copy link
Contributor Author

Progress update:

Completed:

  • Commissioning
  • ACLs
  • Announcement
  • Event Discovery

Worked in several apps configuration that allows how to trigger events for idle, applying and consent.

Example for user consent

./out/debug/chip-ota-requestor-app --discriminator 123 --passcode 2123 --secured-device-port 5540  --KVS /tmp/chip_kvs_requestor --userConsentNeeded
./out/debug/chip-ota-provider-app --filepath firmware_requestor_v2.min.ota --discriminator 321  --secured-device-port 5541  --passcode 2321  -u deferred -c

Example for Delayed

/out/debug/chip-ota-provider-app --filepath firmware_requestor_v2.min.ota --discriminator 321   --passcode 2321  --delayedQueryActionTimeSec 60 --queryImageStatus busy

./out/debug/chip-ota-requestor-app --discriminator 123 --passcode 2123 --secured-device-port 5540  --KVS /tmp/chip_kvs_requestor 

Events still missing to trigger

  • DownLoadEvent error
  • StateTransitionEvent -> kDelayedOnApply

Overal actions missing:

  • How to trigger a download error.

  • Verify how to trigger delayed on apply using the Linux app flags.

  • I need to add a method to clean up commissioning and re-commission devices on runtime (both apps) this is needed because is needed to run the apps with different parameters that allow me to catch the expected events.

@github-actions github-actions bot added the app label Aug 22, 2025
@github-actions
Copy link

github-actions bot commented Aug 22, 2025

PR #40656: Size comparison from f1631b6 to 2c9d8f7

Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section f1631b6 2c9d8f7 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1105874 1105874 0 0.0
RAM 179018 179018 0 0.0
bl702 lighting-app bl702+eth FLASH 659208 659208 0 0.0
RAM 135025 135025 0 0.0
bl702+wifi FLASH 836380 836380 0 0.0
RAM 124509 124509 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068388 1068388 0 0.0
RAM 117349 117349 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 897826 897826 0 0.0
RAM 105660 105660 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981540 981540 0 0.0
RAM 109844 109844 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768324 768324 0 0.0
RAM 103392 103392 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779944 779944 0 0.0
RAM 108560 108560 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725548 725548 0 0.0
RAM 96932 96932 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 710024 710024 0 0.0
RAM 97140 97140 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552246 552246 0 0.0
RAM 205120 205120 0 0.0
lock CC3235SF_LAUNCHXL FLASH 584562 584562 0 0.0
RAM 205352 205352 0 0.0
efr32 lock-app BRD4187C FLASH 959824 959824 0 0.0
RAM 126408 126408 0 0.0
BRD4338a FLASH 755272 755264 -8 -0.0
RAM 255732 255732 0 0.0
window-app BRD4187C FLASH 1053940 1053940 0 0.0
RAM 122604 122604 0 0.0
esp32 all-clusters-app c3devkit DRAM 102536 102536 0 0.0
FLASH 1769494 1769494 0 0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121388 121388 0 0.0
FLASH 1716750 1716750 0 0.0
IRAM 117051 117051 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 912220 912220 0 0.0
RAM 152898 152898 0 0.0
nxp contact mcxw71+release FLASH 632472 632472 0 0.0
RAM 64124 64124 0 0.0
lock mcxw71+release FLASH 742264 742264 0 0.0
RAM 65200 65200 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661588 1661588 0 0.0
RAM 211216 211216 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1582916 1582916 0 0.0
RAM 208480 208480 0 0.0
light cy8ckit_062s2_43012 FLASH 1453876 1453876 0 0.0
RAM 197200 197200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1486204 1486204 0 0.0
RAM 224920 224920 0 0.0
qpg lighting-app qpg6200+debug FLASH 820984 820984 0 0.0
RAM 127644 127644 0 0.0
lock-app qpg6200+debug FLASH 758316 758316 0 0.0
RAM 118604 118604 0 0.0
realtek light-switch-app rtl8777g FLASH 704040 704040 0 0.0
RAM 106676 106676 0 0.0
lighting-app rtl8777g FLASH 755624 755624 0 0.0
RAM 127056 127056 0 0.0
stm32 light STM32WB5MM-DK FLASH 468060 468060 0 0.0
RAM 141400 141400 0 0.0
telink bridge-app tl7218x FLASH 709988 709988 0 0.0
RAM 93472 93472 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798900 798900 0 0.0
RAM 44032 44032 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 790114 790114 0 0.0
RAM 100776 100776 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716272 716272 0 0.0
RAM 54260 54260 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749628 749628 0 0.0
RAM 77408 77408 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726418 726418 0 0.0
RAM 37008 37008 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606406 606406 0 0.0
RAM 112584 112584 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822834 822838 4 0.0
RAM 99172 99172 0 0.0

@codecov
Copy link

codecov bot commented Aug 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.81%. Comparing base (cb1b16f) to head (bedf5b4).
⚠️ Report is 246 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #40656      +/-   ##
==========================================
+ Coverage   50.78%   50.81%   +0.03%     
==========================================
  Files        1358     1364       +6     
  Lines       99515   100190     +675     
  Branches    12882    13011     +129     
==========================================
+ Hits        50537    50913     +376     
- Misses      48978    49277     +299     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…rom SU 2.7 Steps 1 - 2 work continuously. Steps 3 need to fix issue of the state recorded by the requestor that will needed for following steps.
@jtrejoespinoza-grid jtrejoespinoza-grid changed the title TC Software Update 2.7 Cerify events during update TC Software Update 2.7 Verify events during update Aug 27, 2025
@jtrejoespinoza-grid jtrejoespinoza-grid marked this pull request as ready for review September 8, 2025 19:21
asserts.assert_equal(event_report.newState, self.ota_req.Enums.UpdateStateEnum.kQuerying)
event_report = state_transition_event_handler.wait_for_event_report(self.ota_req.Events.StateTransition, timeout_sec=60*5)
logger.info(f"Event response : {event_report}")
self._verify_event_transition_status(event_report, previous_state=self.ota_req.Enums.UpdateStateEnum.kQuerying,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This verifies a transition from Querying -> Idle.
According to Matters_V_1_4_TestPlanVerification, the expected transition should be from Downloading (state 4) -> Idle (state 1). The approach should be killing the OTA Provider app before issuing the QueryImage.
Wondering if there is a way to simulate the same condition to be aligned with the test, or if the expected flow has changed?

Copy link
Contributor

@juandediosg juandediosg Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up: After re-checking, the expected transition Downloading -> Idle transition can't be validated right now due to the known limitation (OTA: Provider cannot gracefully cancel a BDX transfer during OTA update #685):

  • If the Provider is killed mid-BDX transfer, the Requestor stays stuck in Downloading and won’t return to Idle until the 6-hour timeout.
  • This is caused by the current implementation where there's no graceful way to cancel BDX (the Requestor needs a StatusReport from the Provider, which can't be sent once it's killed).

Current approach Querying -> Idle is a reasonable workaround given the known issue, but I suggest checking with client whether this step should be skipped until the bug is resolved, or kept as is.

asserts.assert_equal(event_report.newState, self.ota_req.Enums.UpdateStateEnum.kDownloading)
# Wait some time to let it download some data and then Kill the current process and remove kvs files
logger.info("Wait 10 seconds to allow download some data")
sleep(10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that sleep is used instead of await asyncio.sleep throughout the test. Is there a specific reason?


def __init__(self, app: str, storage_dir: str, discriminator: int,
passcode: int, ota_source: Union[OtaImagePath, ImageListPath],
port: int = 5541, extra_args: list[str] = [], f_stdout: BinaryIO = stdout.buffer, f_stderr: BinaryIO = stdout.buffer):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just thinking, maybe we can avoid signature duplicating defaults already defined in AppServerSubprocess, by passing **kwargs? This way child class pass arguments up to the parent without re-defining defaults that are already set there.

@mergify mergify bot removed the conflict label Oct 6, 2025
@github-actions
Copy link

github-actions bot commented Oct 6, 2025

PR #40656: Size comparison from b0f2fa3 to df7189b

Full report (3 builds for realtek, stm32)
platform target config section b0f2fa3 df7189b change % change
realtek light-switch-app rtl8777g FLASH 705184 705184 0 0.0
RAM 106756 106756 0 0.0
lighting-app rtl8777g FLASH 756376 756376 0 0.0
RAM 127120 127120 0 0.0
stm32 light STM32WB5MM-DK FLASH 468884 468884 0 0.0
RAM 141192 141192 0 0.0

@github-actions
Copy link

github-actions bot commented Oct 10, 2025

PR #40656: Size comparison from 876fcf5 to 8312097

Full report (5 builds for cc32xx, realtek, stm32)
platform target config section 876fcf5 8312097 change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 554154 554154 0 0.0
RAM 204984 204984 0 0.0
lock CC3235SF_LAUNCHXL FLASH 586870 586870 0 0.0
RAM 205208 205208 0 0.0
realtek light-switch-app rtl8777g FLASH 705368 705368 0 0.0
RAM 106784 106784 0 0.0
lighting-app rtl8777g FLASH 756568 756568 0 0.0
RAM 127132 127132 0 0.0
stm32 light STM32WB5MM-DK FLASH 469068 469068 0 0.0
RAM 141208 141208 0 0.0

@github-actions
Copy link

PR #40656: Size comparison from 876fcf5 to a108d35

Full report (3 builds for realtek, stm32)
platform target config section 876fcf5 a108d35 change % change
realtek light-switch-app rtl8777g FLASH 705368 705368 0 0.0
RAM 106784 106784 0 0.0
lighting-app rtl8777g FLASH 756568 756568 0 0.0
RAM 127132 127132 0 0.0
stm32 light STM32WB5MM-DK FLASH 469068 469068 0 0.0
RAM 141208 141208 0 0.0

@github-actions
Copy link

PR #40656: Size comparison from c87ece5 to 1b4cf74

Full report (1 build for stm32)
platform target config section c87ece5 1b4cf74 change % change
stm32 light STM32WB5MM-DK FLASH 469772 469772 0 0.0
RAM 141248 141248 0 0.0

@mergify mergify bot added the conflict label Oct 29, 2025
@mergify mergify bot removed the conflict label Nov 5, 2025
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

PR #40656: Size comparison from 2c0b7fc to 00e8549

Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 2c0b7fc 00e8549 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106262 1106262 0 0.0
RAM 178914 178914 0 0.0
bl702 lighting-app bl702+eth FLASH 661392 661392 0 0.0
RAM 135017 135017 0 0.0
bl702+wifi FLASH 836934 836934 0 0.0
RAM 124437 124437 0 0.0
bl706+mfd+rpc+littlefs FLASH 1070472 1070472 0 0.0
RAM 117293 117293 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 899904 899904 0 0.0
RAM 105572 105572 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 983218 983218 0 0.0
RAM 109772 109772 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 770616 770616 0 0.0
RAM 103344 103344 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 782452 782452 0 0.0
RAM 108512 108512 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 728384 728384 0 0.0
RAM 97404 97404 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 712860 712860 0 0.0
RAM 97620 97620 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 554894 554894 0 0.0
RAM 205776 205776 0 0.0
lock CC3235SF_LAUNCHXL FLASH 587774 587774 0 0.0
RAM 205872 205872 0 0.0
efr32 lock-app BRD4187C FLASH 963296 963296 0 0.0
RAM 123544 123544 0 0.0
BRD4338a FLASH 757480 757480 0 0.0
RAM 254184 254184 0 0.0
window-app BRD4187C FLASH 1058532 1058532 0 0.0
RAM 119772 119772 0 0.0
esp32 all-clusters-app c3devkit DRAM 102556 102556 0 0.0
FLASH 1836588 1836588 0 0.0
IRAM 93540 93540 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 933240 933240 0 0.0
RAM 161361 161361 0 0.0
nxp contact mcxw71+release FLASH 692208 692208 0 0.0
RAM 61536 61536 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1677828 1677828 0 0.0
RAM 213940 213940 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1594220 1594220 0 0.0
RAM 211148 211148 0 0.0
light cy8ckit_062s2_43012 FLASH 1460460 1460460 0 0.0
RAM 197768 197768 0 0.0
lock cy8ckit_062s2_43012 FLASH 1493140 1493140 0 0.0
RAM 225480 225480 0 0.0
qpg lighting-app qpg6200+debug FLASH 837544 837544 0 0.0
RAM 127748 127748 0 0.0
lock-app qpg6200+debug FLASH 774356 774356 0 0.0
RAM 118724 118724 0 0.0
realtek light-switch-app rtl8777g FLASH 706728 706728 0 0.0
RAM 106952 106952 0 0.0
lighting-app rtl8777g FLASH 757672 757672 0 0.0
RAM 127284 127284 0 0.0
stm32 light STM32WB5MM-DK FLASH 470056 470056 0 0.0
RAM 141344 141344 0 0.0
telink bridge-app tl7218x FLASH 710586 710586 0 0.0
RAM 90584 90584 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797060 797060 0 0.0
RAM 41008 41008 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 788262 788262 0 0.0
RAM 93684 93684 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 715264 715264 0 0.0
RAM 51876 51876 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748560 748560 0 0.0
RAM 70916 70916 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725414 725414 0 0.0
RAM 34608 34608 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 602692 602692 0 0.0
RAM 108912 108912 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 820896 820900 4 0.0
RAM 92080 92080 0 0.0

…ine in run_python_test to kill the previous app before start to avoid port collision issues.
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

PR #40656: Size comparison from 2c0b7fc to 58a5f61

Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 2c0b7fc 58a5f61 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106262 1106380 118 0.0
RAM 178914 178930 16 0.0
bl702 lighting-app bl702+eth FLASH 661392 661414 22 0.0
RAM 135017 135025 8 0.0
bl702+wifi FLASH 836934 837048 114 0.0
RAM 124437 124445 8 0.0
bl706+mfd+rpc+littlefs FLASH 1070472 1070586 114 0.0
RAM 117293 117317 24 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 899904 900018 114 0.0
RAM 105572 105612 40 0.0
lighting-app bl702l+mfd+littlefs FLASH 983218 983332 114 0.0
RAM 109772 109796 24 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 770616 770812 196 0.0
RAM 103344 103360 16 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 782452 782640 188 0.0
RAM 108512 108528 16 0.0
pump-app LP_EM_CC1354P10_6 FLASH 728384 728588 204 0.0
RAM 97404 97420 16 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 712860 713056 196 0.0
RAM 97620 97636 16 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 554894 554906 12 0.0
RAM 205776 205776 0 0.0
lock CC3235SF_LAUNCHXL FLASH 587774 587786 12 0.0
RAM 205872 205872 0 0.0
efr32 lock-app BRD4187C FLASH 963296 963472 176 0.0
RAM 123544 123572 28 0.0
BRD4338a FLASH 757480 757808 328 0.0
RAM 254184 254196 12 0.0
window-app BRD4187C FLASH 1058532 1058828 296 0.0
RAM 119772 119800 28 0.0
esp32 all-clusters-app c3devkit DRAM 102556 102572 16 0.0
FLASH 1836588 1836750 162 0.0
IRAM 93540 93540 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 933240 933432 192 0.0
RAM 161361 161377 16 0.0
nxp contact mcxw71+release FLASH 692208 692520 312 0.0
RAM 61536 61552 16 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1677828 1678164 336 0.0
RAM 213940 213956 16 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1594220 1594548 328 0.0
RAM 211148 211156 8 0.0
light cy8ckit_062s2_43012 FLASH 1460460 1460772 312 0.0
RAM 197768 197776 8 0.0
lock cy8ckit_062s2_43012 FLASH 1493140 1493460 320 0.0
RAM 225480 225496 16 0.0
qpg lighting-app qpg6200+debug FLASH 837544 837744 200 0.0
RAM 127748 127768 20 0.0
lock-app qpg6200+debug FLASH 774356 774572 216 0.0
RAM 118724 118736 12 0.0
realtek light-switch-app rtl8777g FLASH 706728 706928 200 0.0
RAM 106952 106964 12 0.0
lighting-app rtl8777g FLASH 757672 757864 192 0.0
RAM 127284 127296 12 0.0
stm32 light STM32WB5MM-DK FLASH 470056 470256 200 0.0
RAM 141344 141352 8 0.0
telink bridge-app tl7218x FLASH 710586 710646 60 0.0
RAM 90584 90600 16 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797060 797120 60 0.0
RAM 41008 41024 16 0.0
light-app-ota-shell-factory-data tl7218x FLASH 788262 788322 60 0.0
RAM 93684 93700 16 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 715264 715324 60 0.0
RAM 51876 51892 16 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748560 748620 60 0.0
RAM 70916 70932 16 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725414 725474 60 0.0
RAM 34608 34624 16 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 602692 602752 60 0.0
RAM 108912 108928 16 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 820896 820960 64 0.0
RAM 92080 92096 16 0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TC-SU-2.7: Consider testing in other tests

4 participants