Skip to content

Commit 198bb33

Browse files
authored
Merge pull request #996 from oracle/sitConfigMS
Sit config ms
2 parents 540b74b + dde968a commit 198bb33

File tree

4 files changed

+74
-7
lines changed

4 files changed

+74
-7
lines changed

integration-tests/USECASES.MD

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ Basic Use Cases described above are verified in all the domain configurations. A
7474
| Server pods restarted by changing includeServerOutInPodLog | Verify admin and managed server pods being restarted by property change: includeServerOutInPodLog: true --> includeServerOutInPodLog: false |
7575
| Server pods restarted by changing logHomeEnable | Verify admin and managed server pods being restarted by property change: logHomeEnabled: true --> logHomeEnabled: false |
7676

77-
| Overrides | Usecase |
77+
Configuration Overrides Usecases
78+
79+
| Override | Usecase |
7880
| --- | --- |
79-
| 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 |
81+
| Configuration override | Override the administration server `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 dynamic cluster server template's `max-message-size` is overridden for managed servers. 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 |
8082
| 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. |
8183
| 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`. |
8284
| 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. |

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

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,13 @@ public static void staticUnPrepare() throws Exception {
112112
}
113113

114114
/**
115-
* This test covers custom configuration override use cases for config.xml.
115+
* This test covers custom configuration override use cases for config.xml for administration
116+
* server.
116117
*
117118
* <p>The test checks the overridden config.xml attributes connect-timeout, max-message-size,
118119
* restart-max, JMXCore and ServerLifeCycle debug flags, the T3Channel public address. The
119-
* overridden are verified against the ServerConfig MBean tree. It does not verifies whether the
120-
* overridden values are applied to the runtime.
120+
* overridden values are verified against the ServerConfig MBean tree. It does not verifies
121+
* whether the overridden values are applied to the runtime.
121122
*
122123
* @throws Exception when the assertion fails due to unmatched values
123124
*/
@@ -142,6 +143,36 @@ public void testCustomSitConfigOverridesForDomain() throws Exception {
142143
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
143144
}
144145

146+
/**
147+
* This test covers custom configuration override use cases for config.xml for managed server.
148+
*
149+
* <p>The test checks the overridden config.xml server template attribute max-message-size. The
150+
* overridden values are verified against the ServerConfig MBean tree. It does not verifies
151+
* whether the overridden values are applied to the runtime.
152+
*
153+
* @throws Exception when the assertion fails due to unmatched values
154+
*/
155+
@Test
156+
public void testCustomSitConfigOverridesForDomainMS() throws Exception {
157+
Assume.assumeFalse(QUICKTEST);
158+
boolean testCompletedSuccessfully = false;
159+
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
160+
logTestBegin(testMethod);
161+
ExecResult result =
162+
TestUtils.exec(
163+
KUBE_EXEC_CMD
164+
+ " 'sh runSitConfigTests.sh "
165+
+ fqdn
166+
+ " "
167+
+ T3CHANNELPORT
168+
+ " weblogic welcome1 "
169+
+ testMethod
170+
+ " managed-server1'");
171+
assertResult(result);
172+
testCompletedSuccessfully = true;
173+
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
174+
}
175+
145176
/**
146177
* This test covers custom resource override use cases for JDBC resource.
147178
*

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@
1414
<d:public-address f:combine-mode="replace">${secret:customsitconfigdomain-test-secrets.hostname}</d:public-address>
1515
</d:network-access-point>
1616
</d:server>
17+
<d:server-template>
18+
<d:name>cluster-1-template</d:name>
19+
<d:max-message-size f:combine-mode="add">77777777</d:max-message-size>
20+
</d:server-template>
1721
</d:domain>

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public class SitConfigTests {
6868
private ServerRuntimeMBean serverRuntime;
6969
private static final String JNDI = "/jndi/";
7070

71-
private final String adminHost;
72-
private final String adminPort;
71+
private String adminHost;
72+
private String adminPort;
7373
private final String adminUser;
7474
private final String adminPassword;
7575

@@ -109,6 +109,14 @@ public static void main(String args[]) throws Exception {
109109
test.verifyT3ChannelPublicPort(30091);
110110
}
111111

112+
if (testName.equals("testCustomSitConfigOverridesForDomainMS")) {
113+
// the values passed to these verify methods are the attribute values overrrideen in the
114+
// config.xml. These are just randomly chosen attributes and values to override
115+
String serverName = args[5];
116+
test.connectToManagedServer(serverName);
117+
test.verifyMaxMessageSize(77777777);
118+
}
119+
112120
if (testName.equals("testCustomSitConfigOverridesForJdbc")) {
113121
String JDBC_URL = args[5];
114122
test.testSystemResourcesJDBCAttributeChange("JdbcTestDataSource-0", JDBC_URL);
@@ -574,6 +582,28 @@ protected WLDFSystemResourceMBean getWLDFSystemModule(String resourceName) {
574582
return wldfResource;
575583
}
576584

585+
/**
586+
* Looks up the managed server public listen address and port, closes the existing MBeanServer
587+
* connection to admin server and creates MBeanServer connection to the given managed server
588+
*
589+
* @param serverName name of the managed server to which to create MBeanServerConnection
590+
* @throws Exception when connection close fails or when new connection to managed server fails.
591+
*/
592+
private void connectToManagedServer(String serverName) throws Exception {
593+
ServerMBean[] servers = runtimeServiceMBean.getDomainConfiguration().getServers();
594+
try {
595+
for (ServerMBean server : servers) {
596+
if (server.getName().equals(serverName)) {
597+
adminHost = server.getListenAddress();
598+
adminPort = String.valueOf(server.getListenPort());
599+
}
600+
}
601+
} finally {
602+
jmxConnector.close();
603+
createConnections();
604+
}
605+
}
606+
577607
/**
578608
* Prints message in standard out. Short name method to System.out.println.
579609
*

0 commit comments

Comments
 (0)