Skip to content

Commit 16c4725

Browse files
committed
Merge branch 'owls126595_rel42' into 'release/4.2'
Owls126595 rel42 See merge request weblogic-cloud/weblogic-kubernetes-operator!4994
2 parents f112b8a + 05129cc commit 16c4725

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDynamicUpdatePart2.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
4848
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.withStandardRetryPolicy;
4949
import static oracle.weblogic.kubernetes.utils.PodUtils.getExternalServicePodName;
50+
import static oracle.weblogic.kubernetes.utils.PodUtils.getPodCreationTime;
5051
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
5152
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
5253
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -74,6 +75,8 @@ class ItMiiDynamicUpdatePart2 {
7475
public static Path pathToChangReadsYaml = null;
7576
static LoggingFacade logger = null;
7677

78+
static boolean isDataSourceCreated = false;
79+
7780
/**
7881
* Install Operator.
7982
* Create domain resource defintion.
@@ -167,7 +170,7 @@ void testMiiDeleteAppChangeDBUrlWithCommitUpdateAndRoll() {
167170
assertNotEquals(-1, adminServiceNodePort, "admin server default node port is not valid");
168171
assertTrue(checkSystemResourceConfigViaAdminPod(helper.adminServerPodName, helper.domainNamespace,
169172
"JDBCSystemResources/TestDataSource2/JDBCResource/JDBCDriverParams",
170-
"newdburl"), "JDBCSystemResource DB URL not found");
173+
"jdbc:oracle:thin:@host:1234:sid"), "JDBCSystemResource DB URL not found");
171174
logger.info("JDBCSystemResource DB URL found");
172175

173176
// verify the application is undeployed
@@ -179,6 +182,7 @@ void testMiiDeleteAppChangeDBUrlWithCommitUpdateAndRoll() {
179182
// check that the domain status condition contains the correct type and expected reason
180183
logger.info("verifying the domain status condition contains the correct type and expected status");
181184
helper.verifyDomainStatusConditionNoErrorMsg("Completed", "True");
185+
isDataSourceCreated = true;
182186
}
183187

184188
/**
@@ -197,9 +201,18 @@ void testMiiDeleteDatasource() {
197201

198202
// This test uses the WebLogic domain created in BeforeAll method
199203
// BeforeEach method ensures that the server pods are running
200-
LinkedHashMap<String, OffsetDateTime> pods =
201-
helper.addDataSourceAndVerify(false);
202-
204+
LinkedHashMap<String, OffsetDateTime> pods = new LinkedHashMap();
205+
if (!isDataSourceCreated) {
206+
pods = helper.addDataSourceAndVerify(false);
207+
} else {
208+
// get the creation time of the admin server pod before patching
209+
pods.put(helper.adminServerPodName, getPodCreationTime(helper.domainNamespace, helper.adminServerPodName));
210+
// get the creation time of the managed server pods before patching
211+
for (int i = 1; i <= helper.replicaCount; i++) {
212+
pods.put(helper.managedServerPrefix + i,
213+
getPodCreationTime(helper.domainNamespace, helper.managedServerPrefix + i));
214+
}
215+
}
203216
// write sparse yaml to delete datasource to file
204217
Path pathToDeleteDSYaml = Paths.get(WORK_DIR + "/deleteds.yaml");
205218
String yamlToDeleteDS = "resources:\n"

integration-tests/src/test/resources/wdt-models/model.jdbc2.update2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414
RowPrefetchSize: 200
1515
JNDIName: jdbc/TestDataSource2
1616
JDBCDriverParams:
17-
URL: 'newdburl'
17+
URL: 'jdbc:oracle:thin:@host:1234:sid'
1818
PasswordEncrypted: '@@SECRET:@@ENV:DOMAIN_UID@@-db-secret:password@@'
1919
DriverName: oracle.jdbc.OracleDriver
2020
Properties:

0 commit comments

Comments
 (0)