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

Use a valid command id in TC_IDM_1_4.py #33556

Merged
merged 2 commits into from
May 24, 2024
Merged

Conversation

Apollon77
Copy link
Contributor

@Apollon77 Apollon77 commented May 22, 2024

The test TC_IDM_1_4.py used 0xffff_ffff as test command id. In fact this is not valid MEI according to specification.

While chip seems to validate this fact later the test works.

In matter.js such datatype validations are handled earlier and thats why we throw an constraint error because the value is wrong data type wise.

I did not found any place in the specification where it is defined when such "semantic" data value checks should be done (unless some very specific error cases in some adapters).

I think this is a theoretical topic in this case because it will hopefully never happen in real live devices 8and when it does the exact error should be irrelevant) for this test it matters because the test fails.

With the change of the command ID to be a still unknown, but valid, value the issue is gone. I also think that tests should still use basically "correct" values. ;-)

Thank you for considering this change.

The test TC_IDM_1_4.py used 0xffff_ffff as test command id. In fact this is not valid MEI according to specification.

While chip seems to validate this fact later the test works.

In matter.js such datatype validations are handled earlier and thats why we throw an contraint error because the value is wrong data type wise. 

I did not found any place in the specification where it is defined when such "semantic" data value checks should be done (unless some very specific error cases in some adapters).

I think this is a theoretical topic in this case because it will hopefully never happen in real live devices 8and when it does the exact error should be irrelevant) for this test it matters because the test fails.

With the change of the command ID to be a still unknown, but valid, value the issue is gone. I also think that tests should still use basically "correct" values. ;-)

Thank you for considering this change.
Copy link

github-actions bot commented May 22, 2024

PR #33556: Size comparison from eb515e1 to 58a14b0

Decreases (1 build for efr32)
platform target config section eb515e1 58a14b0 change % change
efr32 window-app BRD4187C (read/write) 1135888 1135880 -8 -0.0
.text 967932 967924 -8 -0.0
Full report (83 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink)
platform target config section eb515e1 58a14b0 change % change
bl602 lighting-app bl602 (read/write) 1446214 1446214 0 0.0
.bss 85896 85896 0 0.0
.data 9512 9512 0 0.0
.rodata 159472 159472 0 0.0
.text 1110674 1110674 0 0.0
bl602+mfd (read/write) 1460646 1460646 0 0.0
.bss 86072 86072 0 0.0
.data 9488 9488 0 0.0
.rodata 158432 158432 0 0.0
.text 1125992 1125992 0 0.0
bl602+rpc (read/write) 1493878 1493878 0 0.0
.bss 93944 93944 0 0.0
.data 9896 9896 0 0.0
.rodata 167048 167048 0 0.0
.text 1142320 1142320 0 0.0
bl702 lighting-app bl702 (read only) 3478 3478 0 0.0
(read/write) 1212107 1212107 0 0.0
.bss 11185 11185 0 0.0
.data 3720 3720 0 0.0
.rodata 109024 109024 0 0.0
.text 981120 981120 0 0.0
bl702+mfd (read only) 3478 3478 0 0.0
(read/write) 1223195 1223195 0 0.0
.bss 11361 11361 0 0.0
.data 3696 3696 0 0.0
.rodata 107964 107964 0 0.0
.text 993130 993130 0 0.0
bl702+rpc (read only) 3478 3478 0 0.0
(read/write) 1303571 1303571 0 0.0
.bss 19669 19669 0 0.0
.data 4256 4256 0 0.0
.rodata 124396 124396 0 0.0
.text 1055828 1055828 0 0.0
bl706-eth (read/write) 1029213 1029213 0 0.0
.bss 23760 23760 0 0.0
.data 3264 3264 0 0.0
.rodata 102080 102080 0 0.0
.text 771642 771642 0 0.0
bl706-wifi (read/write) 1263286 1263286 0 0.0
.bss 10645 10645 0 0.0
.data 3712 3712 0 0.0
.rodata 123160 123160 0 0.0
.text 1002852 1002852 0 0.0
bl702l lighting-app bl702l (read only) 512 512 0 0.0
(read/write) 1181684 1181684 0 0.0
.bss 16396 16396 0 0.0
.data 5080 5080 0 0.0
.rodata 103028 103028 0 0.0
.text 974234 974234 0 0.0
bl702l+mfd (read/write) 1193600 1193600 0 0.0
.bss 16572 16572 0 0.0
.data 5064 5064 0 0.0
.rodata 101968 101968 0 0.0
.text 986556 986556 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 (read only) 798740 798740 0 0.0
(read/write) 177700 177700 0 0.0
.bss 99612 99612 0 0.0
.data 3604 3604 0 0.0
.rodata 85204 85204 0 0.0
.text 713272 713272 0 0.0
lock-ftd LP_EM_CC1354P10_6 (read only) 813960 813960 0 0.0
(read/write) 188172 188172 0 0.0
.bss 110100 110100 0 0.0
.data 3596 3596 0 0.0
.rodata 78776 78776 0 0.0
.text 734920 734920 0 0.0
lock-mtd LP_EM_CC1354P10_6 (read only) 803308 803308 0 0.0
(read/write) 182292 182292 0 0.0
.bss 104220 104220 0 0.0
.data 3596 3596 0 0.0
.rodata 106100 106100 0 0.0
.text 696944 696944 0 0.0
pump-app LP_EM_CC1354P10_6 (read only) 755612 755612 0 0.0
(read/write) 176644 176644 0 0.0
.bss 98336 98336 0 0.0
.data 3588 3588 0 0.0
.rodata 80852 80852 0 0.0
.text 674496 674496 0 0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 741284 741284 0 0.0
(read/write) 176884 176884 0 0.0
.bss 98576 98576 0 0.0
.data 3588 3588 0 0.0
.rodata 76636 76636 0 0.0
.text 664384 664384 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL (read only) 606718 606718 0 0.0
(read/write) 209716 209716 0 0.0
.bss 202932 202932 0 0.0
.data 1660 1660 0 0.0
.rodata 89766 89766 0 0.0
.text 514832 514832 0 0.0
lock CC3235SF_LAUNCHXL (read only) 652614 652614 0 0.0
(read/write) 209972 209972 0 0.0
.bss 203328 203328 0 0.0
.data 1524 1524 0 0.0
.rodata 110526 110526 0 0.0
.text 539964 539964 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 (read/write) 740195 740195 0 0.0
.app_xip_area 660205 660205 0 0.0
.bss 73588 73588 0 0.0
.data 940 940 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-02 (read/write) 755831 755831 0 0.0
.app_xip_area 672641 672641 0 0.0
.bss 75444 75444 0 0.0
.data 2284 2284 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-03 (read/write) 755831 755831 0 0.0
.app_xip_area 672641 672641 0 0.0
.bss 75444 75444 0 0.0
.data 2284 2284 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW930739M2EVB-02 (read/write) 712051 712051 0 0.0
.app_xip_area 636993 636993 0 0.0
.bss 68712 68712 0 0.0
.data 884 884 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
light-switch CYW30739B2-P5-EVK-01 (read/write) 677731 677731 0 0.0
.app_xip_area 602029 602029 0 0.0
.bss 69180 69180 0 0.0
.data 1060 1060 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-02 (read/write) 693063 693063 0 0.0
.app_xip_area 614249 614249 0 0.0
.bss 71036 71036 0 0.0
.data 2316 2316 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-03 (read/write) 693063 693063 0 0.0
.app_xip_area 614249 614249 0 0.0
.bss 71036 71036 0 0.0
.data 2316 2316 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
lock CYW30739B2-P5-EVK-01 (read/write) 696251 696251 0 0.0
.app_xip_area 617533 617533 0 0.0
.bss 72228 72228 0 0.0
.data 1028 1028 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-02 (read/write) 711655 711655 0 0.0
.app_xip_area 629825 629825 0 0.0
.bss 74084 74084 0 0.0
.data 2284 2284 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-03 (read/write) 711655 711655 0 0.0
.app_xip_area 629825 629825 0 0.0
.bss 74084 74084 0 0.0
.data 2284 2284 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
thermostat CYW30739B2-P5-EVK-01 (read/write) 658771 658771 0 0.0
.app_xip_area 586093 586093 0 0.0
.bss 66380 66380 0 0.0
.data 836 836 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-02 (read/write) 674415 674415 0 0.0
.app_xip_area 598529 598529 0 0.0
.bss 68244 68244 0 0.0
.data 2180 2180 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
CYW30739B2-P5-EVK-03 (read/write) 674415 674415 0 0.0
.app_xip_area 598529 598529 0 0.0
.bss 68244 68244 0 0.0
.data 2180 2180 0 0.0
.rodata 0 0 0 0.0
.text 2040 2040 0 0.0
efr32 lighting-app BRD4187C (read/write) 1072180 1072180 0 0.0
.bss 180056 180056 0 0.0
.data 3448 3448 0 0.0
.text 888656 888656 0 0.0
lock-app BRD4338a (read/write) 962580 962580 0 0.0
.bss 213204 213204 0 0.0
.data 29448 29448 0 0.0
.text 700560 700560 0 0.0
window-app BRD4187C (read/write) 1135888 1135880 -8 -0.0
.bss 164584 164584 0 0.0
.data 3352 3352 0 0.0
.text 967932 967924 -8 -0.0
esp32 all-clusters-app c3devkit (read only) 1215154 1215154 0 0.0
(read/write) 1751704 1751704 0 0.0
.dram0.bss 74744 74744 0 0.0
.dram0.data 13660 13660 0 0.0
.flash.rodata 253768 253768 0 0.0
.flash.text 1215154 1215154 0 0.0
.iram0.text 75570 75570 0 0.0
m5stack (read only) 1256487 1256487 0 0.0
(read/write) 536308 536308 0 0.0
.dram0.bss 79680 79680 0 0.0
.dram0.data 35196 35196 0 0.0
.flash.rodata 285512 285512 0 0.0
.flash.text 1250323 1250323 0 0.0
.iram0.text 125403 125403 0 0.0
linux air-purifier-app debug (read only) 2722517 2722517 0 0.0
(read/write) 132728 132728 0 0.0
.bss 47880 47880 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 76536 76536 0 0.0
.dynamic 608 608 0 0.0
.got 4576 4576 0 0.0
.init 27 27 0 0.0
.init_array 808 808 0 0.0
.rodata 188144 188144 0 0.0
.text 2351221 2351221 0 0.0
all-clusters-app debug (read only) 6036865 6036865 0 0.0
(read/write) 484272 484272 0 0.0
.bss 136160 136160 0 0.0
.data 4592 4592 0 0.0
.data.rel.ro 336072 336072 0 0.0
.dynamic 624 624 0 0.0
.got 5344 5344 0 0.0
.init 27 27 0 0.0
.init_array 1448 1448 0 0.0
.rodata 355536 355536 0 0.0
.text 5242467 5242467 0 0.0
all-clusters-minimal-app debug (read only) 5320305 5320305 0 0.0
(read/write) 240224 240224 0 0.0
.bss 129024 129024 0 0.0
.data 4496 4496 0 0.0
.data.rel.ro 99608 99608 0 0.0
.dynamic 624 624 0 0.0
.got 5264 5264 0 0.0
.init 27 27 0 0.0
.init_array 1176 1176 0 0.0
.rodata 294346 294346 0 0.0
.text 4785907 4785907 0 0.0
bridge-app debug (read only) 4710721 4710721 0 0.0
(read/write) 221136 221136 0 0.0
.bss 119552 119552 0 0.0
.data 6272 6272 0 0.0
.data.rel.ro 88576 88576 0 0.0
.dynamic 624 624 0 0.0
.got 5232 5232 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 234730 234730 0 0.0
.text 4250355 4250355 0 0.0
chip-tool debug (read only) 12173457 12173457 0 0.0
(read/write) 524808 524808 0 0.0
.bss 95160 95160 0 0.0
.data 5122 5122 0 0.0
.data.rel.ro 417272 417272 0 0.0
.dynamic 624 624 0 0.0
.got 5736 5736 0 0.0
.init 27 27 0 0.0
.init_array 840 840 0 0.0
.rodata 459129 459129 0 0.0
.text 11002851 11002851 0 0.0
chip-tool-ipv6only arm64 (read only) 11504116 11504116 0 0.0
(read/write) 589912 589912 0 0.0
.bss 104152 104152 0 0.0
.data 4512 4512 0 0.0
.data.rel.ro 457424 457424 0 0.0
.dynamic 512 512 0 0.0
.got 17280 17280 0 0.0
.init 24 24 0 0.0
.init_array 280 280 0 0.0
.rodata 360916 360916 0 0.0
.text 10257464 10257464 0 0.0
fabric-admin debug (read only) 11922049 11922049 0 0.0
(read/write) 517872 517872 0 0.0
.bss 94520 94520 0 0.0
.data 4866 4866 0 0.0
.data.rel.ro 411480 411480 0 0.0
.dynamic 624 624 0 0.0
.got 5584 5584 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 430233 430233 0 0.0
.text 10795139 10795139 0 0.0
fabric-bridge-app debug (read only) 4576977 4576977 0 0.0
(read/write) 213112 213112 0 0.0
.bss 115104 115104 0 0.0
.data 5056 5056 0 0.0
.data.rel.ro 86256 86256 0 0.0
.dynamic 624 624 0 0.0
.got 5232 5232 0 0.0
.init 27 27 0 0.0
.init_array 816 816 0 0.0
.rodata 228138 228138 0 0.0
.text 4125699 4125699 0 0.0
lighting-app debug+rpc+ui (read only) 5634697 5634697 0 0.0
(read/write) 229936 229936 0 0.0
.bss 120496 120496 0 0.0
.data 4896 4896 0 0.0
.data.rel.ro 96992 96992 0 0.0
.dynamic 672 672 0 0.0
.got 5864 5864 0 0.0
.init 27 27 0 0.0
.init_array 984 984 0 0.0
.rodata 358964 358964 0 0.0
.text 5023667 5023667 0 0.0
lock-app debug (read only) 4771777 4771777 0 0.0
(read/write) 208264 208264 0 0.0
.bss 114792 114792 0 0.0
.data 4192 4192 0 0.0
.data.rel.ro 82568 82568 0 0.0
.dynamic 624 624 0 0.0
.got 5184 5184 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 260586 260586 0 0.0
.text 4294627 4294627 0 0.0
ota-provider-app debug (read only) 4384209 4384209 0 0.0
(read/write) 196864 196864 0 0.0
.bss 114656 114656 0 0.0
.data 4400 4400 0 0.0
.data.rel.ro 71824 71824 0 0.0
.dynamic 624 624 0 0.0
.got 4552 4552 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 212490 212490 0 0.0
.text 3973811 3973811 0 0.0
ota-requestor-app debug (read only) 4514897 4514897 0 0.0
(read/write) 201232 201232 0 0.0
.bss 115552 115552 0 0.0
.data 4800 4800 0 0.0
.data.rel.ro 74928 74928 0 0.0
.dynamic 624 624 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 808 808 0 0.0
.rodata 218570 218570 0 0.0
.text 4093875 4093875 0 0.0
shell debug (read only) 3006113 3006113 0 0.0
(read/write) 156856 156856 0 0.0
.bss 60784 60784 0 0.0
.data 1424 1424 0 0.0
.data.rel.ro 88792 88792 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 1120 1120 0 0.0
.rodata 191840 191840 0 0.0
.text 2635122 2635122 0 0.0
thermostat-no-ble arm64 (read only) 4501580 4501580 0 0.0
(read/write) 248752 248752 0 0.0
.bss 123144 123144 0 0.0
.data 3424 3424 0 0.0
.data.rel.ro 106008 106008 0 0.0
.dynamic 512 512 0 0.0
.got 9000 9000 0 0.0
.init 24 24 0 0.0
.init_array 448 448 0 0.0
.rodata 162260 162260 0 0.0
.text 3997784 3997784 0 0.0
tv-app debug (read only) 5847649 5847649 0 0.0
(read/write) 349088 349088 0 0.0
.bss 238640 238640 0 0.0
.data 6592 6592 0 0.0
.data.rel.ro 96568 96568 0 0.0
.dynamic 624 624 0 0.0
.got 5464 5464 0 0.0
.init 27 27 0 0.0
.init_array 1192 1192 0 0.0
.rodata 302090 302090 0 0.0
.text 5298995 5298995 0 0.0
tv-casting-app debug (read only) 9999641 9999641 0 0.0
(read/write) 343184 343184 0 0.0
.bss 156760 156760 0 0.0
.data 3008 3008 0 0.0
.data.rel.ro 176432 176432 0 0.0
.dynamic 624 624 0 0.0
.got 5096 5096 0 0.0
.init 27 27 0 0.0
.init_array 1232 1232 0 0.0
.rodata 389144 389144 0 0.0
.text 9139363 9139363 0 0.0
mbed lock-app-release cy8cproto_062_4343w (read only) 6224 6224 0 0.0
(read/write) 2536680 2536680 0 0.0
.bss 220928 220928 0 0.0
.data 5224 5224 0 0.0
.text 1499364 1499364 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1061392 1061392 0 0.0
bss 139209 139209 0 0.0
rodata 101840 101840 0 0.0
text 773072 773072 0 0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1238556 1238556 0 0.0
bss 137637 137637 0 0.0
rodata 151444 151444 0 0.0
text 799432 799432 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1009080 1009080 0 0.0
bss 138107 138107 0 0.0
rodata 89096 89096 0 0.0
text 734660 734660 0 0.0
nxp contact k32w0+release (read only) 576444 576444 0 0.0
(read/write) 83220 83220 0 0.0
.bss 67920 67920 0 0.0
.data 2204 2204 0 0.0
.text 575908 575908 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 704308 704308 0 0.0
.bss 71272 71272 0 0.0
.data 2872 2872 0 0.0
.text 590784 590784 0 0.0
light k32w0+release (read only) 610624 610624 0 0.0
(read/write) 82688 82688 0 0.0
.bss 67376 67376 0 0.0
.data 2224 2224 0 0.0
.text 610088 610088 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 796256 796256 0 0.0
.bss 80816 80816 0 0.0
.data 2080 2080 0 0.0
.text 673992 673992 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 826128 826128 0 0.0
(read/write) 1827444 1827444 0 0.0
.bss 204460 204460 0 0.0
.data 2752 2752 0 0.0
.text 1611844 1611844 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 829224 829224 0 0.0
(read/write) 1748716 1748716 0 0.0
.bss 201388 201388 0 0.0
.data 2728 2728 0 0.0
.text 1536212 1536212 0 0.0
light cy8ckit_062s2_43012 (read only) 835944 835944 0 0.0
(read/write) 1667156 1667156 0 0.0
.bss 194852 194852 0 0.0
.data 2544 2544 0 0.0
.text 1461372 1461372 0 0.0
lock cy8ckit_062s2_43012 (read only) 808880 808880 0 0.0
(read/write) 1695820 1695820 0 0.0
.bss 221932 221932 0 0.0
.data 2528 2528 0 0.0
.text 1462972 1462972 0 0.0
qpg lighting-app qpg6105+debug (read/write) 839244 839244 0 0.0
.bss 103780 103780 0 0.0
.data 864 864 0 0.0
.text 650632 650632 0 0.0
lock-app qpg6105+debug (read/write) 799364 799364 0 0.0
.bss 98444 98444 0 0.0
.data 876 876 0 0.0
.text 610756 610756 0 0.0
stm32 light STM32WB5MM-DK (read/write) 624058 624058 0 0.0
.bss 141060 141060 0 0.0
.data 672 672 0 0.0
.rodata 81372 81372 0 0.0
.text 391336 391336 0 0.0
telink air-quality-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 835170 835170 0 0.0
bss 49944 49944 0 0.0
text 625530 625530 0 0.0
all-clusters-app tlsr9118bdk40d (read only) 160 160 0 0.0
(read/write) 843552 843552 0 0.0
bss 79088 79088 0 0.0
noinit 46096 46096 0 0.0
text 601330 601330 0 0.0
all-clusters-minimal-app tlsr9528a (read only) 47960 47960 0 0.0
(read/write) 1060100 1060100 0 0.0
bss 110132 110132 0 0.0
text 773616 773616 0 0.0
bridge-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 915644 915644 0 0.0
bss 92888 92888 0 0.0
text 657116 657116 0 0.0
contact-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 837530 837530 0 0.0
bss 49988 49988 0 0.0
text 627948 627948 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a (read only) 51584 51584 0 0.0
(read/write) 948612 948612 0 0.0
bss 76580 76580 0 0.0
text 714900 714900 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d (read only) 160 160 0 0.0
(read/write) 772060 772060 0 0.0
bss 75336 75336 0 0.0
noinit 46096 46096 0 0.0
text 557886 557886 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d (read only) 29122 29122 0 0.0
(read/write) 1092216 1092216 0 0.0
bss 99980 99980 0 0.0
text 795316 795316 0 0.0
lock-app-dfu tlsr9528a (read only) 51584 51584 0 0.0
(read/write) 912624 912624 0 0.0
bss 69268 69268 0 0.0
text 661336 661336 0 0.0
ota-requestor-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 934836 934836 0 0.0
bss 92620 92620 0 0.0
text 676424 676424 0 0.0
pump-app tlsr9258a (read only) 52568 52568 0 0.0
(read/write) 832104 832104 0 0.0
bss 58232 58232 0 0.0
text 621972 621972 0 0.0
pump-controller-app tlsr9118bdk40d (read only) 160 160 0 0.0
(read/write) 607488 607488 0 0.0
bss 44160 44160 0 0.0
noinit 32512 32512 0 0.0
text 451088 451088 0 0.0
shell tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 674948 674948 0 0.0
bss 71852 71852 0 0.0
text 462082 462082 0 0.0
smoke_co_alarm-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 845382 845382 0 0.0
bss 51616 51616 0 0.0
text 634614 634614 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d (read only) 32220 32220 0 0.0
(read/write) 860225 860225 0 0.0
bss 59804 59804 0 0.0
text 643542 643542 0 0.0
thermostat tlsr9518adk80d (read only) 31872 31872 0 0.0
(read/write) 826756 826756 0 0.0
bss 56492 56492 0 0.0
text 619410 619410 0 0.0
window-covering tlsr9258a (read only) 52568 52568 0 0.0
(read/write) 836808 836808 0 0.0
bss 58448 58448 0 0.0
text 624256 624256 0 0.0

Copy link
Contributor

@tehampson tehampson left a comment

Choose a reason for hiding this comment

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

Adding Request changes for the moment. If my understanding of section "8.8.2.3. Incoming Invoke Request Action" is correct, the order of operations are intended to be followed in that order. Adjusting the test here because a device is failing in an unexpected way, I don't think is the right way to fix this.

From my perspective we should really be able to fuzz any sort of invalid command path for the values and we should expect the same non-path specific error. It just so happens that this value we are sending here is tripping up a device, but some other invalid path is not.

Before I remove my request for change I would like confirmation that 8.8.2.3 is not intended to be followed in that order otherwise I think this is catching a real out of order spec violating issue.

Note: Lots of the parts of this test are intentionally sending out spec violating thing making sure the DUT behaves appropriately

@Apollon77
Copy link
Contributor Author

@tehampson Hi and thank you for looking at my change.
Ok, when I get your comment right then we hit implementation specific topics or unclear specification requirements ;-) (no offense!)

Your understanding of the specification as you reference relies on an iterative Tlv decoding/determination, so first you decode just the "action field" listed in 8.8.2.1 (matter spec 1.3) and not looking into the list content at all ... then you look into the list content when handling the values.

That leads to the followup up question how an "semantically invalid MEI" should be handled afterwards? Falls it into the "Valid Command path" check (spec do not tell anything here about invalid values, but field combinations) or should it be "just" a non-existing path (so completely ignoring that the value is invalid semantically regarding the datamodel definition)?
Because there agsin it would be a difference in the returned responsecodes and response at all.

On a pure "data type" level it is correct: eg command-id is just defined as a uint32, not mentioning any semantics like MEI value range limitations which lead to the question above: Where and when such validation should be done and with which results/consequences?

One example: ACL test TC_ACL_2_4 step 39 requires to decline an invalid cluster id (0xFFFFFFFF) with a Constraint error" ... and spec just tells very generically:

The Access Control Cluster SHALL fail to write, and return an appropriate error, if an attempt is made to create or update an Access Control Entry or Access Control Extension such that it would have invalid contents.

So in this case "invalid contents" is also considered an invalid MEI value which is like an invalid value.

Thank you,

Ingo

@tehampson
Copy link
Contributor

Let me see if I am understanding this correctly:

You are saying that the spec is unspecified with respect to decode order vs processing order for interactions. That in this case for InvokeRequestMessage we should fail with a decode error, and not even start processing it as an incoming request.

If that is what you are saying then I somewhat agree that as of today this is unspecified in the spec. I can open a ticket about that and there might be specification added.

Where I still don't know I fully have come around to is that you are returning a CONSTRAINT_ERROR. If there is an issues decoding an interaction because of an incorrect TLV, we should still be giving a INVALID_ACTION, so I see that we should be doing the same for any other decode related issues and not send different errors.

A CONSTRAINT_ERROR is defined as "Out of range error or set to a reserved value. Attribute keeps its old value. Note that an attribute value may be out of range if an attribute is related to another, e.g. with minimum and maximum attributes. See the individual attribute descriptions for specific details."

Based on that description I do NOT think you should be sending a CONSTRAINT_ERROR, but should be sending an INVALID_ACTION as it is an invalid action

From my outside persective it looks like you have decode logic catering to passing a cluster related test for the values there, but re-using that decoder for something lower in the stack to return error codes that are different.

Essentially I am coming around to your change, because I think because of the ambiguity between decode and processing currently is unspecified, and so we might be catching the wrong error here for some implementation. But I still don't think you are returning the right error code when the command_id is 0xFFFF_FFFF.

@tehampson tehampson dismissed their stale review May 23, 2024 16:06

No longer want to be blocking, but not yet approved as I want to see a comment added to test

@Apollon77
Copy link
Contributor Author

Thank you very much and yes regarding contrains error vs invalid action you have a valid point. let me dive into spec for this. I come back :-)

@Apollon77
Copy link
Contributor Author

@tehampson I looked into it. In fact it would be awesome to have options to handle such validations generically, but in fact it's not. ACL cluster, as already told, expects a contraint error when any invalid cluster/group/deviceType id is provided in acl data on a write interaction.

I adjusted my side already to be like the spec seems to be interpreted: The decoding mainly checks only data types, so decoding is not checking values on a semantic level. All more deep checks need to be done later in the code flows.

So with this topic clarified I would mainly misss in the specs how an "semantically invalid command id (or clusterid)" should be handled fpor invokes (or other for read/write/subscribe. Here, again as I interpret the specs because it is not defined, this is simply irrelevant because for device side such invalid values should never be used for cluster-ids or such and so this is simply an "unsupported cluster" (in that example) error which would happen. means: no explicit validation required in this case.

Sure, anything just assumptions on how I think the specs want to get interpreted ;-)

If you do not see that different we could close here because in fact it is just another unusual edge case checked here which could be relevant to just make sure noone else stumbles over it with a differnt understanding.

if the spec could use an enhancement to clarify such things is not on me to decide.

WDYT?

Thank you very much for the open and constructive chat about the topic!

@tehampson
Copy link
Contributor

@Apollon77

Let me start off by saying I am not an expert in the spec at all. I simply have worked heavily on batch commands, and am more familiar with that specific section of the spec

ACL cluster, as already told, expects a contraint error when any invalid cluster/group/deviceType id is provided in acl data on a write interaction.

The ACL cluster is already at the application level. So it giving a CONSTRAINT_ERROR is acceptable there and expected. We are at the interaction model layer at this point so while there are similarities I see this layer as different and it can have a different set of errors for similar kinds of data that need to be decoded. Today you might be getting away with sending a CONSTRAINT_ERROR. But based on my understanding of a CONSTRAINT_ERROR, I do not think that is the right error to be throwing at this layer as this layer is the interaction model layer and the values provides for the interaction make it not a valid (INVALID_ACTION). I am simply trying to give my 2 cents that in the near future there this may be codified in the spec and that a similar test to this one might be introduce to catch a decode error giving INVALID_ACTION.

If you do not see that different we could close here because in fact it is just another unusual edge case checked here which could be relevant to just make sure noone else stumbles over it with a differnt understanding.

Like I said, I am okay with this change going in as is because of the unspecified nature of the spec between when decode should happen and when processing the invoke interaction. This test is trying to catch an error in the processing portion of spec, and because of the ambiguity some implementation might give a decode error of INVALID_ACTION in be passing this test step in an unexpected way.

I just want to see my comment about adding a comment about why we are selecting 0xfff4_00ff addressed before I approve.

@Apollon77
Copy link
Contributor Author

Apollon77 commented May 24, 2024

Alright, before we iterate in code commits ... would that comment fulfill your requirements:

# Use a valid (according to MEI definition) command-id (in this case belonging to Test Vendor MC with prefix 0xfff4)
# which should never be existing on a prodiction device. We use this decodable id to prevent hitting issues with the
# specification being not clearly defined in respect to decoding vs processing the invoke requests.

WDYT? Any better ideas?

@tehampson
Copy link
Contributor

Alright, before we iterate in code commits ... would that comment fulfill your requirements:

# Use a valid (according to MEI definition) command-id (in this case belonging to Test Vendor MC with prefix 0xfff4)
# which should never be existing on a prodiction device. We use this decodable id to prevent hitting issues with the
# specification being not clearly defined in respect to decoding vs processing the invoke requests.

WDYT? Any better ideas?

Looks good to me. Upload that and I will approve

@mergify mergify bot merged commit 6aee3fd into project-chip:master May 24, 2024
67 checks passed
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.

3 participants