TC-IDM-12.1: Add a wildcard dump test (#33878)
* TC-IDM-12.1: Add a wildcard dump test
This is a convenience test for the test harness that creates a
device dump for submission as a part of the certification materials.
Putting this as a separate test means we don't need to ask the
testers to mess around with setting parameters for this test in
the test harness.
* linter
* add wildcard read as a step
* slight re-wording
diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py
index 5bfbc5c..795b760 100644
--- a/src/python_testing/TC_DeviceBasicComposition.py
+++ b/src/python_testing/TC_DeviceBasicComposition.py
@@ -29,7 +29,7 @@
from chip.interaction_model import InteractionModelError, Status
from chip.tlv import uint
from global_attribute_ids import GlobalAttributeIds
-from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest,
+from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep,
async_test_body, default_matter_test_main)
from mobly import asserts
from taglist_and_topology_test_support import (create_device_type_list_for_root, create_device_type_lists, find_tag_list_problems,
@@ -748,6 +748,23 @@
if problems or root_problems:
self.fail_current_test("Problems with tags lists")
+ def steps_TC_IDM_12_1(self):
+ return [TestStep(0, "TH performs a wildcard read of all attributes and endpoints on the device"),
+ TestStep(1, "TH creates a MatterTlvJson dump of the wildcard attributes for submission to certification.")]
+
+ def test_TC_IDM_12_1(self):
+ # wildcard read - already done.
+ self.step(0)
+
+ # Create the dump
+ self.step(1)
+ pid = self.endpoints[0][Clusters.BasicInformation][Clusters.BasicInformation.Attributes.ProductID]
+ vid = self.endpoints[0][Clusters.BasicInformation][Clusters.BasicInformation.Attributes.VendorID]
+ software_version = self.endpoints[0][Clusters.BasicInformation][Clusters.BasicInformation.Attributes.SoftwareVersion]
+ filename = f'device_dump_0x{vid:04X}_0x{pid:04X}_{software_version}.json'
+ dump_device_composition_path = self.user_params.get("dump_device_composition_path", filename)
+ self.dump_wildcard(dump_device_composition_path)
+
if __name__ == "__main__":
default_matter_test_main()