Skip to content

Commit b1000a2

Browse files
committed
fixing alias test for CustomClusterConfigurationFileName readonly exception
1 parent 8199606 commit b1000a2

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/CoherenceClusterSystemResource.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
},
266266
"attributes": {
267267
"CustomClusterConfigurationFileLastUpdatedTimestamp": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "CustomClusterConfigurationFileLastUpdatedTimestamp", "wlst_path": "WP001", "default_value": 0, "wlst_type": "long", "access": "${:IGNORED}" } ],
268-
"CustomClusterConfigurationFileName": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "CustomClusterConfigurationFileName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "set_method": "MBEAN.set_coherence_cluster_custom_config_file", "uses_path_tokens": "true" } ],
268+
"CustomClusterConfigurationFileName": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "CustomClusterConfigurationFileName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "set_method": "MBEAN.set_coherence_cluster_custom_config_file", "uses_path_tokens": "true", "comment": "This attribute is read-only in online mode. We are working around that using the custom set method to invoke the MBean's importCustomClusterConfigurationFile() function to set the value" } ],
269269
"Version": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "Version", "wlst_path": "WP001", "default_value": null, "wlst_type": "string"} ]
270270
},
271271
"wlst_attributes_path": "WP001",

integration-tests/alias-test/verify/src/test/python/aliastest/verify/utils.py

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@
6767
]
6868
}
6969

70+
ONLINE_ATTRIBUTE_READONLY_EXCEPTION_MAP = {
71+
"/CoherenceClusterSystemResource/CoherenceResource": [
72+
"CustomClusterConfigurationFileName"
73+
]
74+
}
75+
7076
OFFLINE_TEST_ANOMALIES_MAP = {
7177
'/Application': {
7278
'ModuleType': 'war',

integration-tests/alias-test/verify/src/test/python/aliastest/verify/verifier.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
ERROR_ATTRIBUTE_ALIAS_NOT_FOUND: 'Attribute not found in aliases',
122122
ERROR_ATTRIBUTE_INCORRECT_CASE: 'Attribute case incorrect',
123123
ERROR_ATTRIBUTE_ALIAS_NOT_FOUND_IS_READONLY: 'Readonly attribute not found in aliases',
124-
ERROR_ATTRIBUTE_READONLY: 'Attribute is marked readwrite',
124+
ERROR_ATTRIBUTE_READONLY: 'Attribute is marked readwrite in the alias but read-only in WLST',
125125
ERROR_ATTRIBUTE_NOT_READONLY_VERSION: 'Attribute is marked readonly or is invalid version range',
126126
ERROR_ATTRIBUTE_NOT_READONLY: 'Attribute is not marked readwrite',
127127
ERROR_ATTRIBUTE_WRONG_DEFAULT_VALUE: 'Attribute wrong default value',
@@ -629,6 +629,12 @@ def _is_generated_attribute_readonly(self, location, generated_attribute, genera
629629
_logger.entering(location.get_folder_path(), generated_attribute, str(generated_attribute_info),
630630
str(alias_get_required_attribute_list), class_name=CLASS_NAME, method_name=_method_name)
631631

632+
if self._model_context.get_target_wlst_mode() == WlstModes.ONLINE:
633+
if location.get_folder_path() in verify_utils.ONLINE_ATTRIBUTE_READONLY_EXCEPTION_MAP:
634+
attribute_exceptions = verify_utils.ONLINE_ATTRIBUTE_READONLY_EXCEPTION_MAP[location.get_folder_path()]
635+
if isinstance(attribute_exceptions, list) and generated_attribute in attribute_exceptions:
636+
return False
637+
632638
if READ_TYPE not in generated_attribute_info and CMO_READ_TYPE not in generated_attribute_info:
633639
self._add_error(location, ERROR_FAILURE_ATTRIBUTE_UNEXPECTED,
634640
message='Generated attribute has no read type', attribute=generated_attribute)

0 commit comments

Comments
 (0)