You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TC-IDM-10.1: Support write-only attributes (#32049)
* TC-IDM-10.1: Support write-only attributes
Write only attributes are not returned in the wildcard, but will
return the UNSUPPORTED_READ error if we attempt to read them in
a concrete path. We can detect their presence by probing for
this error via a read.
* remove random comment
* Establish PASE session from code
* fix node id
* Catch KeyError on missing global
This would have already been validated in the last step, so catch
and release this error and move on.
* Fix global attribute names
* Fix attribute string
* Restyled by clang-format
* Update src/python_testing/TC_DeviceBasicComposition.py
* Restyled by autopep8
* Make comment more verbose.
---------
Co-authored-by: Restyled.io <commits@restyled.io>
self.print_step(1, "Perform a wildcard read of attributes on all endpoints - already done")
170
208
171
209
@dataclass
@@ -222,6 +260,10 @@ class RequiredMandatoryAttribute:
222
260
problem=f"Failed validation of value on {location.as_string(self.cluster_mapper)}: {str(e)}", spec_location="Global Elements")
223
261
success=False
224
262
continue
263
+
exceptKeyError:
264
+
# A KeyError here means the attribute does not exist. This problem was already recorded in step 2,
265
+
# but we don't assert until the end of the test, so ignore this and don't re-record the error.
266
+
continue
225
267
226
268
self.print_step(4, "Validate the attribute list exactly matches the set of reported attributes")
227
269
ifsuccess:
@@ -236,15 +278,19 @@ class RequiredMandatoryAttribute:
236
278
logging.debug(
237
279
f"Checking presence of claimed supported {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}: {'found'ifhas_attributeelse'not_found'}")
238
280
239
-
# Check attribute is actually present.
240
281
ifnothas_attribute:
241
-
# TODO: Handle detecting write-only attributes from schema.
problem=f"Did not find {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed in AttributeList ({attribute_list})", spec_location="AttributeList Attribute")
247
-
success=False
282
+
# Check if this is a write-only attribute by trying to read it.
283
+
# If it's present and write-only it should return an UNSUPPORTED_READ error. All other errors are a failure.
284
+
# Because these can be MEI attributes, we need to build the ClusterAttributeDescriptor manually since it's
285
+
# not guaranteed to be generated. Since we expect an error back anyway, the type doesn't matter.
problem=f"Did not find {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed in AttributeList ({attribute_list})", spec_location="AttributeList Attribute")
0 commit comments