Skip to content

Commit 8ba949c

Browse files
Hack: Fix a parsing error in the DM XML in a way that can be side loa… (project-chip#71576)
* Hack: Fix a parsing error in the DM XML in a way that can be side loaded for SVE Note: We do have a proper fix for this, but it requires re-rolling the test harness. This is a backup in case we don't have time to do this. * Restyled by isort * add issue number, remove print * Add the remaining data model file patches * add other DM patches * Restyled by autopep8 * omg...add the changes, cecille * whoops --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 9e0eeb4 commit 8ba949c

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/python_testing/TC_DeviceConformance.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,47 @@
5353
# quiet: true
5454
# === END CI TEST ARGUMENTS ===
5555

56+
import matter.clusters as Clusters
57+
from matter.testing.conformance import optional, otherwise, provisional
5658
from matter.testing.decorators import async_test_body
5759
# TODO: Enable 10.5 in CI once the door lock OTA requestor problem is sorted.
5860
from matter.testing.device_conformance_tests import DeviceConformanceTests
5961
from matter.testing.runner import TestStep, default_matter_test_main
62+
from matter.testing.spec_parsing import XmlFeature
6063

6164

6265
class TC_DeviceConformance(DeviceConformanceTests):
66+
67+
def remove_later_dirty_patch_for_1_6_groupscast_and_onoff(self):
68+
acl_id = Clusters.AccessControl.id
69+
groups_id = Clusters.Groups.id
70+
group_key_management_id = Clusters.GroupKeyManagement.id
71+
on_off_id = Clusters.OnOff.id
72+
# TODO (#71577): Remove once the parser is updated to correctly parse this conformance
73+
if self.xml_clusters[acl_id].revision >= 3:
74+
aux_mask = Clusters.AccessControl.Bitmaps.Feature.kAuxiliary
75+
self.xml_clusters[acl_id].features[aux_mask] = XmlFeature(code='AUX', name='Auxiliary', conformance=optional())
76+
self.xml_clusters[acl_id].feature_map['AUX'] = aux_mask
77+
# TODO (#71595): Remove remaining hacks once the DM files for 1.6 are updated.
78+
if self.xml_clusters[groups_id].revision == 5:
79+
self.xml_clusters[groups_id].revision = 4
80+
if self.xml_clusters[group_key_management_id].revision == 3:
81+
gcast_mask = Clusters.GroupKeyManagement.Bitmaps.Feature.kGroupcast
82+
self.xml_clusters[group_key_management_id].features[gcast_mask] = XmlFeature(
83+
code='GCAST', name='Groupcast', conformance=optional())
84+
gcast_adoption_id = Clusters.GroupKeyManagement.Attributes.GroupcastAdoption.attribute_id
85+
# Conformance for this attribute needs to be wrapped in provisional as the intent it to let this remain provisional post 1.6
86+
current_conformance = self.xml_clusters[group_key_management_id].attributes[gcast_adoption_id].conformance
87+
self.xml_clusters[group_key_management_id].attributes[gcast_adoption_id].conformance = otherwise([
88+
provisional(), current_conformance])
89+
if self.xml_clusters[on_off_id].revision == 7:
90+
self.xml_clusters[on_off_id].revision = 6
91+
6392
@async_test_body
6493
async def setup_class(self):
6594
super().setup_class()
6695
await self.setup_class_helper()
96+
self.remove_later_dirty_patch_for_1_6_groupscast_and_onoff()
6797

6898
def test_TC_IDM_10_2(self):
6999
# TODO: Turn this off after TE2

0 commit comments

Comments
 (0)