Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2efdfb8
add defaults and derived default flag
CarolynRountree Sep 29, 2022
dbebaf7
default value change
CarolynRountree Sep 30, 2022
8a7a0de
default value change
CarolynRountree Sep 30, 2022
30e522d
Update WLSDeployZipFile.java
CarolynRountree Sep 30, 2022
2536492
adding uses_path_tokens, where appropriate
robertpatrick Oct 5, 2022
8260712
Merge branch 'WDT-663-fix-alias-tests-for-reduce-time' of github.com:…
robertpatrick Oct 5, 2022
0d8aa62
fixing a broken unit test caused by adding uses_path_tokens to the Fi…
robertpatrick Oct 5, 2022
4db6db1
renaming the top-level system-test directory
robertpatrick Oct 5, 2022
298a322
Corrected error message key
rakillen Oct 5, 2022
3184b10
Merge remote-tracking branch 'origin/WDT-663-fix-alias-tests-for-redu…
rakillen Oct 5, 2022
423e205
fixing merge issues
robertpatrick Oct 5, 2022
895e167
another attempt to resolve the merge conflict
robertpatrick Oct 5, 2022
a0dbd86
Corrected token name
rakillen Oct 5, 2022
2b5f55d
Merge remote-tracking branch 'origin/WDT-663-fix-alias-tests-for-redu…
rakillen Oct 5, 2022
9267cd5
Fixed attributes with "None" values, server template date format and …
rakillen Oct 6, 2022
13bc495
Restored SecurityConfiguration PasswordDigestEnabled and ActiveType t…
rakillen Oct 7, 2022
15cfd8d
Fix for flattened folders without tokens in location
CarolynRountree Oct 7, 2022
063e8bf
Merge branch 'main' into WDT-663-fix-alias-tests-for-reduce-time
robertpatrick Oct 11, 2022
a794476
Merge branch 'WDT-663-fix-alias-tests-for-reduce-time' of github.com:…
robertpatrick Oct 11, 2022
1932273
moving alias-test directory
robertpatrick Oct 12, 2022
de9000c
Call is_set() on discover unless -remote command-line argument is pre…
rakillen Oct 26, 2022
d3b28a9
Merge branch 'main' into WDT-663-fix-alias-tests-for-reduce-time
rakillen Oct 26, 2022
a8a6138
Remove 'Alias Test' stage from Jenkinsfile
rakillen Oct 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ def __init__(self, model_context, dictionary):
self._helper = TestHelper(model_context)
self._ignore_list = self._helper.aliases().get_ignore_attribute_names()

def add_derived_default(self, dictionary, cmo_helper, attribute_name):
if cmo_helper is None:
return None
dictionary[all_utils.DERIVED_DEFAULT] = cmo_helper.derived_default_value()

def add_default_value(self, dictionary, lsa_map, cmo_helper, method_helper, attribute_name=None):
"""
Add information about the attribute value to the dictionary. Store the values from the wlst.ls() map
Expand Down Expand Up @@ -81,6 +86,7 @@ def add_default_value(self, dictionary, lsa_map, cmo_helper, method_helper, attr
class_name=self.__class_name, method_name=_method_name)

if cmo_value != all_utils.FAIL and cmo_attr_type != all_utils.UNKNOWN:

dictionary[all_utils.CMO_TYPE] = self.type_it(mbean_type, attribute_name, cmo_attr_type)
dictionary[all_utils.CMO_DEFAULT] = \
self.convert_attribute(attribute_name, cmo_value, value_type=dictionary[all_utils.CMO_TYPE])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def __get_attributes(self, mbean_instance):
dict_name = attribute
holder = all_utils.dict_obj()
self.add_default_value(holder, lsa_map, attribute_helper, method_attribute_helper)
self.add_derived_default(holder, attribute_helper, attribute)
attribute_helper.generate_attribute(holder)
_add_restart_value(holder)
attribute_map[dict_name] = all_utils.sort_dict(holder)
Expand All @@ -323,6 +324,7 @@ def __get_attributes(self, mbean_instance):
holder = all_utils.dict_obj()
self.add_default_value(holder, lsa_map, attribute_helper, method_attribute_helper,
attribute_name=dict_name)
self.add_derived_default(holder, attribute_helper, dict_name)
attribute_helper.generate_attribute(holder)
_add_restart_value(holder)
attribute_map[dict_name] = all_utils.sort_dict(holder)
Expand Down Expand Up @@ -350,6 +352,7 @@ def __get_attributes(self, mbean_instance):
holder = all_utils.dict_obj()
self.add_default_value(holder, lsa_map, attribute_helper, method_attribute_helper,
attribute_name=lsa_only)
self.add_derived_default(holder, attribute_helper, lsa_only)
method_attribute_helper.generate_attribute(holder)
_add_restart_value(holder)
attribute_map[lsa_only] = all_utils.sort_dict(holder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ def __folder_hierarchy(self, mbean_dictionary, mbean_path):
self.__logger.fine('Child MBean {0} is in the MBI information but not the MBeanInfo information',
mbean_type, class_name=self.__class_name__, method_name=_method_name)

print 'mbean_type = ', mbean_type

if attribute_helper.is_reference_only():
mbean_dictionary[mbean_type] = all_utils.dict_obj()
# This non-attribute might have been added as a folder, which it is not
Expand Down Expand Up @@ -192,6 +190,7 @@ def __get_attributes(self, mbean_instance):
class_name=self.__class_name__, method_name=_method_name)
holder = all_utils.dict_obj()
self.add_default_value(holder, lsa_map, attribute_helper, method_helper)
self.add_derived_default(holder, attribute_helper, attribute)
attribute_helper.generate_attribute(holder)
attributes[attribute] = all_utils.sort_dict(holder)
else:
Expand All @@ -202,6 +201,7 @@ def __get_attributes(self, mbean_instance):
class_name=self.__class_name__, method_name=_method_name)
holder = all_utils.dict_obj()
self.add_default_value(holder, lsa_map, attribute_helper, method_helper)
self.add_derived_default(holder, info_attribute_helper, attribute)
attribute_helper.generate_attribute(holder)
attributes[attribute] = all_utils.sort_dict(holder)

Expand All @@ -221,6 +221,7 @@ def __get_attributes(self, mbean_instance):
class_name=self.__class_name__, method_name=_method_name)
holder = all_utils.dict_obj()
self.add_default_value(holder, lsa_map, attribute_helper, method_helper)
self.add_derived_default(holder, info_attribute_helper, attribute)
attribute_helper.generate_attribute(holder)
attributes[attribute] = all_utils.sort_dict(holder)

Expand Down Expand Up @@ -251,6 +252,7 @@ def __get_attributes(self, mbean_instance):
# if to find attributes without a set method that CAN be set in offline.
# However, I suspect that if no set method, then cannot RW
self.add_default_value(holder, lsa_map, attribute_helper, method_helper)
self.add_derived_default(holder, info_attribute_helper, attribute)
if attribute_helper.is_attribute_found():
self.__logger.finer('MBean {0} attribute {1} in LSA map will generate attribute info '
'from additional helper', mbean_type, lsa_only,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ def default_value(self):
_method_name = 'default_value'
self.__logger.entering(class_name=self.__class_name__, method_name=_method_name)
default = None
derivedDefault = None
if self.__exists:
values = self.__get_descriptor_values_keys()
if 'defaultValueNull' in values:
Expand All @@ -338,9 +339,15 @@ def default_value(self):
'Using the attribute value {2} : descriptor keys={3}',
self.get_mbean_type(), self.get_name(), default, self.__get_descriptor_values_keys(),
class_name=self.__class_name__, method_name=_method_name)

self.__logger.exiting(result=default, class_name=self.__class_name__, method_name=_method_name)
return default

def derived_default_value(self):
if self.__attribute_info is None:
return None
return self.__attribute_info.getValue('restDerivedDefault')

def attribute_value(self):
if self.is_valid_getter():
return self.__attribute_value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ def attribute_type(self):
class_name=self.__class_name__, method_name=_method_name)
return attr_type

def derived_default_value(self):
return None

def default_value(self):
return self.attribute_value()

Expand Down
4 changes: 4 additions & 0 deletions alias-test/src/test/python/aliastest/generate/mbi_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ def attribute_type(self):
class_name=self.__class_name__, method_name=_method_name)
return attr_type

def derived_default_value(self):
return self.__get_descriptor_value('restDerivedDefault')

def default_value(self):
_method_name = 'default_value'
self.__logger.entering(class_name=self.__class_name__, method_name=_method_name)
Expand All @@ -307,6 +310,7 @@ def default_value(self):
' in descriptor. Using the attribute value {2} : descriptor keys={3}',
self.get_mbean_type(), self.get_name(), default, self.__get_descriptor_field_keys(),
class_name=self.__class_name__, method_name=_method_name)

self.__logger.exiting(result=default, class_name=self.__class_name__, method_name=_method_name)
return default

Expand Down
1 change: 1 addition & 0 deletions alias-test/src/test/python/aliastest/util/all_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
FALSE = 'false'
RECHECK = 'recheck'
ADDITIONAL_RECHECK = "additional"
DERIVED_DEFAULT = 'derived_default'
TYPE = 'wlst_type'
LSA_TYPE = 'lsa_wlst_type'
GET_TYPE = 'get_wlst_type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ def check_default_value(self, location, attribute, attribute_info, attr_default,
'Attribute=%s : Alias=%s' % (str(check_attr), str(model_default_value))
self.add_error(location, ERROR_ATTRIBUTE_WRONG_DEFAULT_VALUE, message=message,
attribute=attribute)

_logger.exiting(result=all_utils.str_bool(match), class_name=CLASS_NAME, method_name=_method_name)
return match, model_name, model_value

Expand Down
10 changes: 5 additions & 5 deletions alias-test/src/test/resources/runIntegrationTest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ SET VERSION=12213
SET WLS_VERSION=12.2.1.3.0
SET PORT=7001

SET TEST_HOME=c:\Users\crountre\workspace\weblogic-deploy-tooling\alias-test\src\test
SET TEST_HOME="c:\Users\CAROLY~1\workspace\weblogic-deploy-tooling\alias-test\src\test"
SET PYTHON_HOME=c:\jython2.7.2
@REM SET JAVA_HOME=d:\jcs1036\jdk1.7.0_80
SET JAVA_HOME=\jdk1.8.0_201
SET JAVA_HOME=\jdk1.8.0_311
@REM SET JAVA_HOME=\jdk-11.0.4
@REM SET JAVA_HOME=C:\weblogic\dev\auto_download\x86_64\jdk180211b12\jdk1.8.0_211
SET BASE_HOME=C:\oracle\wls
SET ORACLE_HOME=%BASE_HOME%%VERSION%
@REM SET ORACLE_HOME=C:\Users\crountre\src123100_build\Oracle_Home
@REM SET ORACLE_HOME=C:\Users\Carolyn Rountree\src123100_build\Oracle_Home
@REM SET ORACLE_HOME=D:\jcs1036\mwhome
@REM SET WLST_PATH_DIR=%ORACLE_HOME%\oracle_common
@REM SET WLST_PATH_DIR=%ORACLE_HOME%\wlserver_10.3
SET DOMAIN_HOME=%ORACLE_HOME%\user_projects\domains\system_test_domain
SET TESTFILES=c:\Users\crountre\temp\testfiles-12.2.1.4
SET TESTFILES="c:\Users\CAROLY~1\temp\testfiles-12.2.1.4"
SET ADMIN_USER=weblogic
SET ADMIN_PASSWORD=welcome1
SET ADMIN_URL=t3://localhost:7001
SET WLSDEPLOY_HOME=c:\Users\crountre\temp\weblogic-deploy
SET WLSDEPLOY_HOME=c:\Users\CAROLY~1\temp\weblogic-deploy

echo "%TEST_HOME%\resources\doGenerateSC.cmd -oracle_home %ORACLE_HOME% -domain_home %DOMAIN_HOME% -testfiles_path %TESTFILES% -admin_user %ADMIN_USER% -admin_pass %ADMIN_PASSWORD% -admin_url %ADMIN_URL%"
CALL %TEST_HOME%\resources\doGenerateSC.cmd -oracle_home %ORACLE_HOME% -domain_home %DOMAIN_HOME% -testfiles_path %TESTFILES% -admin_user %ADMIN_USER% -admin_pass %ADMIN_PASSWORD% -admin_url %ADMIN_URL%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ private boolean isRenameNecessary(String entryName) throws WLSDeployArchiveIOExc

boolean renameNeeded = false;
Map<String, ZipEntry> zipEntryMap = getZipFileEntries(getFile());
System.out.println("zipEntryMap *** " + zipEntryMap.toString());
if (zipEntryMap.containsKey(entryName)) {
LOGGER.finest("WLSDPLY-01534", entryName);
renameNeeded = true;
Expand Down
1 change: 1 addition & 0 deletions core/src/main/python/wlsdeploy/aliases/alias_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CONTAINS = 'contains'
DEFAULT_NAME_VALUE = 'default_name_value'
DEFAULT_VALUE = 'default_value'
DERIVED_DEFAULT = 'derived_default'
FLATTENED_FOLDER_DATA = 'flattened_folder_data'
FOLDERS = 'folders'
FOLDER_ORDER = 'folder_order'
Expand Down
21 changes: 21 additions & 0 deletions core/src/main/python/wlsdeploy/aliases/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from wlsdeploy.aliases.alias_constants import ATTRIBUTES
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
from wlsdeploy.aliases.alias_constants import DEFAULT_VALUE
from wlsdeploy.aliases.alias_constants import DERIVED_DEFAULT
from wlsdeploy.aliases.alias_constants import FLATTENED_FOLDER_DATA
from wlsdeploy.aliases.alias_constants import FOLDERS
from wlsdeploy.aliases.alias_constants import GET
Expand Down Expand Up @@ -1297,6 +1298,26 @@ def decrypt_password(self, text):

return rtnval

def is_derived_default(self, location, model_attribute):
"""
Return whether the default is derived by WLST.
:param location: current location
:param model_attribute: model name of attribute to check
:return: True if the default is derived
"""
_method_name = "get_derived_default"
self._logger.entering(model_attribute, class_name=self._class_name, method_name=_method_name)
result = False
try:
attribute_info = self._alias_entries.get_alias_attribute_entry_by_wlst_name(location, model_attribute)
if attribute_info is not None and DERIVED_DEFAULT in attribute_info:
result = attribute_info[DERIVED_DEFAULT]
except AliasException, ae:
self._raise_exception(ae, _method_name, 'WLSDPLY-19045', model_attribute, location.get_folder_path(),
ae.getLocalizedMessage())
self._logger.exiting(class_name=self._class_name, method_name=_method_name, result=result)
return result

###########################################################################
# Convenience Methods #
###########################################################################
Expand Down
14 changes: 10 additions & 4 deletions core/src/main/python/wlsdeploy/tool/discover/discoverer.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ def _populate_model_parameters(self, dictionary, location):
wlst_value = wlst_lsa_params[wlst_lsa_param]

# if attribute was never set (online only), don't add to the model
if not self._wlst_helper.is_set(wlst_lsa_param):
_logger.finest('WLSDPLY-06157', wlst_lsa_param, str(location), class_name=_class_name,
method_name=_method_name)
try:
if self._aliases.is_derived_default(location, wlst_lsa_param) and \
not self._wlst_helper.is_set(wlst_lsa_param):
_logger.finest('WLSDPLY-06157', wlst_lsa_param, str(location), class_name=_class_name,
method_name=_method_name)
continue
except DiscoverException, de:
_logger.info("WLSDPLY-06158", wlst_lsa_param, str(location), de.getLocalizedMessage(),
class_name=_class_name, method_name=_method_name)
continue

self._add_to_dictionary(dictionary, location, wlst_lsa_param, wlst_value, wlst_path)
Expand All @@ -153,7 +159,7 @@ def _get_attribute_value_with_get(self, wlst_get_param, wlst_path):
wlst_value = self._wlst_helper.get(wlst_get_param)
success = True
except DiscoverException, pe:
_logger.warning('WLSDPLY-06127', wlst_get_param, wlst_path, pe.getLocalizedMessage(),
_logger.info('WLSDPLY-06127', wlst_get_param, wlst_path, pe.getLocalizedMessage(),
class_name=_class_name, method_name=_method_name)
return success, wlst_value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"OnDemandContextPaths": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandContextPaths", "wlst_path": "WP001", "default_value": "[]", "wlst_type": "jarray", "get_method": "GET", "access": "RO" } ],
"OnDemandDisplayRefresh": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandDisplayRefresh", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "get_method": "GET", "access": "RO" } ],
"ParallelDeployModules": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployModules", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ],
"ParallelDeployModules": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployModules", "wlst_path": "WP001", "default_value": "false", "derived_default": "true", "wlst_type": "boolean" } ],
"PartitionName": [ {"version": "[12.2.1,)", "wlst_mode": "online", "wlst_name": "PartitionName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" , "get_method": "GET", "access": "RO" } ],
"PlanDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanDir", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "${:ROD}", "uses_path_tokens": "true" } ],
"PlanPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanPath", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "${:ROD}", "uses_path_tokens": "true" } ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"attributes": {
"ImplicitBeanDiscoveryEnabled": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ImplicitBeanDiscoveryEnabled", "wlst_path": "WP001", "default_value": "true", "wlst_type": "boolean" } ],
"Notes": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"Policy": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "Policy", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
"Policy": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "Policy", "wlst_path": "WP001", "default_value": "${__NULL__:Enabled}", "wlst_type": "string" } ]
},
"wlst_attributes_path": "WP001",
"wlst_paths": {
Expand Down
Loading