From 185e41c27400ef418a2a6fc1144c47a6eab7bab6 Mon Sep 17 00:00:00 2001 From: SoWizard Date: Mon, 19 Oct 2026 19:32:35 +1100 Subject: [PATCH] Matter: fix stale host test fixtures (#25161) run_tests.be and button_stability_tests.be stop with assert_failed right after "Matter epoch conversion for UTC and local time: OK" on development. Three test-only mistakes, each hiding the next: - run_tests.be checked the RSSI item's stored TLV type before encoding. "Clamp RSSI" (#25126) stores signed values as I4; the encoded bytes are still the 1-byte 00C3, which the next assert checks. Check the value only. - TestGarageDevice (run_tests.be) lacks disable_bridge_mode, which Matter_Plugin_Device.init() reads since #25099. - StabilityDevice (button_stability_tests.be) lacks it too. Tests only; no firmware files change. Co-authored-by: Claude Opus 5.5 --- lib/libesp32/berry_matter/tests/button_stability_tests.be | 3 ++- lib/libesp32/berry_matter/tests/run_tests.be | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libesp32/berry_matter/tests/button_stability_tests.be b/lib/libesp32/berry_matter/tests/button_stability_tests.be index 343c261b0..f8a5a5991 100644 --- a/lib/libesp32/berry_matter/tests/button_stability_tests.be +++ b/lib/libesp32/berry_matter/tests/button_stability_tests.be @@ -74,9 +74,10 @@ def test_button_stability() def init() self.im = TestInteractionModel() end end class StabilityDevice - var events, message_handler, updates + var events, message_handler, updates, disable_bridge_mode def init() self.updates = 0 + self.disable_bridge_mode = false self.message_handler = TestMessageHandler() self.events = MemoryEventHandler(self) end diff --git a/lib/libesp32/berry_matter/tests/run_tests.be b/lib/libesp32/berry_matter/tests/run_tests.be index 2635b4ddf..7af5cc98f 100644 --- a/lib/libesp32/berry_matter/tests/run_tests.be +++ b/lib/libesp32/berry_matter/tests/run_tests.be @@ -206,9 +206,10 @@ class TestGarageEvents end class TestGarageDevice - var tick, events + var tick, events, disable_bridge_mode def init() self.tick = 1 + self.disable_bridge_mode = false self.events = TestGarageEvents() end def attribute_updated(endpoint, cluster, attribute, fabric_specific) end @@ -349,7 +350,7 @@ ctx.attribute = 0x0003 assert(root.read_attribute(session, ctx, TLV.Matter_TLV_item()).val == 6) ctx.attribute = 0x0004 var rssi = root.read_attribute(session, ctx, TLV.Matter_TLV_item()) -assert(rssi.typ == 0x00 && rssi.val == -61) +assert(rssi.val == -61) # stored as I4 by convention; next line checks the encoded I1 assert(rssi.tlv2raw() == bytes("00C3")) tasmota.wifi_info['security'] = 'wpa3-enterprise' # unknown mode maps to Unspecified tasmota.wifi_info['phy'] = '' # unknown PHY is null