Skip to content

Commit 0f9d07c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into template-fix
2 parents 2b81ca5 + aaf1188 commit 0f9d07c

File tree

130 files changed

+836
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+836
-374
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ private void downloadWlsLoggingExporterJars() throws Exception {
423423

424424
// Make sure downloading completed
425425
while (i < BaseTest.getMaxIterationsPod()) {
426-
if(wlsLoggingExpFile.exists() && snakeyamlFile.exists()) {
426+
if (wlsLoggingExpFile.exists() && snakeyamlFile.exists()) {
427427
break;
428428
}
429429

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public void testAddShutdownOptionsToMsForced() throws Exception {
470470
updateCrdYamlVerifyShutdown(crd, delayTime);
471471

472472
Assert.assertTrue(checkShutdownUpdatedProp(domainUid + "-managed-server1", "Forced"));
473-
if ((1.5 * terminationDefaultOptionsTime < terminationTime)) {
473+
if ((2 * terminationDefaultOptionsTime < terminationTime)) {
474474
logger.info("\"FAILURE: ignored timeout Forced value during shutdown");
475475
throw new Exception("FAILURE: ignored timeout Forced during shutdown");
476476
}
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
// Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
// Licensed under the Universal Permissive License v 1.0 as shown at
3+
// http://oss.oracle.com/licenses/upl.
4+
5+
package oracle.kubernetes.operator;
6+
7+
import java.util.logging.Level;
8+
9+
import org.junit.AfterClass;
10+
import org.junit.Assume;
11+
import org.junit.BeforeClass;
12+
import org.junit.Test;
13+
14+
/** JUnit test class used for testing configuration override use cases for Domain In Image. */
15+
public class ItSitConfigDomainInImage extends SitConfig {
16+
17+
/**
18+
* This method gets called only once before any of the test methods are executed. It does the
19+
* initialization of the integration test properties defined in OperatorIT.properties and setting
20+
* the resultRoot, pvRoot and projectRoot attributes.
21+
*
22+
* @throws Exception when the initialization, creating directories , copying files and domain
23+
* creation fails.
24+
*/
25+
@BeforeClass
26+
public static void staticPrepare() throws Exception {
27+
SitConfig.staticPrepare(
28+
DOMAININIMAGE_WLST_YAML,
29+
"integration-tests/src/test/resources/sitconfig/scripts/create-domain-auto-custom-sit-config-inimage.py");
30+
}
31+
32+
/**
33+
* Destroy domain, delete the MySQL DB container and teardown.
34+
*
35+
* @throws Exception when domain destruction or MySQL container destruction fails
36+
*/
37+
@AfterClass
38+
public static void staticUnPrepare() throws Exception {
39+
SitConfig.staticUnPrepare();
40+
}
41+
42+
/**
43+
* This test covers custom configuration override use cases for config.xml for administration
44+
* server for domain in image WLS servers.
45+
*
46+
* <p>The test checks the overridden config.xml attributes connect-timeout, max-message-size,
47+
* restart-max, JMXCore and ServerLifeCycle debug flags, the T3Channel public address. The
48+
* overridden values are verified against the ServerConfig MBean tree. It does not verifies
49+
* whether the overridden values are applied to the runtime.
50+
*
51+
* @throws Exception when the assertion fails due to unmatched values
52+
*/
53+
@Test
54+
public void testCustomSitConfigOverridesForDomainInImage() throws Exception {
55+
Assume.assumeFalse(QUICKTEST);
56+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
57+
logTestBegin(testMethod);
58+
testCustomSitConfigOverridesForDomain(testMethod);
59+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
60+
}
61+
62+
/**
63+
* This test covers custom configuration override use cases for config.xml for managed server for
64+
* domain in image WLS servers
65+
*
66+
* <p>The test checks the overridden config.xml server template attribute max-message-size. The
67+
* overridden values are verified against the ServerConfig MBean tree. It does not verifies
68+
* whether the overridden values are applied to the runtime.
69+
*
70+
* @throws Exception when the assertion fails due to unmatched values
71+
*/
72+
@Test
73+
public void testCustomSitConfigOverridesForDomainMsInImage() throws Exception {
74+
Assume.assumeFalse(QUICKTEST);
75+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
76+
logTestBegin(testMethod);
77+
testCustomSitConfigOverridesForDomainMS(testMethod);
78+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
79+
}
80+
81+
/**
82+
* This test covers custom resource override use cases for JDBC resource.
83+
*
84+
* <p>The resource override sets the following connection pool properties. initialCapacity,
85+
* maxCapacity, test-connections-on-reserve, connection-harvest-max-count,
86+
* inactive-connection-timeout-seconds in the JDBC resource override file. It also overrides the
87+
* jdbc driver parameters like data source url, db user and password using kubernetes secret.
88+
*
89+
* <p>The overridden values are verified against the ServerConfig MBean tree. It does not verifies
90+
* whether the overridden values are applied to the runtime except the JDBC URL which is verified
91+
* at runtime by making a connection to the MySql database and executing a DDL statement.
92+
*
93+
* @throws Exception when the assertion fails due to unmatched values
94+
*/
95+
@Test
96+
public void testCustomSitConfigOverridesForJdbcInImage() throws Exception {
97+
Assume.assumeFalse(QUICKTEST);
98+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
99+
logTestBegin(testMethod);
100+
testCustomSitConfigOverridesForJdbc(testMethod);
101+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
102+
}
103+
104+
/**
105+
* This test covers custom resource use cases for JMS resource. The JMS resource override file
106+
* sets the following Delivery Failure Parameters re delivery limit and expiration policy for a
107+
* uniform-distributed-topic JMS resource.
108+
*
109+
* <p>The overridden values are verified against the ServerConfig MBean tree. It does not verifies
110+
* whether the overridden values are applied to the runtime.
111+
*
112+
* @throws Exception when the assertion fails due to unmatched values
113+
*/
114+
@Test
115+
public void testCustomSitConfigOverridesForJmsInImage() throws Exception {
116+
Assume.assumeFalse(QUICKTEST);
117+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
118+
logTestBegin(testMethod);
119+
testCustomSitConfigOverridesForJms(testMethod);
120+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
121+
}
122+
123+
/**
124+
* This test covers custom resource override use cases for diagnostics resource. It adds the
125+
* following instrumentation monitors. Connector_After_Inbound, Connector_Around_Outbound,
126+
* Connector_Around_Tx, Connector_Around_Work, Connector_Before_Inbound, and harvesters for
127+
* weblogic.management.runtime.JDBCServiceRuntimeMBean,
128+
* weblogic.management.runtime.ServerRuntimeMBean.
129+
*
130+
* <p>The overridden values are verified against the ServerConfig MBean tree. It does not verifies
131+
* whether the overridden values are applied to the runtime.
132+
*
133+
* @throws Exception when the assertion fails due to unmatched values
134+
*/
135+
@Test
136+
public void testCustomSitConfigOverridesForWldfInImage() throws Exception {
137+
Assume.assumeFalse(QUICKTEST);
138+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
139+
logTestBegin(testMethod);
140+
testCustomSitConfigOverridesForWldf(testMethod);
141+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
142+
}
143+
}
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
// Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
// Licensed under the Universal Permissive License v 1.0 as shown at
3+
// http://oss.oracle.com/licenses/upl.
4+
5+
package oracle.kubernetes.operator;
6+
7+
import java.util.logging.Level;
8+
9+
import org.junit.AfterClass;
10+
import org.junit.Assume;
11+
import org.junit.BeforeClass;
12+
import org.junit.Test;
13+
14+
/** JUnit test class used for testing configuration override use cases for domain in pv WLS. */
15+
public class ItSitConfigDomainInPV extends SitConfig {
16+
17+
/**
18+
* This method gets called only once before any of the test methods are executed. It does the
19+
* initialization of the integration test properties defined in OperatorIT.properties and setting
20+
* the resultRoot, pvRoot and projectRoot attributes.
21+
*
22+
* @throws Exception when the initialization, creating directories , copying files and domain
23+
* creation fails.
24+
*/
25+
@BeforeClass
26+
public static void staticPrepare() throws Exception {
27+
SitConfig.staticPrepare(
28+
DOMAINONPV_WLST_YAML,
29+
"integration-tests/src/test/resources/sitconfig/scripts/create-domain-auto-custom-sit-config20.py");
30+
}
31+
32+
/**
33+
* Destroy domain, delete the MySQL DB container and teardown.
34+
*
35+
* @throws Exception when domain destruction or MySQL container destruction fails
36+
*/
37+
@AfterClass
38+
public static void staticUnPrepare() throws Exception {
39+
SitConfig.staticUnPrepare();
40+
}
41+
42+
/**
43+
* This test covers custom configuration override use cases for config.xml for administration
44+
* server.
45+
*
46+
* <p>The test checks the overridden config.xml attributes connect-timeout, max-message-size,
47+
* restart-max, JMXCore and ServerLifeCycle debug flags, the T3Channel public address. The
48+
* overridden values are verified against the ServerConfig MBean tree. It does not verifies
49+
* whether the overridden values are applied to the runtime.
50+
*
51+
* @throws Exception when the assertion fails due to unmatched values
52+
*/
53+
@Test
54+
public void testCustomSitConfigOverridesForDomainInPV() throws Exception {
55+
Assume.assumeFalse(QUICKTEST);
56+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
57+
logTestBegin(testMethod);
58+
testCustomSitConfigOverridesForDomain(testMethod);
59+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
60+
}
61+
62+
/**
63+
* This test covers custom configuration override use cases for config.xml for managed server.
64+
*
65+
* <p>The test checks the overridden config.xml server template attribute max-message-size. The
66+
* overridden values are verified against the ServerConfig MBean tree. It does not verifies
67+
* whether the overridden values are applied to the runtime.
68+
*
69+
* @throws Exception when the assertion fails due to unmatched values
70+
*/
71+
@Test
72+
public void testCustomSitConfigOverridesForDomainMsInPV() throws Exception {
73+
Assume.assumeFalse(QUICKTEST);
74+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
75+
logTestBegin(testMethod);
76+
testCustomSitConfigOverridesForDomainMS(testMethod);
77+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
78+
}
79+
80+
/**
81+
* This test covers custom resource override use cases for JDBC resource.
82+
*
83+
* <p>The resource override sets the following connection pool properties. initialCapacity,
84+
* maxCapacity, test-connections-on-reserve, connection-harvest-max-count,
85+
* inactive-connection-timeout-seconds in the JDBC resource override file. It also overrides the
86+
* jdbc driver parameters like data source url, db user and password using kubernetes secret.
87+
*
88+
* <p>The overridden values are verified against the ServerConfig MBean tree. It does not verifies
89+
* whether the overridden values are applied to the runtime except the JDBC URL which is verified
90+
* at runtime by making a connection to the MySql database and executing a DDL statement.
91+
*
92+
* @throws Exception when the assertion fails due to unmatched values
93+
*/
94+
@Test
95+
public void testCustomSitConfigOverridesForJdbcInPV() throws Exception {
96+
Assume.assumeFalse(QUICKTEST);
97+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
98+
logTestBegin(testMethod);
99+
testCustomSitConfigOverridesForJdbc(testMethod);
100+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
101+
}
102+
103+
/**
104+
* This test covers custom resource use cases for JMS resource. The JMS resource override file
105+
* sets the following Delivery Failure Parameters re delivery limit and expiration policy for a
106+
* uniform-distributed-topic JMS resource.
107+
*
108+
* <p>The overridden values are verified against the ServerConfig MBean tree. It does not verifies
109+
* whether the overridden values are applied to the runtime.
110+
*
111+
* @throws Exception when the assertion fails due to unmatched values
112+
*/
113+
@Test
114+
public void testCustomSitConfigOverridesForJmsInPV() throws Exception {
115+
Assume.assumeFalse(QUICKTEST);
116+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
117+
logTestBegin(testMethod);
118+
testCustomSitConfigOverridesForJms(testMethod);
119+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
120+
}
121+
122+
/**
123+
* This test covers custom resource override use cases for diagnostics resource. It adds the
124+
* following instrumentation monitors. Connector_After_Inbound, Connector_Around_Outbound,
125+
* Connector_Around_Tx, Connector_Around_Work, Connector_Before_Inbound, and harvesters for
126+
* weblogic.management.runtime.JDBCServiceRuntimeMBean,
127+
* weblogic.management.runtime.ServerRuntimeMBean.
128+
*
129+
* <p>The overridden values are verified against the ServerConfig MBean tree. It does not verifies
130+
* whether the overridden values are applied to the runtime.
131+
*
132+
* @throws Exception when the assertion fails due to unmatched values
133+
*/
134+
@Test
135+
public void testCustomSitConfigOverridesForWldfInPV() throws Exception {
136+
Assume.assumeFalse(QUICKTEST);
137+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
138+
logTestBegin(testMethod);
139+
testCustomSitConfigOverridesForWldf(testMethod);
140+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
141+
}
142+
143+
/**
144+
* Test to verify the configuration override after a domain is up and running. Modifies the
145+
* existing config.xml entries to add startup and shutdown classes verifies those are overridden
146+
* when domain is restarted.
147+
*
148+
* @throws Exception when assertions fail.
149+
*/
150+
@Test
151+
public void testConfigOverrideAfterDomainStartupInPV() throws Exception {
152+
Assume.assumeFalse(QUICKTEST);
153+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
154+
logTestBegin(testMethod);
155+
testConfigOverrideAfterDomainStartup(testMethod);
156+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
157+
}
158+
159+
/**
160+
* This test covers the overriding of JDBC system resource after a domain is up and running. It
161+
* creates a datasource , recreates the K8S configmap with updated JDBC descriptor and verifies
162+
* the new overridden values with restart of the WLS pods
163+
*
164+
* @throws Exception when assertions fail.
165+
*/
166+
@Test
167+
public void testOverrideJdbcResourceAfterDomainStartInPV() throws Exception {
168+
Assume.assumeFalse(QUICKTEST);
169+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
170+
logTestBegin(testMethod);
171+
testOverrideJdbcResourceAfterDomainStart(testMethod);
172+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
173+
}
174+
175+
/**
176+
* This test covers the overriding of JDBC system resource with new kubernetes secret name for
177+
* dbusername and dbpassword.
178+
*
179+
* @throws Exception when assertions fail.
180+
*/
181+
@Test
182+
public void testOverrideJdbcResourceWithNewSecretInPV() throws Exception {
183+
Assume.assumeFalse(QUICKTEST);
184+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
185+
logTestBegin(testMethod);
186+
testOverrideJdbcResourceWithNewSecret(testMethod);
187+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
188+
}
189+
}

0 commit comments

Comments
 (0)