Skip to content

Commit fd5aedf

Browse files
eliminate alias folder is not an mbean errors (#1242)
1 parent 69c5dcd commit fd5aedf

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

integration-tests/alias-test/generate/src/test/python/aliastest/generate/generator_offline.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def __folder_hierarchy(self, mbean_dictionary, online_dictionary, mbean_path, pa
122122

123123
if self._is_valid_folder(mbean_helper):
124124
if mbean_type in PROVIDERS:
125-
print('Found security provider folder ', mbean_type)
125+
self.__logger.fine('Found security provider folder {0}', mbean_type)
126126
success, lsc_name, attributes = self.create_security_type(mbean_type)
127127
mbean_dictionary[lsc_name] = attributes
128128
continue
@@ -150,8 +150,17 @@ def __folder_hierarchy(self, mbean_dictionary, online_dictionary, mbean_path, pa
150150
online_dictionary_name, parent_mbean_type,
151151
class_name=self.__class_name, method_name=_method_name)
152152
methods_name_list.remove(online_dictionary_name)
153-
success, lsc_name, attributes = \
154-
self.__generate_folder(mbean_instance, parent_mbean_type, online_dictionary_name, None)
153+
154+
# Have to make sure what we are processing is not a security provider type.
155+
if online_dictionary_name in PROVIDERS:
156+
self.__logger.fine('Found security provider folder {0} in online_dictionary_names',
157+
online_dictionary_name)
158+
success, lsc_name, attributes = self.create_security_type(online_dictionary_name)
159+
mbean_dictionary[lsc_name] = attributes
160+
continue
161+
else:
162+
success, lsc_name, attributes = \
163+
self.__generate_folder(mbean_instance, parent_mbean_type, online_dictionary_name, None)
155164
if success:
156165
self.__logger.fine('Processing MBean {0} child {1} from online dictionary',
157166
lsc_name, parent_mbean_type,

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,23 @@
146146
MESSAGE = 'message'
147147
ATTRIBUTE = 'attribute'
148148

149+
ALIAS_FOLDER_IGNORE_MAP = {
150+
'/': [
151+
'ODLConfiguration',
152+
'OHS',
153+
'RCUDbInfo',
154+
'Security',
155+
'UnixMachine',
156+
'WLSRoles',
157+
'WLSUserPasswordCredentialMappings'
158+
],
159+
'/ResourceGroupTemplate': [
160+
'OHS',
161+
'SystemComponent',
162+
'SystemComponents'
163+
]
164+
}
165+
149166
_logger = PlatformLogger('test.aliases.verify')
150167
_logger.set_level(Level.FINER)
151168
CLASS_NAME = 'Verifier'
@@ -299,6 +316,9 @@ def _check_generated_against_alias_folders(self, location, generated_dictionary,
299316
class_name=CLASS_NAME, method_name=_method_name)
300317
if keys is not None:
301318
for alias_name in keys:
319+
if _is_in_ignore_list(location, alias_name):
320+
continue
321+
302322
found, mbean_info_name = verify_utils.find_name_in_mbean_with_model_name(alias_name, lower_case_map)
303323
if found:
304324
_logger.fine('Alias mbean type {0} found in dictionary as {1}', alias_name, mbean_info_name,
@@ -1478,6 +1498,13 @@ def _get_dict_key_from_value(alias_name_map, lower_case_value):
14781498
return result
14791499

14801500

1501+
def _is_in_ignore_list(location, alias_name):
1502+
path = location.get_folder_path()
1503+
if path in ALIAS_FOLDER_IGNORE_MAP and alias_name in ALIAS_FOLDER_IGNORE_MAP[path]:
1504+
return True
1505+
return False
1506+
1507+
14811508
class VerifierResult(object):
14821509
CLASS_NAME = 'VerifierResult'
14831510

0 commit comments

Comments
 (0)