Skip to content

Commit fa7f22e

Browse files
committed
addressed all the review comments
1 parent 181a79e commit fa7f22e

File tree

9 files changed

+37
-23
lines changed

9 files changed

+37
-23
lines changed

integration-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Configuration Overrides Usecases
8585
| Configuration override | Override the administration server properties `connect-timeout`, `max-message-size`, `restart-max`, `debug-server-life-cycle` and `debug-jmx-core` debug flags. Also T3Channel public address using Kubernetes secret. The override is verified by JMX client connecting to the serverConfig MBean tree and the values are checked against the expected values. The test client connects to the overridden T3 public address and port to connect to the MBean servers |
8686
| JDBC Resource Override | Override JDBC connection pool properties; `initialCapacity`, `maxCapacity`, `test-connections-on-reserve`, `connection-harvest-max-count`, `inactive-connection-timeout-seconds`. Override the JDBC driver parameters like data source `URL`, `DB` `user` and `password` using kubernetes secret. The test verifies the overridden functionality datasource `URL`, `user`, `password` by getting the data source connection and running DDL statement it is connected to. |
8787
| JMS Resource Override | Override UniformDistributedTopic Delivery Failure Parameters, `redelivery-limit` and `expiration-policy`. The JMX test client verifies the serverConfig MBean tree for the expected delivery failure parameters, `redelivery-limit` and `expiration-policy`. |
88-
| WLDF Resource Override | Override `wldf-instrumentation-monitor` and `harvester` in a diagnostics module. The test client verifies the new instrumentation monitors / harvesters set by getting the WLDF resource from serverConfig tree with expected values. |
88+
| WLDF Resource Override | Override `wldf-instrumentation-monitor` and `harvester` in a diagnostics module. The test client verifies the new instrumentation monitors/harvesters set by getting the WLDF resource from serverConfig tree with expected values. |
8989

9090
# Directory Configuration and Structure
9191

integration-tests/src/test/java/oracle/kubernetes/operator/ITSitConfig.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.nio.file.Files;
1313
import java.nio.file.Path;
1414
import java.nio.file.Paths;
15-
import java.util.*;
15+
import java.util.Map;
1616
import java.util.logging.Level;
1717
import oracle.kubernetes.operator.utils.Domain;
1818
import oracle.kubernetes.operator.utils.ExecResult;
@@ -24,6 +24,7 @@
2424
import org.junit.BeforeClass;
2525
import org.junit.Test;
2626

27+
/** JUnit test class used for testing configuration override use cases. */
2728
public class ITSitConfig extends BaseTest {
2829

2930
private static String TESTSCRIPTDIR;
@@ -35,7 +36,6 @@ public class ITSitConfig extends BaseTest {
3536
private static String fqdn;
3637
private static String JDBC_URL;
3738
private static String KUBE_EXEC_CMD;
38-
3939
private static Domain domain;
4040
private static Operator operator1;
4141

@@ -94,16 +94,11 @@ public static void staticPrepare() throws Exception {
9494
@AfterClass
9595
public static void staticUnPrepare() throws Exception {
9696
if (!QUICKTEST) {
97-
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
98-
logger.info("BEGIN");
99-
logger.info("Run once, release cluster lease");
100-
10197
destroySitConfigDomain();
10298
tearDown();
10399
ExecResult result =
104100
TestUtils.exec(
105101
"kubectl delete -f " + TESTSCRIPTDIR + "/sitconfig/mysql/mysql-dbservices.yml");
106-
logger.info("SUCCESS");
107102
}
108103
}
109104

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,8 +1283,7 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
12831283
+ domainNS
12841284
+ " create secret generic "
12851285
+ domainUid
1286-
+ "-"
1287-
+ "test-secrets"
1286+
+ "-test-secrets"
12881287
+ " --from-literal=hostname="
12891288
+ TestUtils.getHostName()
12901289
+ " --from-literal=dbusername=root"

integration-tests/src/test/resources/sitconfig/configoverrides/config.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!-- Copyright 2019, Oracle Corporation and/or its affiliates. All rights
2+
reserved. -->
3+
<!-- Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -->
14
<?xml version='1.0' encoding='UTF-8'?>
25
<d:domain xmlns:d="http://xmlns.oracle.com/weblogic/domain" xmlns:f="http://xmlns.oracle.com/weblogic/domain-fragment" xmlns:s="http://xmlns.oracle.com/weblogic/situational-config" >
36
<d:server>

integration-tests/src/test/resources/sitconfig/configoverrides/diagnostics-WLDF-MODULE-0.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!-- Copyright 2019, Oracle Corporation and/or its affiliates. All rights
2+
reserved. -->
3+
<!-- Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -->
14
<?xml version='1.0' encoding='UTF-8'?>
25
<wldf:wldf-resource
36
xmlns:wldf="http://xmlns.oracle.com/weblogic/weblogic-diagnostics"

integration-tests/src/test/resources/sitconfig/configoverrides/jdbc-JdbcTestDataSource-0.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!-- Copyright 2019, Oracle Corporation and/or its affiliates. All rights
2+
reserved. -->
3+
<!-- Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -->
14
<?xml version='1.0' encoding='UTF-8'?>
25
<jdbc:jdbc-data-source
36
xmlns:jdbc="http://xmlns.oracle.com/weblogic/jdbc-data-source"

integration-tests/src/test/resources/sitconfig/configoverrides/jms-ClusterJmsSystemResource.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!-- Copyright 2019, Oracle Corporation and/or its affiliates. All rights
2+
reserved. -->
3+
<!-- Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -->
14
<?xml version='1.0' encoding='UTF-8'?>
25
<jms:weblogic-jms
36
xmlns:jms="http://xmlns.oracle.com/weblogic/weblogic-jms"

integration-tests/src/test/resources/sitconfig/java/SitConfigTests.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
1+
// Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
22
// Licensed under the Universal Permissive License v 1.0 as shown at
33
// http://oss.oracle.com/licenses/upl.
44
package oracle.kubernetes.operator;
@@ -8,11 +8,13 @@
88
import java.sql.Connection;
99
import java.sql.SQLException;
1010
import java.sql.Statement;
11-
import java.util.*;
11+
import java.util.Arrays;
1212
import java.util.HashMap;
13+
import java.util.Hashtable;
1314
import java.util.logging.Level;
1415
import java.util.logging.Logger;
1516
import javax.management.MBeanServerConnection;
17+
import javax.management.MBeanServerInvocationHandler;
1618
import javax.management.MalformedObjectNameException;
1719
import javax.management.ObjectName;
1820
import javax.management.remote.JMXConnector;
@@ -29,7 +31,13 @@
2931
import weblogic.j2ee.descriptor.wl.JDBCDriverParamsBean;
3032
import weblogic.j2ee.descriptor.wl.JMSBean;
3133
import weblogic.j2ee.descriptor.wl.UniformDistributedTopicBean;
32-
import weblogic.management.configuration.*;
34+
import weblogic.management.configuration.DomainMBean;
35+
import weblogic.management.configuration.JDBCSystemResourceMBean;
36+
import weblogic.management.configuration.JMSSystemResourceMBean;
37+
import weblogic.management.configuration.NetworkAccessPointMBean;
38+
import weblogic.management.configuration.ServerDebugMBean;
39+
import weblogic.management.configuration.ServerMBean;
40+
import weblogic.management.configuration.WLDFSystemResourceMBean;
3341
import weblogic.management.jmx.MBeanServerInvocationHandler;
3442
import weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean;
3543
import weblogic.management.mbeanservers.edit.ConfigurationManagerMBean;
@@ -84,6 +92,7 @@ public class SitConfigTests {
8492
* @throws Exception
8593
*/
8694
public static void main(String args[]) throws Exception {
95+
8796
String adminHost = args[0];
8897
String adminPort = args[1];
8998
String adminUser = args[2];
@@ -106,13 +115,16 @@ public static void main(String args[]) throws Exception {
106115
test.verifyT3ChannelPublicAddress(adminHost);
107116
test.verifyT3ChannelPublicPort(30091);
108117
}
118+
109119
if (testName.equals("testCustomSitConfigOverridesForJdbc")) {
110120
String JDBC_URL = args[5];
111121
test.testSystemResourcesJDBCAttributeChange("JdbcTestDataSource-0", JDBC_URL);
112122
}
123+
113124
if (testName.equals("testCustomSitConfigOverridesForJms")) {
114125
test.testSystemResourcesJMSAttributeChange();
115126
}
127+
116128
if (testName.equals("testCustomSitConfigOverridesForWldf")) {
117129
test.testSystemResourcesWLDFAttributeAdd();
118130
}
@@ -214,6 +226,7 @@ private MBeanServerConnection lookupMBeanServerConnection(
214226
if (mBeanServerConnection == null) {
215227
throw new Exception("MBean server connection is null");
216228
}
229+
217230
return mBeanServerConnection;
218231
}
219232

@@ -287,6 +300,7 @@ protected void verifyT3ChannelPublicAddress(String expectedValue) {
287300
boolean got = false;
288301
ServerMBean serverMBean = getServerMBean();
289302
NetworkAccessPointMBean[] networkAccessPoints = serverMBean.getNetworkAccessPoints();
303+
290304
for (NetworkAccessPointMBean networkAccessPoint : networkAccessPoints) {
291305
if (networkAccessPoint.getName().equals("T3Channel")) {
292306
assert expectedValue.equals(networkAccessPoint.getPublicAddress())
@@ -303,6 +317,7 @@ protected void verifyT3ChannelPublicPort(int expectedValue) {
303317
boolean got = false;
304318
ServerMBean serverMBean = getServerMBean();
305319
NetworkAccessPointMBean[] networkAccessPoints = serverMBean.getNetworkAccessPoints();
320+
306321
for (NetworkAccessPointMBean networkAccessPoint : networkAccessPoints) {
307322
if (networkAccessPoint.getName().equals("T3Channel")) {
308323
assert expectedValue == networkAccessPoint.getPublicPort()

integration-tests/src/test/resources/sitconfig/scripts/create-domain-auto-custom-sit-config20.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def createWLDFSystemResource(sysName, sysTarget):
1717
def createJMSSystemResource(sysResTarget):
1818
filestore = 'ClusterFileStore'
1919
jmsserver = 'ClusterJmsServer'
20-
#sysResTarget='mycluster'
2120

2221
jmsmodule = 'ClusterJmsSystemResource'
2322
subdeployment = 'ClusterSubDeployment'
@@ -51,7 +50,6 @@ def createJMSSystemResource(sysResTarget):
5150
cd('/JMSSystemResource/' + jmsmodule + '/JmsResource/NO_NAME_0')
5251
myt = create(urt, 'UniformDistributedTopic')
5352
myt.setJNDIName('jms/' + urt)
54-
#myt.setSubDeploymentName(subdeployment)
5553
myt.setDefaultTargetingEnabled(true)
5654

5755
cd('UniformDistributedTopic/' + urt)
@@ -149,23 +147,21 @@ def createDataSource(dsName, dsJNDI, dsUrl, dsUser, dsPassword, dsTarget):
149147
# Configure the Administration Server
150148
# ===================================
151149
cd('/Servers/AdminServer')
152-
# Dont set listenaddress, introspector overrides automatically with sit-config
153-
#set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
150+
# Dont set listenaddress, introspector overrides automatically with config override
154151
set('ListenPort', admin_port)
155152
set('Name', admin_server_name)
156153

157154
create('T3Channel', 'NetworkAccessPoint')
158155
cd('/Servers/%s/NetworkAccessPoints/T3Channel' % admin_server_name)
159156
set('PublicPort', t3_channel_port)
160157
set('PublicAddress', 'junkvalue')
161-
# Dont set listenaddress, introspector overrides automatically with sit-config
162-
#set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
158+
# Dont set listenaddress, introspector overrides automatically with config override
163159
set('ListenPort', t3_channel_port)
164160

165161
cd('/Servers/%s' % admin_server_name)
166162
create(admin_server_name, 'Log')
167163
cd('/Servers/%s/Log/%s' % (admin_server_name, admin_server_name))
168-
# Give incorrect filelog, introspector overrides with sit-config
164+
# Give incorrect filelog, introspector overrides with config override
169165
set('FileName', 'dirdoesnotexist')
170166

171167

@@ -226,7 +222,6 @@ def createDataSource(dsName, dsJNDI, dsUrl, dsUser, dsPassword, dsTarget):
226222
set('DynamicClusterSize', number_of_ms)
227223
set('MaxDynamicClusterSize', number_of_ms)
228224
set('CalculatedListenPorts', false)
229-
# set('Id', 1)
230225

231226
print('Done setting attributes for Dynamic Cluster: %s' % cluster_name);
232227

@@ -235,7 +230,6 @@ def createDataSource(dsName, dsJNDI, dsUrl, dsUser, dsPassword, dsTarget):
235230
createWLDFSystemResource("WLDF-MODULE-0", admin_server_name)
236231

237232
# Write Domain
238-
# ============
239233
writeDomain(domain_path)
240234
closeTemplate()
241235
print 'Domain Created'
@@ -253,5 +247,4 @@ def createDataSource(dsName, dsJNDI, dsUrl, dsUser, dsPassword, dsTarget):
253247
print 'Done'
254248

255249
# Exit WLST
256-
# =========
257250
exit()

0 commit comments

Comments
 (0)